From bb74814f8c354ca7b2e71a167e76474818fde1f1 Mon Sep 17 00:00:00 2001 From: gbubemismith Date: Thu, 14 Aug 2025 08:42:31 -0400 Subject: [PATCH 01/17] Updted open api schema from server --- crates/bitwarden-api-api/Cargo.toml | 19 +++++++------------ .../bitwarden-api-api/src/apis/ciphers_api.rs | 2 +- crates/bitwarden-api-api/src/models/cipher.rs | 3 +++ .../models/cipher_details_response_model.rs | 5 ++++- .../cipher_mini_details_response_model.rs | 3 +++ .../src/models/cipher_mini_response_model.rs | 3 +++ .../src/models/cipher_request_model.rs | 8 ++++++++ .../src/models/cipher_response_model.rs | 3 +++ .../models/cipher_with_id_request_model.rs | 8 ++++++++ crates/bitwarden-api-identity/Cargo.toml | 19 +++++++------------ 10 files changed, 47 insertions(+), 26 deletions(-) diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index 1c68a6cf1..a7a03456d 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -1,6 +1,5 @@ [package] name = "bitwarden-api-api" -description = "Api bindings for the Bitwarden API." categories = ["api-bindings"] version.workspace = true @@ -13,14 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { version = ">=3.8, <4", default-features = false, features = [ - "base64", - "std", - "macros", -] } -url = ">=2.5, <3" -uuid = { workspace = true } +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } diff --git a/crates/bitwarden-api-api/src/apis/ciphers_api.rs b/crates/bitwarden-api-api/src/apis/ciphers_api.rs index c5f0c2ce2..a68a998e6 100644 --- a/crates/bitwarden-api-api/src/apis/ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/ciphers_api.rs @@ -3055,7 +3055,7 @@ pub async fn ciphers_post( pub async fn ciphers_purge_post( configuration: &configuration::Configuration, - organization_id: Option<&str>, + organization_id: Option, secret_verification_request_model: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions diff --git a/crates/bitwarden-api-api/src/models/cipher.rs b/crates/bitwarden-api-api/src/models/cipher.rs index 8bdcdb0bd..77587dac6 100644 --- a/crates/bitwarden-api-api/src/models/cipher.rs +++ b/crates/bitwarden-api-api/src/models/cipher.rs @@ -40,6 +40,8 @@ pub struct Cipher { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, } impl Cipher { @@ -58,6 +60,7 @@ impl Cipher { deleted_date: None, reprompt: None, key: None, + version: None, } } } 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 e0b1958d9..9ea5350d2 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 @@ -23,7 +23,7 @@ pub struct CipherDetailsResponseModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option, + pub data: Option, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(rename = "notes", skip_serializing_if = "Option::is_none")] @@ -59,6 +59,8 @@ pub struct CipherDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -97,6 +99,7 @@ impl CipherDetailsResponseModel { deleted_date: None, reprompt: None, key: None, + version: None, folder_id: None, favorite: None, edit: 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 37d33da67..9b8594be2 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 @@ -59,6 +59,8 @@ pub struct CipherMiniDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, #[serde(rename = "collectionIds", skip_serializing_if = "Option::is_none")] pub collection_ids: Option>, } @@ -87,6 +89,7 @@ impl CipherMiniDetailsResponseModel { deleted_date: None, reprompt: None, key: None, + version: None, collection_ids: None, } } 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 f4596cf22..44d279c63 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 @@ -59,6 +59,8 @@ pub struct CipherMiniResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, } impl CipherMiniResponseModel { @@ -85,6 +87,7 @@ impl CipherMiniResponseModel { deleted_date: None, reprompt: None, key: None, + version: 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 0da128035..1bce90648 100644 --- a/crates/bitwarden-api-api/src/models/cipher_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_request_model.rs @@ -51,6 +51,12 @@ pub struct CipherRequestModel { pub secure_note: Option>, #[serde(rename = "sshKey", skip_serializing_if = "Option::is_none")] pub ssh_key: Option>, + /// The version of the cipher data. Default is 1 for backward compatibility. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Opaque data for versioned clients. + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option, #[serde( rename = "lastKnownRevisionDate", skip_serializing_if = "Option::is_none" @@ -79,6 +85,8 @@ impl CipherRequestModel { identity: None, secure_note: None, ssh_key: None, + version: None, + data: None, last_known_revision_date: None, } } 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 4470969c8..8d24f139c 100644 --- a/crates/bitwarden-api-api/src/models/cipher_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -95,6 +97,7 @@ impl CipherResponseModel { deleted_date: None, reprompt: None, key: None, + version: None, folder_id: None, favorite: None, edit: None, 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 a7f207c55..c9b3b6de4 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 @@ -51,6 +51,12 @@ pub struct CipherWithIdRequestModel { pub secure_note: Option>, #[serde(rename = "sshKey", skip_serializing_if = "Option::is_none")] pub ssh_key: Option>, + /// The version of the cipher data. Default is 1 for backward compatibility. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + /// Opaque data for versioned clients. + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option, #[serde( rename = "lastKnownRevisionDate", skip_serializing_if = "Option::is_none" @@ -81,6 +87,8 @@ impl CipherWithIdRequestModel { identity: None, secure_note: None, ssh_key: None, + version: None, + data: None, last_known_revision_date: None, id, } diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index 022225451..bdbcb8eaa 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -1,6 +1,5 @@ [package] name = "bitwarden-api-identity" -description = "Api bindings for the Bitwarden Identity API." categories = ["api-bindings"] version.workspace = true @@ -13,14 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { version = ">=3.8, <4", default-features = false, features = [ - "base64", - "std", - "macros", -] } -url = ">=2.5, <3" -uuid = { workspace = true } +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } From 3f0b75d0c17367f647f62cccfebeb25a79af32a2 Mon Sep 17 00:00:00 2001 From: gbubemismith Date: Thu, 14 Aug 2025 08:43:37 -0400 Subject: [PATCH 02/17] Created migration functionality with two versioning examples --- crates/bitwarden-vault/src/cipher/cipher.rs | 22 ++++ .../src/cipher/cipher_client.rs | 110 +++++++++++++++- .../src/cipher/migrations/mod.rs | 2 + .../src/cipher/migrations/registry.rs | 64 ++++++++++ .../src/cipher/migrations/versions/mod.rs | 5 + .../cipher/migrations/versions/v1_to_v2.rs | 54 ++++++++ .../cipher/migrations/versions/v2_to_v3.rs | 118 ++++++++++++++++++ 7 files changed, 373 insertions(+), 2 deletions(-) create mode 100644 crates/bitwarden-vault/src/cipher/migrations/mod.rs create mode 100644 crates/bitwarden-vault/src/cipher/migrations/registry.rs create mode 100644 crates/bitwarden-vault/src/cipher/migrations/versions/mod.rs create mode 100644 crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs create mode 100644 crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index cce9a2360..9e5855e91 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -32,6 +32,9 @@ use crate::{ VaultParseError, }; +// Version constant +pub const CURRENT_CIPHER_VERSION: u32 = 3; + #[allow(missing_docs)] #[bitwarden_error(flat)] #[derive(Debug, Error)] @@ -46,6 +49,12 @@ pub enum CipherError { EncryptError(#[from] EncryptError), #[error("This cipher contains attachments without keys. Those attachments will need to be reuploaded to complete the operation")] AttachmentsWithoutKeys, + + // POC - Cipher versioning + #[error("Unsupported cipher version {0}")] + UnsupportedCipherVersion(u32), + #[error("Migration failed: {0}")] + MigrationFailed(String), } /// Helper trait for operations on cipher types. @@ -136,6 +145,9 @@ pub struct Cipher { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + + pub version: Option, + pub data: Option, } bitwarden_state::register_repository_item!(Cipher, "Cipher"); @@ -179,6 +191,8 @@ pub struct CipherView { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + + pub version: Option, } #[allow(missing_docs)] @@ -333,6 +347,8 @@ impl CompositeEncryptable for CipherView { deleted_date: cipher_view.deleted_date, revision_date: cipher_view.revision_date, permissions: cipher_view.permissions, + version: cipher_view.version, + data: None, }) } } @@ -376,6 +392,7 @@ impl Decryptable for Cipher { creation_date: self.creation_date, deleted_date: self.deleted_date, revision_date: self.revision_date, + version: self.version, }; // For compatibility we only remove URLs with invalid checksums if the cipher has a key @@ -757,6 +774,8 @@ impl TryFrom for Cipher { deleted_date: cipher.deleted_date.map(|d| d.parse()).transpose()?, revision_date: require!(cipher.revision_date).parse()?, key: EncString::try_from_optional(cipher.key)?, + version: cipher.version.map(|v| v as u32), + data: cipher.data, }) } } @@ -831,6 +850,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + version: None, } } @@ -895,6 +915,8 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + version: None, + data: None, }; let view: CipherListView = key_store.decrypt(&cipher).unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 45e9d846a..eda38e150 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -5,8 +5,10 @@ use wasm_bindgen::prelude::*; use super::EncryptionContext; use crate::{ - cipher::cipher::DecryptCipherListResult, Cipher, CipherError, CipherListView, CipherView, - DecryptError, EncryptError, Fido2CredentialFullView, + cipher::cipher::{DecryptCipherListResult, CURRENT_CIPHER_VERSION}, + migrations::registry::MigrationRegistry, + Cipher, CipherError, CipherListView, CipherView, DecryptError, EncryptError, + Fido2CredentialFullView, }; #[allow(missing_docs)] @@ -172,6 +174,47 @@ impl CiphersClient { let decrypted_key = cipher_view.decrypt_fido2_private_key(&mut key_store.context())?; Ok(decrypted_key) } + + #[allow(missing_docs)] + pub fn migrate(&self, ciphers: Vec) -> Result, CipherError> { + let registry = MigrationRegistry::new(); + let mut migrated_responses = Vec::new(); + + for mut cipher in ciphers { + let response_version = cipher.version.unwrap_or(1) as u32; + + if response_version < CURRENT_CIPHER_VERSION { + let key_store = self.client.internal.get_key_store(); + let mut ctx = key_store.context(); + let key = cipher.key_identifier(); + + let cipher_key = Cipher::decrypt_cipher_key(&mut ctx, key, &cipher.key) + .map_err(CipherError::CryptoError)?; + + if let Some(data_str) = &mut cipher.data { + let mut data_json: serde_json::Value = serde_json::from_str(data_str) + .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; + + registry.migrate( + &mut data_json, + response_version, + CURRENT_CIPHER_VERSION, + Some(&mut ctx), + Some(cipher_key), + )?; + + *data_str = serde_json::to_string(&data_json) + .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; + } + + cipher.version = Some(CURRENT_CIPHER_VERSION); + } + + migrated_responses.push(cipher); + } + + Ok(migrated_responses) + } } #[cfg(test)] @@ -219,6 +262,8 @@ mod tests { creation_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), + version: None, + data: None, } } @@ -259,6 +304,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + version: None, } } @@ -284,6 +330,37 @@ mod tests { } } + fn test_cipher_v1() -> Cipher { + let mut cipher = test_cipher(); + cipher.version = Some(1); + cipher.data = Some( + serde_json::to_string(&serde_json::json!({ + "Username": "2.PE7g9afvjh9N57ORdUlCDQ==|d8C4kLo0CYAKfa9Gjp4mqg==|YmgGDxGWXtIzW+TJsjDW3CoS0k+U4NZSAwygzq6zV/0=", + "Password": "2.sGpXvg4a6BPFOPN3ePxZaQ==|ChseXEroqhbB11sBk+hH4Q==|SVz2WMGDvZSJwTivSnCFCCfQmmnuiHHPEgw4gzr09pQ=", + "Uris": [], + "Totp": null + })) + .unwrap() + ); + cipher + } + + fn test_cipher_v2() -> Cipher { + let mut cipher = test_cipher(); + cipher.version = Some(CURRENT_CIPHER_VERSION as u32); + cipher.data = Some( + serde_json::to_string(&serde_json::json!({ + "Username": "2.PE7g9afvjh9N57ORdUlCDQ==|d8C4kLo0CYAKfa9Gjp4mqg==|YmgGDxGWXtIzW+TJsjDW3CoS0k+U4NZSAwygzq6zV/0=", + "Password": "2.sGpXvg4a6BPFOPN3ePxZaQ==|ChseXEroqhbB11sBk+hH4Q==|SVz2WMGDvZSJwTivSnCFCCfQmmnuiHHPEgw4gzr09pQ=", + "Uris": [], + "Totp": null, + "SecurityQuestions": [] + })) + .unwrap() + ); + cipher + } + #[tokio::test] async fn test_decrypt_list() { let client = Client::init_test_account(test_bitwarden_com_account()).await; @@ -321,6 +398,8 @@ mod tests { creation_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), + version: None, + data: None, }]) .unwrap(); @@ -533,4 +612,31 @@ mod tests { Some(DecryptError::Crypto(CryptoError::InvalidMac)) )); } + + #[tokio::test] + async fn test_migrate_core_v1_login_adds_security_questions() { + let client = Client::init_test_account(test_bitwarden_com_account()).await; + + let ciphers = vec![test_cipher_v1(), test_cipher_v2()]; + let migrated = client.vault().ciphers().migrate(ciphers).unwrap(); + + assert_eq!(migrated.len(), 2); + + // Test first cipher (v1 should be migrated to v2) + let first_cipher = &migrated[0]; + assert_eq!(first_cipher.version, Some(CURRENT_CIPHER_VERSION)); + if let Some(data_str) = &first_cipher.data { + let data: serde_json::Value = serde_json::from_str(data_str).unwrap(); + assert!(data.get("SecurityQuestions").is_some()); + assert_eq!(data["SecurityQuestions"], serde_json::Value::Array(vec![])); + } + + // Test second cipher (v2 should remain unchanged) + let second_cipher = &migrated[1]; + assert_eq!(second_cipher.version, Some(CURRENT_CIPHER_VERSION)); + if let Some(data_str) = &second_cipher.data { + let data: serde_json::Value = serde_json::from_str(data_str).unwrap(); + assert!(data.get("SecurityQuestions").is_some()); + } + } } diff --git a/crates/bitwarden-vault/src/cipher/migrations/mod.rs b/crates/bitwarden-vault/src/cipher/migrations/mod.rs new file mode 100644 index 000000000..ee72aba02 --- /dev/null +++ b/crates/bitwarden-vault/src/cipher/migrations/mod.rs @@ -0,0 +1,2 @@ +pub mod registry; +pub mod versions; diff --git a/crates/bitwarden-vault/src/cipher/migrations/registry.rs b/crates/bitwarden-vault/src/cipher/migrations/registry.rs new file mode 100644 index 000000000..4bc3e302f --- /dev/null +++ b/crates/bitwarden-vault/src/cipher/migrations/registry.rs @@ -0,0 +1,64 @@ +use bitwarden_core::key_management::{KeyIds, SymmetricKeyId}; +use bitwarden_crypto::KeyStoreContext; + +use crate::{ + migrations::versions::{V1ToV2Migration, V2ToV3Migration}, + CipherError, +}; + +pub trait Migration { + fn from_version(&self) -> u32; + fn to_version(&self) -> u32; + fn migrate( + &self, + cipher_data: &mut serde_json::Value, + ctx: Option<&mut KeyStoreContext>, + cipher_key: Option, + ) -> Result<(), CipherError>; // this can be migration error +} + +pub struct MigrationRegistry { + migrations: Vec>, +} + +impl MigrationRegistry { + pub fn new() -> Self { + let mut registry = Self { + migrations: Vec::new(), + }; + + // something like this + registry.register(Box::new(V1ToV2Migration)); + registry.register(Box::new(V2ToV3Migration)); + + registry + } + + pub fn register(&mut self, migration: Box) { + self.migrations.push(migration); + } + + pub fn migrate( + &self, + cipher_data: &mut serde_json::Value, + from_version: u32, + to_version: u32, + mut ctx: Option<&mut KeyStoreContext>, + cipher_key: Option, + ) -> Result<(), CipherError> { + let mut current_version = from_version; + + while current_version < to_version { + let migration = self + .migrations + .iter() + .find(|m| m.from_version() == current_version) + .ok_or_else(|| CipherError::UnsupportedCipherVersion(current_version))?; + + migration.migrate(cipher_data, ctx.as_deref_mut(), cipher_key.clone())?; + current_version = migration.to_version(); + } + + Ok(()) + } +} diff --git a/crates/bitwarden-vault/src/cipher/migrations/versions/mod.rs b/crates/bitwarden-vault/src/cipher/migrations/versions/mod.rs new file mode 100644 index 000000000..65d722c71 --- /dev/null +++ b/crates/bitwarden-vault/src/cipher/migrations/versions/mod.rs @@ -0,0 +1,5 @@ +pub mod v1_to_v2; +pub mod v2_to_v3; + +pub use v1_to_v2::V1ToV2Migration; +pub use v2_to_v3::V2ToV3Migration; diff --git a/crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs b/crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs new file mode 100644 index 000000000..b4eb0616c --- /dev/null +++ b/crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs @@ -0,0 +1,54 @@ +use bitwarden_core::key_management::{KeyIds, SymmetricKeyId}; +use bitwarden_crypto::KeyStoreContext; + +use crate::migrations::registry::Migration; + +pub struct V1ToV2Migration; + +impl Migration for V1ToV2Migration { + fn from_version(&self) -> u32 { + 1 + } + + fn to_version(&self) -> u32 { + 2 + } + + fn migrate( + &self, + cipher_data: &mut serde_json::Value, + _ctx: Option<&mut KeyStoreContext>, + _cipher_key: Option, + ) -> Result<(), crate::CipherError> { + if let Some(obj) = cipher_data.as_object_mut() { + if !obj.contains_key("SecurityQuestions") { + obj.insert( + "SecurityQuestions".to_string(), + serde_json::Value::Array(vec![]), + ); + } + } + + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_v1_to_v2_adds_security_questions() { + let mut data = serde_json::json!({ + "Username": "2.PE7g9afvjh9N57ORdUlCDQ==|d8C4kLo0CYAKfa9Gjp4mqg==|YmgGDxGWXtIzW+TJsjDW3CoS0k+U4NZSAwygzq6zV/0=", + "Password": "2.sGpXvg4a6BPFOPN3ePxZaQ==|ChseXEroqhbB11sBk+hH4Q==|SVz2WMGDvZSJwTivSnCFCCfQmmnuiHHPEgw4gzr09pQ=", + "Uris": [], + "Totp": null + }); + + V1ToV2Migration.migrate(&mut data, None, None).unwrap(); + + assert!(data.get("SecurityQuestions").is_some()); + assert_eq!(data["SecurityQuestions"], serde_json::json!([])); + } +} diff --git a/crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs b/crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs new file mode 100644 index 000000000..3b76783cd --- /dev/null +++ b/crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs @@ -0,0 +1,118 @@ +use base64::{prelude::BASE64_STANDARD, Engine}; +use bitwarden_core::key_management::{KeyIds, SymmetricKeyId}; +use bitwarden_crypto::{Decryptable, EncString, KeyStoreContext, PrimitiveEncryptable}; + +use crate::{migrations::registry::Migration, CipherError}; + +pub struct V2ToV3Migration; + +impl Migration for V2ToV3Migration { + fn from_version(&self) -> u32 { + 2 + } + + fn to_version(&self) -> u32 { + 3 + } + + fn migrate( + &self, + cipher_data: &mut serde_json::Value, + ctx: Option<&mut KeyStoreContext>, + cipher_key: Option, + ) -> Result<(), CipherError> { + let ctx = + ctx.ok_or_else(|| CipherError::MigrationFailed("Crypto context required".to_string()))?; + + let ciphers_key = cipher_key + .ok_or_else(|| CipherError::MigrationFailed("Cipher key required".to_string()))?; + + if let Some(fido2_credentials) = cipher_data + .get_mut("fido2Credentials") + .and_then(|v| v.as_array_mut()) + { + for fido2_credential in fido2_credentials { + if let Some(credential_id_str) = fido2_credential + .get("credentialId") + .and_then(|v| v.as_str()) + { + let enc_string: EncString = credential_id_str.parse()?; + let dec_credential_id: String = enc_string.decrypt(ctx, ciphers_key)?; + let b64_credential_id = BASE64_STANDARD.encode(&dec_credential_id); + let enc_credential_id: EncString = + b64_credential_id.encrypt(ctx, ciphers_key)?; + + if let Some(obj) = fido2_credential.as_object_mut() { + obj.insert( + "credentialId".to_string(), + serde_json::Value::String(enc_credential_id.to_string()), + ); + obj.insert( + "credentialIdType".to_string(), + serde_json::Value::String("base64".to_owned()), + ); + } + } + } + } + + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use bitwarden_core::key_management::create_test_crypto_with_user_key; + use bitwarden_crypto::SymmetricCryptoKey; + + use super::*; + + #[test] + fn test_v2_to_v3_migration_fido2_credentials() { + let key_store = + create_test_crypto_with_user_key(SymmetricCryptoKey::make_aes256_cbc_hmac_key()); + let mut ctx = key_store.context(); + + let cipher_key = ctx + .generate_symmetric_key(SymmetricKeyId::Local("test_cipher_key")) + .unwrap(); + + let original_credential_id = "test-credential-id-123"; + let encrypted_credential_id: EncString = original_credential_id + .encrypt(&mut ctx, cipher_key) + .unwrap(); + + let mut data = serde_json::json!({ + "fido2Credentials": [ + { + "credentialId": encrypted_credential_id.to_string(), + "keyType": "public-key", + "rpId": "example.com" + } + ] + }); + + V2ToV3Migration + .migrate(&mut data, Some(&mut ctx), Some(cipher_key)) + .unwrap(); + + println!("Data {:#?}", data["fido2Credentials"]); + + let fido2_creds = data["fido2Credentials"].as_array().unwrap(); + let credential = &fido2_creds[0]; + + assert_eq!(credential["credentialIdType"], "base64"); + + let new_credential_id_str = credential["credentialId"].as_str().unwrap(); + let new_enc_string: EncString = new_credential_id_str.parse().unwrap(); + let decrypted_new_id: String = new_enc_string.decrypt(&mut ctx, cipher_key).unwrap(); + + let expected_base64 = BASE64_STANDARD.encode(original_credential_id); + // The decrypted value should match the expected base64 encoding + assert_eq!(decrypted_new_id, expected_base64); + + // Verifiy other fields remain untouched + assert_eq!(credential["keyType"], "public-key"); + assert_eq!(credential["rpId"], "example.com"); + } +} From 83f119bbaf4f4766869820ea2094cb229d07fa05 Mon Sep 17 00:00:00 2001 From: gbubemismith Date: Thu, 14 Aug 2025 08:43:57 -0400 Subject: [PATCH 03/17] Updated structures to fit changes --- crates/bitwarden-exporters/src/lib.rs | 1 + crates/bitwarden-exporters/src/models.rs | 2 ++ crates/bitwarden-vault/src/cipher/attachment.rs | 6 ++++++ crates/bitwarden-vault/src/cipher/mod.rs | 1 + crates/bitwarden-vault/src/cipher/secure_note.rs | 2 ++ 5 files changed, 12 insertions(+) diff --git a/crates/bitwarden-exporters/src/lib.rs b/crates/bitwarden-exporters/src/lib.rs index 4466460d8..07cd908d8 100644 --- a/crates/bitwarden-exporters/src/lib.rs +++ b/crates/bitwarden-exporters/src/lib.rs @@ -147,6 +147,7 @@ impl From for CipherView { creation_date: value.creation_date, deleted_date: None, revision_date: value.revision_date, + version: None, } } } diff --git a/crates/bitwarden-exporters/src/models.rs b/crates/bitwarden-exporters/src/models.rs index 97e19c059..f7fe4842f 100644 --- a/crates/bitwarden-exporters/src/models.rs +++ b/crates/bitwarden-exporters/src/models.rs @@ -261,6 +261,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + version: None, }; let login = from_login(&view, &key_store).unwrap(); @@ -312,6 +313,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + version: None, }; let encrypted = key_store.encrypt(cipher_view).unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index 2bfa4edb7..dd7a0efe1 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -286,6 +286,8 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + version: None, + data: None, }, attachment, contents: contents.as_slice(), @@ -340,6 +342,8 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + version: None, + data: None, }; let enc_file = STANDARD.decode(b"Ao00qr1xLsV+ZNQpYZ/UwEwOWo3hheKwCYcOGIbsorZ6JIG2vLWfWEXCVqP0hDuzRvmx8otApNZr8pJYLNwCe1aQ+ySHQYGkdubFjoMojulMbQ959Y4SJ6Its/EnVvpbDnxpXTDpbutDxyhxfq1P3lstL2G9rObJRrxiwdGlRGu1h94UA1fCCkIUQux5LcqUee6W4MyQmRnsUziH8gGzmtI=").unwrap(); @@ -398,6 +402,8 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + version: None, + data: None, }; let enc_file = STANDARD.decode(b"AsQLXOBHrJ8porroTUlPxeJOm9XID7LL9D2+KwYATXEpR1EFjLBpcCvMmnqcnYLXIEefe9TCeY4Us50ux43kRSpvdB7YkjxDKV0O1/y6tB7qC4vvv9J9+O/uDEnMx/9yXuEhAW/LA/TsU/WAgxkOM0uTvm8JdD9LUR1z9Ql7zOWycMVzkvGsk2KBNcqAdrotS5FlDftZOXyU8pWecNeyA/w=").unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/mod.rs b/crates/bitwarden-vault/src/cipher/mod.rs index ee36cc1b7..eb8c04469 100644 --- a/crates/bitwarden-vault/src/cipher/mod.rs +++ b/crates/bitwarden-vault/src/cipher/mod.rs @@ -10,6 +10,7 @@ pub(crate) mod identity; pub(crate) mod linked_id; pub(crate) mod local_data; pub(crate) mod login; +pub(crate) mod migrations; pub(crate) mod secure_note; pub(crate) mod ssh_key; diff --git a/crates/bitwarden-vault/src/cipher/secure_note.rs b/crates/bitwarden-vault/src/cipher/secure_note.rs index 821bded5c..3d034ac25 100644 --- a/crates/bitwarden-vault/src/cipher/secure_note.rs +++ b/crates/bitwarden-vault/src/cipher/secure_note.rs @@ -139,6 +139,8 @@ mod tests { creation_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), + version: None, + data: None, } } From ee2a35db4ddbaf033df3b103b062984fbf47d73a Mon Sep 17 00:00:00 2001 From: gbubemismith Date: Thu, 14 Aug 2025 09:09:39 -0400 Subject: [PATCH 04/17] Fixed lint issues --- .../src/cipher/cipher_client.rs | 4 ++-- .../src/cipher/migrations/registry.rs | 20 +++++++++---------- .../cipher/migrations/versions/v1_to_v2.rs | 4 ++-- .../cipher/migrations/versions/v2_to_v3.rs | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index eda38e150..78411f0d7 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -181,7 +181,7 @@ impl CiphersClient { let mut migrated_responses = Vec::new(); for mut cipher in ciphers { - let response_version = cipher.version.unwrap_or(1) as u32; + let response_version = cipher.version.unwrap_or(1); if response_version < CURRENT_CIPHER_VERSION { let key_store = self.client.internal.get_key_store(); @@ -347,7 +347,7 @@ mod tests { fn test_cipher_v2() -> Cipher { let mut cipher = test_cipher(); - cipher.version = Some(CURRENT_CIPHER_VERSION as u32); + cipher.version = Some(CURRENT_CIPHER_VERSION); cipher.data = Some( serde_json::to_string(&serde_json::json!({ "Username": "2.PE7g9afvjh9N57ORdUlCDQ==|d8C4kLo0CYAKfa9Gjp4mqg==|YmgGDxGWXtIzW+TJsjDW3CoS0k+U4NZSAwygzq6zV/0=", diff --git a/crates/bitwarden-vault/src/cipher/migrations/registry.rs b/crates/bitwarden-vault/src/cipher/migrations/registry.rs index 4bc3e302f..8834ce5fb 100644 --- a/crates/bitwarden-vault/src/cipher/migrations/registry.rs +++ b/crates/bitwarden-vault/src/cipher/migrations/registry.rs @@ -7,8 +7,8 @@ use crate::{ }; pub trait Migration { - fn from_version(&self) -> u32; - fn to_version(&self) -> u32; + fn source_version(&self) -> u32; + fn target_version(&self) -> u32; fn migrate( &self, cipher_data: &mut serde_json::Value, @@ -41,22 +41,22 @@ impl MigrationRegistry { pub fn migrate( &self, cipher_data: &mut serde_json::Value, - from_version: u32, - to_version: u32, + source_version: u32, + target_version: u32, mut ctx: Option<&mut KeyStoreContext>, cipher_key: Option, ) -> Result<(), CipherError> { - let mut current_version = from_version; + let mut current_version = source_version; - while current_version < to_version { + while current_version < target_version { let migration = self .migrations .iter() - .find(|m| m.from_version() == current_version) - .ok_or_else(|| CipherError::UnsupportedCipherVersion(current_version))?; + .find(|m| m.source_version() == current_version) + .ok_or(CipherError::UnsupportedCipherVersion(current_version))?; - migration.migrate(cipher_data, ctx.as_deref_mut(), cipher_key.clone())?; - current_version = migration.to_version(); + migration.migrate(cipher_data, ctx.as_deref_mut(), cipher_key)?; + current_version = migration.target_version(); } Ok(()) diff --git a/crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs b/crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs index b4eb0616c..01e21133e 100644 --- a/crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs +++ b/crates/bitwarden-vault/src/cipher/migrations/versions/v1_to_v2.rs @@ -6,11 +6,11 @@ use crate::migrations::registry::Migration; pub struct V1ToV2Migration; impl Migration for V1ToV2Migration { - fn from_version(&self) -> u32 { + fn source_version(&self) -> u32 { 1 } - fn to_version(&self) -> u32 { + fn target_version(&self) -> u32 { 2 } diff --git a/crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs b/crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs index 3b76783cd..92b3efb99 100644 --- a/crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs +++ b/crates/bitwarden-vault/src/cipher/migrations/versions/v2_to_v3.rs @@ -7,11 +7,11 @@ use crate::{migrations::registry::Migration, CipherError}; pub struct V2ToV3Migration; impl Migration for V2ToV3Migration { - fn from_version(&self) -> u32 { + fn source_version(&self) -> u32 { 2 } - fn to_version(&self) -> u32 { + fn target_version(&self) -> u32 { 3 } From 31278887ee07a50360ccae7cce8a67823b6ed5e8 Mon Sep 17 00:00:00 2001 From: gbubemismith Date: Tue, 9 Sep 2025 17:25:07 -0400 Subject: [PATCH 05/17] Pushing only to test and experiment with --- .../.openapi-generator/FILES | 4 +- crates/bitwarden-api-api/Cargo.toml | 4 +- crates/bitwarden-api-api/README.md | 12 +- .../src/apis/access_policies_api.rs | 12 + .../src/apis/account_billing_v_next_api.rs | 4 + .../src/apis/accounts_api.rs | 43 ++ .../src/apis/accounts_billing_api.rs | 5 + .../src/apis/accounts_key_management_api.rs | 4 + .../src/apis/auth_requests_api.rs | 7 + .../bitwarden-api-api/src/apis/ciphers_api.rs | 59 +++ .../src/apis/collections_api.rs | 32 +- .../bitwarden-api-api/src/apis/config_api.rs | 1 + .../src/apis/configuration.rs | 2 +- .../bitwarden-api-api/src/apis/counts_api.rs | 3 + .../bitwarden-api-api/src/apis/devices_api.rs | 22 + .../src/apis/emergency_access_api.rs | 19 + .../bitwarden-api-api/src/apis/events_api.rs | 166 ++++++++ .../bitwarden-api-api/src/apis/folders_api.rs | 8 + .../bitwarden-api-api/src/apis/groups_api.rs | 14 + crates/bitwarden-api-api/src/apis/hibp_api.rs | 1 + .../src/apis/import_ciphers_api.rs | 2 + crates/bitwarden-api-api/src/apis/info_api.rs | 3 + .../src/apis/installations_api.rs | 2 + .../src/apis/invoices_api.rs | 1 + .../src/apis/licenses_api.rs | 2 + crates/bitwarden-api-api/src/apis/misc_api.rs | 2 + .../src/apis/notifications_api.rs | 3 + .../apis/organization_auth_requests_api.rs | 4 + .../src/apis/organization_billing_api.rs | 60 +-- .../apis/organization_billing_v_next_api.rs | 390 ++++++++++++++++++ .../src/apis/organization_connections_api.rs | 6 + .../src/apis/organization_domain_api.rs | 8 + .../src/apis/organization_export_api.rs | 1 + .../src/apis/organization_integration_api.rs | 5 + ...anization_integration_configuration_api.rs | 6 +- .../src/apis/organization_sponsorships_api.rs | 12 + .../src/apis/organization_users_api.rs | 35 ++ .../src/apis/organizations_api.rs | 34 ++ .../src/apis/phishing_domains_api.rs | 2 + .../bitwarden-api-api/src/apis/plans_api.rs | 1 + .../src/apis/policies_api.rs | 6 + .../src/apis/projects_api.rs | 5 + .../src/apis/provider_billing_api.rs | 7 + .../src/apis/provider_billing_v_next_api.rs | 155 +++++++ .../src/apis/provider_clients_api.rs | 4 + .../src/apis/provider_organizations_api.rs | 5 + .../src/apis/provider_users_api.rs | 15 + .../src/apis/providers_api.rs | 7 + crates/bitwarden-api-api/src/apis/push_api.rs | 5 + .../bitwarden-api-api/src/apis/reports_api.rs | 13 + .../src/apis/request_sm_access_api.rs | 1 + .../bitwarden-api-api/src/apis/secrets_api.rs | 8 + .../src/apis/secrets_manager_events_api.rs | 1 + .../src/apis/secrets_manager_porting_api.rs | 2 + .../src/apis/security_task_api.rs | 63 +++ .../self_hosted_organization_licenses_api.rs | 3 + ...lf_hosted_organization_sponsorships_api.rs | 5 + .../bitwarden-api-api/src/apis/sends_api.rs | 12 + .../src/apis/service_accounts_api.rs | 8 + .../src/apis/settings_api.rs | 3 + .../src/apis/slack_integration_api.rs | 2 + .../bitwarden-api-api/src/apis/stripe_api.rs | 3 + crates/bitwarden-api-api/src/apis/sync_api.rs | 1 + crates/bitwarden-api-api/src/apis/tax_api.rs | 1 + .../bitwarden-api-api/src/apis/trash_api.rs | 3 + .../src/apis/two_factor_api.rs | 32 ++ .../bitwarden-api-api/src/apis/users_api.rs | 1 + .../src/apis/web_authn_api.rs | 6 + crates/bitwarden-api-api/src/models/cipher.rs | 3 - .../models/cipher_details_response_model.rs | 3 - .../cipher_mini_details_response_model.rs | 3 - .../src/models/cipher_mini_response_model.rs | 3 - .../src/models/cipher_request_model.rs | 11 +- .../src/models/cipher_response_model.rs | 3 - .../models/cipher_with_id_request_model.rs | 11 +- ....rs => create_collection_request_model.rs} | 8 +- .../src/models/event_response_model.rs | 3 + .../src/models/event_type.rs | 12 + crates/bitwarden-api-api/src/models/mod.rs | 8 +- ...ization_user_bulk_confirm_request_model.rs | 10 +- .../security_task_metrics_response_model.rs | 32 ++ .../models/update_collection_request_model.rs | 36 ++ crates/bitwarden-api-identity/Cargo.toml | 4 +- crates/bitwarden-api-identity/README.md | 2 +- .../src/apis/accounts_api.rs | 6 + .../src/apis/configuration.rs | 2 +- .../src/apis/info_api.rs | 3 + .../src/apis/sso_api.rs | 4 + crates/bitwarden-exporters/src/lib.rs | 2 +- crates/bitwarden-exporters/src/models.rs | 4 +- .../bitwarden-vault/src/cipher/attachment.rs | 6 +- crates/bitwarden-vault/src/cipher/cipher.rs | 15 +- .../src/cipher/cipher_client.rs | 59 +-- .../bitwarden-vault/src/cipher/secure_note.rs | 2 +- 94 files changed, 1487 insertions(+), 146 deletions(-) rename crates/bitwarden-api-api/src/models/{collection_request_model.rs => create_collection_request_model.rs} (83%) create mode 100644 crates/bitwarden-api-api/src/models/security_task_metrics_response_model.rs create mode 100644 crates/bitwarden-api-api/src/models/update_collection_request_model.rs diff --git a/crates/bitwarden-api-api/.openapi-generator/FILES b/crates/bitwarden-api-api/.openapi-generator/FILES index d477e416e..dc5a11e96 100644 --- a/crates/bitwarden-api-api/.openapi-generator/FILES +++ b/crates/bitwarden-api-api/.openapi-generator/FILES @@ -156,13 +156,13 @@ src/models/collection_access_details_response_model_list_response_model.rs src/models/collection_bulk_delete_request_model.rs src/models/collection_details_response_model.rs src/models/collection_details_response_model_list_response_model.rs -src/models/collection_request_model.rs src/models/collection_response_model.rs src/models/collection_response_model_list_response_model.rs src/models/collection_type.rs src/models/collection_with_id_request_model.rs src/models/config_response_model.rs src/models/create_client_organization_request_body.rs +src/models/create_collection_request_model.rs src/models/credential_create_options.rs src/models/delete_attachment_response_data.rs src/models/delete_recover_request_model.rs @@ -434,6 +434,7 @@ src/models/secrets_sync_response_model.rs src/models/secrets_with_projects_inner_secret.rs src/models/secure_note_type.rs src/models/security_task_create_request.rs +src/models/security_task_metrics_response_model.rs src/models/security_task_status.rs src/models/security_task_type.rs src/models/security_tasks_response_model.rs @@ -505,6 +506,7 @@ src/models/unlock_data_request_model.rs src/models/untrust_devices_request_model.rs src/models/update_avatar_request_model.rs src/models/update_client_organization_request_body.rs +src/models/update_collection_request_model.rs src/models/update_devices_trust_request_model.rs src/models/update_domains_request_model.rs src/models/update_payment_method_request_body.rs diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index a7a03456d..b4a55b22c 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -12,10 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" serde_repr = "^0.1" -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } diff --git a/crates/bitwarden-api-api/README.md b/crates/bitwarden-api-api/README.md index f79a76f09..1e8982eb8 100644 --- a/crates/bitwarden-api-api/README.md +++ b/crates/bitwarden-api-api/README.md @@ -25,7 +25,7 @@ bitwarden-api-api = { path = "./bitwarden-api-api" } ## Documentation for API Endpoints -All URIs are relative to _http://localhost_ +All URIs are relative to *https://api.bitwarden.com* | Class | Method | HTTP request | Description | | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -224,6 +224,8 @@ All URIs are relative to _http://localhost_ | _EmergencyAccessApi_ | [**emergency_access_trusted_get**](docs/EmergencyAccessApi.md#emergency_access_trusted_get) | **GET** /emergency-access/trusted | | _EventsApi_ | [**ciphers_id_events_get**](docs/EventsApi.md#ciphers_id_events_get) | **GET** /ciphers/{id}/events | | _EventsApi_ | [**events_get**](docs/EventsApi.md#events_get) | **GET** /events | +| _EventsApi_ | [**organization_org_id_projects_id_events_get**](docs/EventsApi.md#organization_org_id_projects_id_events_get) | **GET** /organization/{orgId}/projects/{id}/events | +| _EventsApi_ | [**organization_org_id_secrets_id_events_get**](docs/EventsApi.md#organization_org_id_secrets_id_events_get) | **GET** /organization/{orgId}/secrets/{id}/events | | _EventsApi_ | [**organizations_id_events_get**](docs/EventsApi.md#organizations_id_events_get) | **GET** /organizations/{id}/events | | _EventsApi_ | [**organizations_org_id_users_id_events_get**](docs/EventsApi.md#organizations_org_id_users_id_events_get) | **GET** /organizations/{orgId}/users/{id}/events | | _EventsApi_ | [**providers_provider_id_events_get**](docs/EventsApi.md#providers_provider_id_events_get) | **GET** /providers/{providerId}/events | @@ -283,7 +285,6 @@ All URIs are relative to _http://localhost_ | _OrganizationBillingApi_ | [**organizations_organization_id_billing_tax_information_get**](docs/OrganizationBillingApi.md#organizations_organization_id_billing_tax_information_get) | **GET** /organizations/{organizationId}/billing/tax-information | | _OrganizationBillingApi_ | [**organizations_organization_id_billing_tax_information_put**](docs/OrganizationBillingApi.md#organizations_organization_id_billing_tax_information_put) | **PUT** /organizations/{organizationId}/billing/tax-information | | _OrganizationBillingApi_ | [**organizations_organization_id_billing_transactions_get**](docs/OrganizationBillingApi.md#organizations_organization_id_billing_transactions_get) | **GET** /organizations/{organizationId}/billing/transactions | -| _OrganizationBillingApi_ | [**organizations_organization_id_billing_warnings_get**](docs/OrganizationBillingApi.md#organizations_organization_id_billing_warnings_get) | **GET** /organizations/{organizationId}/billing/warnings | | _OrganizationBillingVNextApi_ | [**organizations_organization_id_billing_vnext_address_get**](docs/OrganizationBillingVNextApi.md#organizations_organization_id_billing_vnext_address_get) | **GET** /organizations/{organizationId}/billing/vnext/address | | _OrganizationBillingVNextApi_ | [**organizations_organization_id_billing_vnext_address_put**](docs/OrganizationBillingVNextApi.md#organizations_organization_id_billing_vnext_address_put) | **PUT** /organizations/{organizationId}/billing/vnext/address | | _OrganizationBillingVNextApi_ | [**organizations_organization_id_billing_vnext_credit_bitpay_post**](docs/OrganizationBillingVNextApi.md#organizations_organization_id_billing_vnext_credit_bitpay_post) | **POST** /organizations/{organizationId}/billing/vnext/credit/bitpay | @@ -291,6 +292,7 @@ All URIs are relative to _http://localhost_ | _OrganizationBillingVNextApi_ | [**organizations_organization_id_billing_vnext_payment_method_get**](docs/OrganizationBillingVNextApi.md#organizations_organization_id_billing_vnext_payment_method_get) | **GET** /organizations/{organizationId}/billing/vnext/payment-method | | _OrganizationBillingVNextApi_ | [**organizations_organization_id_billing_vnext_payment_method_put**](docs/OrganizationBillingVNextApi.md#organizations_organization_id_billing_vnext_payment_method_put) | **PUT** /organizations/{organizationId}/billing/vnext/payment-method | | _OrganizationBillingVNextApi_ | [**organizations_organization_id_billing_vnext_payment_method_verify_bank_account_post**](docs/OrganizationBillingVNextApi.md#organizations_organization_id_billing_vnext_payment_method_verify_bank_account_post) | **POST** /organizations/{organizationId}/billing/vnext/payment-method/verify-bank-account | +| _OrganizationBillingVNextApi_ | [**organizations_organization_id_billing_vnext_warnings_get**](docs/OrganizationBillingVNextApi.md#organizations_organization_id_billing_vnext_warnings_get) | **GET** /organizations/{organizationId}/billing/vnext/warnings | | _OrganizationConnectionsApi_ | [**organizations_connections_enabled_get**](docs/OrganizationConnectionsApi.md#organizations_connections_enabled_get) | **GET** /organizations/connections/enabled | | _OrganizationConnectionsApi_ | [**organizations_connections_organization_connection_id_delete**](docs/OrganizationConnectionsApi.md#organizations_connections_organization_connection_id_delete) | **DELETE** /organizations/connections/{organizationConnectionId} | | _OrganizationConnectionsApi_ | [**organizations_connections_organization_connection_id_delete_post**](docs/OrganizationConnectionsApi.md#organizations_connections_organization_connection_id_delete_post) | **POST** /organizations/connections/{organizationConnectionId}/delete | @@ -425,6 +427,7 @@ All URIs are relative to _http://localhost_ | _ProviderBillingVNextApi_ | [**providers_provider_id_billing_vnext_payment_method_get**](docs/ProviderBillingVNextApi.md#providers_provider_id_billing_vnext_payment_method_get) | **GET** /providers/{providerId}/billing/vnext/payment-method | | _ProviderBillingVNextApi_ | [**providers_provider_id_billing_vnext_payment_method_put**](docs/ProviderBillingVNextApi.md#providers_provider_id_billing_vnext_payment_method_put) | **PUT** /providers/{providerId}/billing/vnext/payment-method | | _ProviderBillingVNextApi_ | [**providers_provider_id_billing_vnext_payment_method_verify_bank_account_post**](docs/ProviderBillingVNextApi.md#providers_provider_id_billing_vnext_payment_method_verify_bank_account_post) | **POST** /providers/{providerId}/billing/vnext/payment-method/verify-bank-account | +| _ProviderBillingVNextApi_ | [**providers_provider_id_billing_vnext_warnings_get**](docs/ProviderBillingVNextApi.md#providers_provider_id_billing_vnext_warnings_get) | **GET** /providers/{providerId}/billing/vnext/warnings | | _ProviderClientsApi_ | [**providers_provider_id_clients_addable_get**](docs/ProviderClientsApi.md#providers_provider_id_clients_addable_get) | **GET** /providers/{providerId}/clients/addable | | _ProviderClientsApi_ | [**providers_provider_id_clients_existing_post**](docs/ProviderClientsApi.md#providers_provider_id_clients_existing_post) | **POST** /providers/{providerId}/clients/existing | | _ProviderClientsApi_ | [**providers_provider_id_clients_post**](docs/ProviderClientsApi.md#providers_provider_id_clients_post) | **POST** /providers/{providerId}/clients | @@ -489,6 +492,7 @@ All URIs are relative to _http://localhost_ | _SecurityTaskApi_ | [**tasks_get**](docs/SecurityTaskApi.md#tasks_get) | **GET** /tasks | Retrieves security tasks for the current user. | | _SecurityTaskApi_ | [**tasks_org_id_bulk_create_post**](docs/SecurityTaskApi.md#tasks_org_id_bulk_create_post) | **POST** /tasks/{orgId}/bulk-create | Bulk create security tasks for an organization. | | _SecurityTaskApi_ | [**tasks_organization_get**](docs/SecurityTaskApi.md#tasks_organization_get) | **GET** /tasks/organization | Retrieves security tasks for an organization. Restricted to organization administrators. | +| _SecurityTaskApi_ | [**tasks_organization_id_metrics_get**](docs/SecurityTaskApi.md#tasks_organization_id_metrics_get) | **GET** /tasks/{organizationId}/metrics | Retrieves security task metrics for an organization. | | _SecurityTaskApi_ | [**tasks_task_id_complete_patch**](docs/SecurityTaskApi.md#tasks_task_id_complete_patch) | **PATCH** /tasks/{taskId}/complete | Marks a task as complete. The user must have edit permission on the cipher associated with the task. | | _SelfHostedOrganizationLicensesApi_ | [**organizations_licenses_self_hosted_id_post**](docs/SelfHostedOrganizationLicensesApi.md#organizations_licenses_self_hosted_id_post) | **POST** /organizations/licenses/self-hosted/{id} | | _SelfHostedOrganizationLicensesApi_ | [**organizations_licenses_self_hosted_id_sync_post**](docs/SelfHostedOrganizationLicensesApi.md#organizations_licenses_self_hosted_id_sync_post) | **POST** /organizations/licenses/self-hosted/{id}/sync | @@ -661,13 +665,13 @@ All URIs are relative to _http://localhost_ - [CollectionBulkDeleteRequestModel](docs/CollectionBulkDeleteRequestModel.md) - [CollectionDetailsResponseModel](docs/CollectionDetailsResponseModel.md) - [CollectionDetailsResponseModelListResponseModel](docs/CollectionDetailsResponseModelListResponseModel.md) -- [CollectionRequestModel](docs/CollectionRequestModel.md) - [CollectionResponseModel](docs/CollectionResponseModel.md) - [CollectionResponseModelListResponseModel](docs/CollectionResponseModelListResponseModel.md) - [CollectionType](docs/CollectionType.md) - [CollectionWithIdRequestModel](docs/CollectionWithIdRequestModel.md) - [ConfigResponseModel](docs/ConfigResponseModel.md) - [CreateClientOrganizationRequestBody](docs/CreateClientOrganizationRequestBody.md) +- [CreateCollectionRequestModel](docs/CreateCollectionRequestModel.md) - [CredentialCreateOptions](docs/CredentialCreateOptions.md) - [DeleteAttachmentResponseData](docs/DeleteAttachmentResponseData.md) - [DeleteRecoverRequestModel](docs/DeleteRecoverRequestModel.md) @@ -938,6 +942,7 @@ All URIs are relative to _http://localhost_ - [SecretsWithProjectsInnerSecret](docs/SecretsWithProjectsInnerSecret.md) - [SecureNoteType](docs/SecureNoteType.md) - [SecurityTaskCreateRequest](docs/SecurityTaskCreateRequest.md) +- [SecurityTaskMetricsResponseModel](docs/SecurityTaskMetricsResponseModel.md) - [SecurityTaskStatus](docs/SecurityTaskStatus.md) - [SecurityTaskType](docs/SecurityTaskType.md) - [SecurityTasksResponseModel](docs/SecurityTasksResponseModel.md) @@ -1009,6 +1014,7 @@ All URIs are relative to _http://localhost_ - [UntrustDevicesRequestModel](docs/UntrustDevicesRequestModel.md) - [UpdateAvatarRequestModel](docs/UpdateAvatarRequestModel.md) - [UpdateClientOrganizationRequestBody](docs/UpdateClientOrganizationRequestBody.md) +- [UpdateCollectionRequestModel](docs/UpdateCollectionRequestModel.md) - [UpdateDevicesTrustRequestModel](docs/UpdateDevicesTrustRequestModel.md) - [UpdateDomainsRequestModel](docs/UpdateDomainsRequestModel.md) - [UpdatePaymentMethodRequestBody](docs/UpdatePaymentMethodRequestBody.md) 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 19a58c7e0..24b5510c6 100644 --- a/crates/bitwarden-api-api/src/apis/access_policies_api.rs +++ b/crates/bitwarden-api-api/src/apis/access_policies_api.rs @@ -101,6 +101,7 @@ pub enum ServiceAccountsIdGrantedPoliciesPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L69`] pub async fn organizations_id_access_policies_people_potential_grantees_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -155,6 +156,7 @@ pub async fn organizations_id_access_policies_people_potential_grantees_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L107`] pub async fn organizations_id_access_policies_projects_potential_grantees_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -209,6 +211,7 @@ pub async fn organizations_id_access_policies_projects_potential_grantees_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L86`] pub async fn organizations_id_access_policies_service_accounts_potential_grantees_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -263,6 +266,7 @@ pub async fn organizations_id_access_policies_service_accounts_potential_grantee } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L127`] pub async fn projects_id_access_policies_people_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -317,6 +321,7 @@ pub async fn projects_id_access_policies_people_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L137`] pub async fn projects_id_access_policies_people_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -374,6 +379,7 @@ pub async fn projects_id_access_policies_people_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L234`] pub async fn projects_id_access_policies_service_accounts_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -428,6 +434,7 @@ pub async fn projects_id_access_policies_service_accounts_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L246`] pub async fn projects_id_access_policies_service_accounts_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -488,6 +495,7 @@ pub async fn projects_id_access_policies_service_accounts_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L267`] pub async fn secrets_secret_id_access_policies_get( configuration: &configuration::Configuration, secret_id: uuid::Uuid, @@ -540,6 +548,7 @@ pub async fn secrets_secret_id_access_policies_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L161`] pub async fn service_accounts_id_access_policies_people_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -594,6 +603,7 @@ pub async fn service_accounts_id_access_policies_people_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L172`] pub async fn service_accounts_id_access_policies_people_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -651,6 +661,7 @@ pub async fn service_accounts_id_access_policies_people_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L196`] pub async fn service_accounts_id_granted_policies_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -705,6 +716,7 @@ pub async fn service_accounts_id_granted_policies_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/AccessPoliciesController.cs#L214`] pub async fn service_accounts_id_granted_policies_put( configuration: &configuration::Configuration, id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/account_billing_v_next_api.rs b/crates/bitwarden-api-api/src/apis/account_billing_v_next_api.rs index 6e6cdee82..1eef8268d 100644 --- a/crates/bitwarden-api-api/src/apis/account_billing_v_next_api.rs +++ b/crates/bitwarden-api-api/src/apis/account_billing_v_next_api.rs @@ -42,6 +42,7 @@ pub enum AccountBillingVnextPaymentMethodPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs#L37`] pub async fn account_billing_vnext_credit_bitpay_post( configuration: &configuration::Configuration, email: &str, @@ -294,6 +295,7 @@ pub async fn account_billing_vnext_credit_bitpay_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs#L27`] pub async fn account_billing_vnext_credit_get( configuration: &configuration::Configuration, email: &str, @@ -537,6 +539,7 @@ pub async fn account_billing_vnext_credit_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs#L49`] pub async fn account_billing_vnext_payment_method_get( configuration: &configuration::Configuration, email: &str, @@ -784,6 +787,7 @@ pub async fn account_billing_vnext_payment_method_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs#L59`] pub async fn account_billing_vnext_payment_method_put( configuration: &configuration::Configuration, email: &str, diff --git a/crates/bitwarden-api-api/src/apis/accounts_api.rs b/crates/bitwarden-api-api/src/apis/accounts_api.rs index a27033a2a..ee38539cc 100644 --- a/crates/bitwarden-api-api/src/apis/accounts_api.rs +++ b/crates/bitwarden-api-api/src/apis/accounts_api.rs @@ -315,6 +315,7 @@ pub enum AccountsVerifyPasswordPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L525`] pub async fn accounts_api_key_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -364,6 +365,7 @@ pub async fn accounts_api_key_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L369`] pub async fn accounts_avatar_post( configuration: &configuration::Configuration, update_avatar_request_model: Option, @@ -413,6 +415,7 @@ pub async fn accounts_avatar_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L369`] pub async fn accounts_avatar_put( configuration: &configuration::Configuration, update_avatar_request_model: Option, @@ -460,6 +463,7 @@ pub async fn accounts_avatar_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L162`] pub async fn accounts_cancel_post( configuration: &configuration::Configuration, subscription_cancellation_request_model: Option, @@ -498,6 +502,7 @@ pub async fn accounts_cancel_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L435`] pub async fn accounts_delete( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -536,6 +541,7 @@ pub async fn accounts_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L435`] pub async fn accounts_delete_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -574,6 +580,7 @@ pub async fn accounts_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L473`] pub async fn accounts_delete_recover_post( configuration: &configuration::Configuration, delete_recover_request_model: Option, @@ -612,6 +619,7 @@ pub async fn accounts_delete_recover_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L480`] pub async fn accounts_delete_recover_token_post( configuration: &configuration::Configuration, verify_delete_recover_request_model: Option, @@ -651,6 +659,7 @@ pub async fn accounts_delete_recover_token_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L110`] pub async fn accounts_email_post( configuration: &configuration::Configuration, email_request_model: Option, @@ -689,6 +698,7 @@ pub async fn accounts_email_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L80`] pub async fn accounts_email_token_post( configuration: &configuration::Configuration, email_token_request_model: Option, @@ -727,6 +737,7 @@ pub async fn accounts_email_token_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L260`] pub async fn accounts_kdf_post( configuration: &configuration::Configuration, kdf_request_model: Option, @@ -765,6 +776,7 @@ pub async fn accounts_kdf_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L422`] pub async fn accounts_keys_get( configuration: &configuration::Configuration, ) -> Result> { @@ -807,6 +819,7 @@ pub async fn accounts_keys_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L401`] pub async fn accounts_keys_post( configuration: &configuration::Configuration, keys_request_model: Option, @@ -856,6 +869,7 @@ pub async fn accounts_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L142`] pub async fn accounts_license_post( configuration: &configuration::Configuration, license: std::path::PathBuf, @@ -896,6 +910,7 @@ pub async fn accounts_license_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L336`] pub async fn accounts_organizations_get( configuration: &configuration::Configuration, ) -> Result< @@ -941,6 +956,7 @@ pub async fn accounts_organizations_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L74`] pub async fn accounts_password_hint_post( configuration: &configuration::Configuration, password_hint_request_model: Option, @@ -979,6 +995,7 @@ pub async fn accounts_password_hint_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L176`] pub async fn accounts_password_post( configuration: &configuration::Configuration, password_request_model: Option, @@ -1017,6 +1034,7 @@ pub async fn accounts_password_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L103`] pub async fn accounts_payment_post( configuration: &configuration::Configuration, payment_request_model: Option, @@ -1055,6 +1073,7 @@ pub async fn accounts_payment_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L30`] pub async fn accounts_premium_post( configuration: &configuration::Configuration, payment_method_type: models::PaymentMethodType, @@ -1129,6 +1148,7 @@ pub async fn accounts_premium_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L309`] pub async fn accounts_profile_get( configuration: &configuration::Configuration, ) -> Result> { @@ -1171,6 +1191,7 @@ pub async fn accounts_profile_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L349`] pub async fn accounts_profile_post( configuration: &configuration::Configuration, update_profile_request_model: Option, @@ -1220,6 +1241,7 @@ pub async fn accounts_profile_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L349`] pub async fn accounts_profile_put( configuration: &configuration::Configuration, update_profile_request_model: Option, @@ -1267,6 +1289,7 @@ pub async fn accounts_profile_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L178`] pub async fn accounts_reinstate_premium_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -1300,6 +1323,7 @@ pub async fn accounts_reinstate_premium_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L609`] pub async fn accounts_request_otp_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -1333,6 +1357,7 @@ pub async fn accounts_request_otp_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L630`] pub async fn accounts_resend_new_device_otp_post( configuration: &configuration::Configuration, unauthenticated_secret_verification_request_model: Option< @@ -1375,6 +1400,7 @@ pub async fn accounts_resend_new_device_otp_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L387`] pub async fn accounts_revision_date_get( configuration: &configuration::Configuration, ) -> Result> { @@ -1417,6 +1443,7 @@ pub async fn accounts_revision_date_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L543`] pub async fn accounts_rotate_api_key_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1466,6 +1493,7 @@ pub async fn accounts_rotate_api_key_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L285`] pub async fn accounts_security_stamp_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1504,6 +1532,7 @@ pub async fn accounts_security_stamp_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L201`] pub async fn accounts_set_password_post( configuration: &configuration::Configuration, set_password_request_model: Option, @@ -1542,6 +1571,7 @@ pub async fn accounts_set_password_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L504`] pub async fn accounts_sso_organization_id_delete( configuration: &configuration::Configuration, organization_id: &str, @@ -1584,6 +1614,7 @@ pub async fn accounts_sso_organization_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L516`] pub async fn accounts_sso_user_identifier_get( configuration: &configuration::Configuration, ) -> Result> { @@ -1626,6 +1657,7 @@ pub async fn accounts_sso_user_identifier_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L126`] pub async fn accounts_storage_post( configuration: &configuration::Configuration, storage_request_model: Option, @@ -1675,6 +1707,7 @@ pub async fn accounts_storage_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L76`] pub async fn accounts_subscription_get( configuration: &configuration::Configuration, ) -> Result> { @@ -1717,6 +1750,7 @@ pub async fn accounts_subscription_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L192`] pub async fn accounts_tax_get( configuration: &configuration::Configuration, ) -> Result> { @@ -1759,6 +1793,7 @@ pub async fn accounts_tax_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsController.cs#L208`] pub async fn accounts_tax_put( configuration: &configuration::Configuration, tax_info_update_request_model: Option, @@ -1795,6 +1830,7 @@ pub async fn accounts_tax_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L586`] pub async fn accounts_update_tde_offboarding_password_put( configuration: &configuration::Configuration, update_tde_offboarding_password_request_model: Option< @@ -1838,6 +1874,7 @@ pub async fn accounts_update_tde_offboarding_password_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L563`] pub async fn accounts_update_temp_password_put( configuration: &configuration::Configuration, update_temp_password_request_model: Option, @@ -1875,6 +1912,7 @@ pub async fn accounts_update_temp_password_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L644`] pub async fn accounts_verify_devices_post( configuration: &configuration::Configuration, set_verify_devices_request_model: Option, @@ -1913,6 +1951,7 @@ pub async fn accounts_verify_devices_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L644`] pub async fn accounts_verify_devices_put( configuration: &configuration::Configuration, set_verify_devices_request_model: Option, @@ -1949,6 +1988,7 @@ pub async fn accounts_verify_devices_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L140`] pub async fn accounts_verify_email_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -1982,6 +2022,7 @@ pub async fn accounts_verify_email_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L153`] pub async fn accounts_verify_email_token_post( configuration: &configuration::Configuration, verify_email_request_model: Option, @@ -2020,6 +2061,7 @@ pub async fn accounts_verify_email_token_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L617`] pub async fn accounts_verify_otp_post( configuration: &configuration::Configuration, verify_otp_request_model: Option, @@ -2058,6 +2100,7 @@ pub async fn accounts_verify_otp_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AccountsController.cs#L239`] pub async fn accounts_verify_password_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/accounts_billing_api.rs b/crates/bitwarden-api-api/src/apis/accounts_billing_api.rs index 8e6eb0a73..81f6fe584 100644 --- a/crates/bitwarden-api-api/src/apis/accounts_billing_api.rs +++ b/crates/bitwarden-api-api/src/apis/accounts_billing_api.rs @@ -49,6 +49,7 @@ pub enum AccountsBillingTransactionsGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsBillingController.cs#L22`] pub async fn accounts_billing_history_get( configuration: &configuration::Configuration, ) -> Result> { @@ -91,6 +92,7 @@ pub async fn accounts_billing_history_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsBillingController.cs#L49`] pub async fn accounts_billing_invoices_get( configuration: &configuration::Configuration, status: Option<&str>, @@ -134,6 +136,7 @@ pub async fn accounts_billing_invoices_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsBillingController.cs#L36`] pub async fn accounts_billing_payment_method_get( configuration: &configuration::Configuration, ) -> Result> { @@ -180,6 +183,7 @@ pub async fn accounts_billing_payment_method_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsBillingController.cs#L84`] pub async fn accounts_billing_preview_invoice_post( configuration: &configuration::Configuration, preview_individual_invoice_request_body: Option, @@ -222,6 +226,7 @@ pub async fn accounts_billing_preview_invoice_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/AccountsBillingController.cs#L67`] pub async fn accounts_billing_transactions_get( configuration: &configuration::Configuration, start_after: Option, diff --git a/crates/bitwarden-api-api/src/apis/accounts_key_management_api.rs b/crates/bitwarden-api-api/src/apis/accounts_key_management_api.rs index 6dc9f9ed8..8a092e41f 100644 --- a/crates/bitwarden-api-api/src/apis/accounts_key_management_api.rs +++ b/crates/bitwarden-api-api/src/apis/accounts_key_management_api.rs @@ -42,6 +42,7 @@ pub enum AccountsSetKeyConnectorKeyPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs#L162`] pub async fn accounts_convert_to_key_connector_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -79,6 +80,7 @@ pub async fn accounts_convert_to_key_connector_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs#L82`] pub async fn accounts_key_management_regenerate_keys_post( configuration: &configuration::Configuration, key_regeneration_request_model: Option, @@ -121,6 +123,7 @@ pub async fn accounts_key_management_regenerate_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs#L98`] pub async fn accounts_key_management_rotate_user_account_keys_post( configuration: &configuration::Configuration, rotate_user_account_keys_and_data_request_model: Option< @@ -166,6 +169,7 @@ pub async fn accounts_key_management_rotate_user_account_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs#L139`] pub async fn accounts_set_key_connector_key_post( configuration: &configuration::Configuration, set_key_connector_key_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/auth_requests_api.rs b/crates/bitwarden-api-api/src/apis/auth_requests_api.rs index 7e74ea84c..e8d4e7ec9 100644 --- a/crates/bitwarden-api-api/src/apis/auth_requests_api.rs +++ b/crates/bitwarden-api-api/src/apis/auth_requests_api.rs @@ -63,6 +63,7 @@ pub enum AuthRequestsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AuthRequestsController.cs#L95`] pub async fn auth_requests_admin_request_post( configuration: &configuration::Configuration, auth_request_create_request_model: Option, @@ -112,6 +113,7 @@ pub async fn auth_requests_admin_request_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AuthRequestsController.cs#L35`] pub async fn auth_requests_get( configuration: &configuration::Configuration, ) -> Result> { @@ -154,6 +156,7 @@ pub async fn auth_requests_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AuthRequestsController.cs#L44`] pub async fn auth_requests_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -204,6 +207,7 @@ pub async fn auth_requests_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AuthRequestsController.cs#L103`] pub async fn auth_requests_id_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -257,6 +261,7 @@ pub async fn auth_requests_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AuthRequestsController.cs#L69`] pub async fn auth_requests_id_response_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -312,6 +317,7 @@ pub async fn auth_requests_id_response_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AuthRequestsController.cs#L59`] pub async fn auth_requests_pending_get( configuration: &configuration::Configuration, ) -> Result< @@ -357,6 +363,7 @@ pub async fn auth_requests_pending_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/AuthRequestsController.cs#L83`] pub async fn auth_requests_post( configuration: &configuration::Configuration, auth_request_create_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 a68a998e6..84c7d3f08 100644 --- a/crates/bitwarden-api-api/src/apis/ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/ciphers_api.rs @@ -427,6 +427,7 @@ pub enum CiphersSharePutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L889`] pub async fn ciphers_admin_delete( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -465,6 +466,7 @@ pub async fn ciphers_admin_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L207`] pub async fn ciphers_admin_post( configuration: &configuration::Configuration, cipher_create_request_model: Option, @@ -514,6 +516,7 @@ pub async fn ciphers_admin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1358`] pub async fn ciphers_attachment_validate_azure_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -551,6 +554,7 @@ pub async fn ciphers_attachment_validate_azure_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L826`] pub async fn ciphers_bulk_collections_post( configuration: &configuration::Configuration, cipher_bulk_update_collections_request_model: Option< @@ -592,6 +596,7 @@ pub async fn ciphers_bulk_collections_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L182`] pub async fn ciphers_create_post( configuration: &configuration::Configuration, cipher_create_request_model: Option, @@ -641,6 +646,7 @@ pub async fn ciphers_create_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L875`] pub async fn ciphers_delete( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -679,6 +685,7 @@ pub async fn ciphers_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L889`] pub async fn ciphers_delete_admin_post( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -717,6 +724,7 @@ pub async fn ciphers_delete_admin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L953`] pub async fn ciphers_delete_admin_put( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -753,6 +761,7 @@ pub async fn ciphers_delete_admin_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L875`] pub async fn ciphers_delete_post( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -791,6 +800,7 @@ pub async fn ciphers_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L941`] pub async fn ciphers_delete_put( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -827,6 +837,7 @@ pub async fn ciphers_delete_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L129`] pub async fn ciphers_get( configuration: &configuration::Configuration, ) -> Result> { @@ -869,6 +880,7 @@ pub async fn ciphers_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L860`] pub async fn ciphers_id_admin_delete( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -910,6 +922,7 @@ pub async fn ciphers_id_admin_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L97`] pub async fn ciphers_id_admin_get( configuration: &configuration::Configuration, id: &str, @@ -960,6 +973,7 @@ pub async fn ciphers_id_admin_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L279`] pub async fn ciphers_id_admin_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1015,6 +1029,7 @@ pub async fn ciphers_id_admin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L279`] pub async fn ciphers_id_admin_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1068,6 +1083,7 @@ pub async fn ciphers_id_admin_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1261`] pub async fn ciphers_id_attachment_admin_post( configuration: &configuration::Configuration, id: &str, @@ -1120,6 +1136,7 @@ pub async fn ciphers_id_attachment_admin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1343`] pub async fn ciphers_id_attachment_attachment_id_admin_delete( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1179,6 +1196,7 @@ pub async fn ciphers_id_attachment_attachment_id_admin_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1284`] pub async fn ciphers_id_attachment_attachment_id_admin_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1233,6 +1251,7 @@ pub async fn ciphers_id_attachment_attachment_id_admin_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1329`] pub async fn ciphers_id_attachment_attachment_id_delete( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1290,6 +1309,7 @@ pub async fn ciphers_id_attachment_attachment_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1343`] pub async fn ciphers_id_attachment_attachment_id_delete_admin_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1349,6 +1369,7 @@ pub async fn ciphers_id_attachment_attachment_id_delete_admin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1329`] pub async fn ciphers_id_attachment_attachment_id_delete_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1408,6 +1429,7 @@ pub async fn ciphers_id_attachment_attachment_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1298`] pub async fn ciphers_id_attachment_attachment_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1462,6 +1484,7 @@ pub async fn ciphers_id_attachment_attachment_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1209`] pub async fn ciphers_id_attachment_attachment_id_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1507,6 +1530,7 @@ pub async fn ciphers_id_attachment_attachment_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1187`] pub async fn ciphers_id_attachment_attachment_id_renew_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1564,6 +1588,7 @@ pub async fn ciphers_id_attachment_attachment_id_renew_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1309`] pub async fn ciphers_id_attachment_attachment_id_share_post( configuration: &configuration::Configuration, id: &str, @@ -1614,6 +1639,7 @@ pub async fn ciphers_id_attachment_attachment_id_share_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1234`] pub async fn ciphers_id_attachment_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1666,6 +1692,7 @@ pub async fn ciphers_id_attachment_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1152`] pub async fn ciphers_id_attachment_v2_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1721,6 +1748,7 @@ pub async fn ciphers_id_attachment_v2_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L797`] pub async fn ciphers_id_collections_admin_post( configuration: &configuration::Configuration, id: &str, @@ -1777,6 +1805,7 @@ pub async fn ciphers_id_collections_admin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L797`] pub async fn ciphers_id_collections_admin_put( configuration: &configuration::Configuration, id: &str, @@ -1830,6 +1859,7 @@ pub async fn ciphers_id_collections_admin_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L737`] pub async fn ciphers_id_collections_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1885,6 +1915,7 @@ pub async fn ciphers_id_collections_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L737`] pub async fn ciphers_id_collections_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1938,6 +1969,7 @@ pub async fn ciphers_id_collections_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L763`] pub async fn ciphers_id_collections_v2_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1993,6 +2025,7 @@ pub async fn ciphers_id_collections_v2_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L763`] pub async fn ciphers_id_collections_v2_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2046,6 +2079,7 @@ pub async fn ciphers_id_collections_v2_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L846`] pub async fn ciphers_id_delete( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2087,6 +2121,7 @@ pub async fn ciphers_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L860`] pub async fn ciphers_id_delete_admin_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2128,6 +2163,7 @@ pub async fn ciphers_id_delete_admin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L927`] pub async fn ciphers_id_delete_admin_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2167,6 +2203,7 @@ pub async fn ciphers_id_delete_admin_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L846`] pub async fn ciphers_id_delete_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2208,6 +2245,7 @@ pub async fn ciphers_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L915`] pub async fn ciphers_id_delete_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2247,6 +2285,7 @@ pub async fn ciphers_id_delete_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L114`] pub async fn ciphers_id_details_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2297,6 +2336,7 @@ pub async fn ciphers_id_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L114`] pub async fn ciphers_id_full_details_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2347,6 +2387,7 @@ pub async fn ciphers_id_full_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L82`] pub async fn ciphers_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2397,6 +2438,7 @@ pub async fn ciphers_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L683`] pub async fn ciphers_id_partial_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2452,6 +2494,7 @@ pub async fn ciphers_id_partial_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L683`] pub async fn ciphers_id_partial_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2505,6 +2548,7 @@ pub async fn ciphers_id_partial_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L237`] pub async fn ciphers_id_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2560,6 +2604,7 @@ pub async fn ciphers_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L237`] pub async fn ciphers_id_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2613,6 +2658,7 @@ pub async fn ciphers_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L996`] pub async fn ciphers_id_restore_admin_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2663,6 +2709,7 @@ pub async fn ciphers_id_restore_admin_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L978`] pub async fn ciphers_id_restore_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2713,6 +2760,7 @@ pub async fn ciphers_id_restore_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L700`] pub async fn ciphers_id_share_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2768,6 +2816,7 @@ pub async fn ciphers_id_share_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L700`] pub async fn ciphers_id_share_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -2821,6 +2870,7 @@ pub async fn ciphers_id_share_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1055`] pub async fn ciphers_move_post( configuration: &configuration::Configuration, cipher_bulk_move_request_model: Option, @@ -2859,6 +2909,7 @@ pub async fn ciphers_move_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1055`] pub async fn ciphers_move_put( configuration: &configuration::Configuration, cipher_bulk_move_request_model: Option, @@ -2895,6 +2946,7 @@ pub async fn ciphers_move_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L330`] pub async fn ciphers_organization_details_assigned_get( configuration: &configuration::Configuration, organization_id: Option, @@ -2951,6 +3003,7 @@ pub async fn ciphers_organization_details_assigned_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L312`] pub async fn ciphers_organization_details_get( configuration: &configuration::Configuration, organization_id: Option, @@ -3004,6 +3057,7 @@ pub async fn ciphers_organization_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L152`] pub async fn ciphers_post( configuration: &configuration::Configuration, cipher_request_model: Option, @@ -3053,6 +3107,7 @@ pub async fn ciphers_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1117`] pub async fn ciphers_purge_post( configuration: &configuration::Configuration, organization_id: Option, @@ -3096,6 +3151,7 @@ pub async fn ciphers_purge_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1027`] pub async fn ciphers_restore_admin_put( configuration: &configuration::Configuration, cipher_bulk_restore_request_model: Option, @@ -3143,6 +3199,7 @@ pub async fn ciphers_restore_admin_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1011`] pub async fn ciphers_restore_put( configuration: &configuration::Configuration, cipher_bulk_restore_request_model: Option, @@ -3190,6 +3247,7 @@ pub async fn ciphers_restore_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1069`] pub async fn ciphers_share_post( configuration: &configuration::Configuration, cipher_bulk_share_request_model: Option, @@ -3239,6 +3297,7 @@ pub async fn ciphers_share_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/CiphersController.cs#L1069`] pub async fn ciphers_share_put( configuration: &configuration::Configuration, cipher_bulk_share_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/collections_api.rs b/crates/bitwarden-api-api/src/apis/collections_api.rs index ac7b1cad3..3e84ecf6f 100644 --- a/crates/bitwarden-api-api/src/apis/collections_api.rs +++ b/crates/bitwarden-api-api/src/apis/collections_api.rs @@ -112,6 +112,7 @@ pub enum OrganizationsOrgIdCollectionsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L126`] pub async fn collections_get( configuration: &configuration::Configuration, ) -> Result> { @@ -154,6 +155,7 @@ pub async fn collections_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L203`] pub async fn organizations_org_id_collections_bulk_access_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -199,6 +201,7 @@ pub async fn organizations_org_id_collections_bulk_access_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L241`] pub async fn organizations_org_id_collections_delete( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -244,6 +247,7 @@ pub async fn organizations_org_id_collections_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L241`] pub async fn organizations_org_id_collections_delete_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -289,6 +293,7 @@ pub async fn organizations_org_id_collections_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L83`] pub async fn organizations_org_id_collections_details_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -343,6 +348,7 @@ pub async fn organizations_org_id_collections_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L106`] pub async fn organizations_org_id_collections_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -397,6 +403,7 @@ pub async fn organizations_org_id_collections_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L227`] pub async fn organizations_org_id_collections_id_delete( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -442,6 +449,7 @@ pub async fn organizations_org_id_collections_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L227`] pub async fn organizations_org_id_collections_id_delete_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -487,6 +495,7 @@ pub async fn organizations_org_id_collections_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L68`] pub async fn organizations_org_id_collections_id_details_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -544,6 +553,7 @@ pub async fn organizations_org_id_collections_id_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L55`] pub async fn organizations_org_id_collections_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -598,16 +608,17 @@ pub async fn organizations_org_id_collections_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L178`] pub async fn organizations_org_id_collections_id_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, id: uuid::Uuid, - collection_request_model: Option, + update_collection_request_model: Option, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_org_id = org_id; let p_id = id; - let p_collection_request_model = collection_request_model; + let p_update_collection_request_model = update_collection_request_model; let uri_str = format!( "{}/organizations/{orgId}/collections/{id}", @@ -625,7 +636,7 @@ pub async fn organizations_org_id_collections_id_post( if let Some(ref token) = configuration.oauth_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_collection_request_model); + req_builder = req_builder.json(&p_update_collection_request_model); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -657,16 +668,17 @@ pub async fn organizations_org_id_collections_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L178`] pub async fn organizations_org_id_collections_id_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, id: uuid::Uuid, - collection_request_model: Option, + update_collection_request_model: Option, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_org_id = org_id; let p_id = id; - let p_collection_request_model = collection_request_model; + let p_update_collection_request_model = update_collection_request_model; let uri_str = format!( "{}/organizations/{orgId}/collections/{id}", @@ -682,7 +694,7 @@ pub async fn organizations_org_id_collections_id_put( if let Some(ref token) = configuration.oauth_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_collection_request_model); + req_builder = req_builder.json(&p_update_collection_request_model); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -714,6 +726,7 @@ pub async fn organizations_org_id_collections_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L135`] pub async fn organizations_org_id_collections_id_users_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -771,14 +784,15 @@ pub async fn organizations_org_id_collections_id_users_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/CollectionsController.cs#L150`] pub async fn organizations_org_id_collections_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, - collection_request_model: Option, + create_collection_request_model: Option, ) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_org_id = org_id; - let p_collection_request_model = collection_request_model; + let p_create_collection_request_model = create_collection_request_model; let uri_str = format!( "{}/organizations/{orgId}/collections", @@ -795,7 +809,7 @@ pub async fn organizations_org_id_collections_post( if let Some(ref token) = configuration.oauth_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_collection_request_model); + req_builder = req_builder.json(&p_create_collection_request_model); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/crates/bitwarden-api-api/src/apis/config_api.rs b/crates/bitwarden-api-api/src/apis/config_api.rs index 2e87e555e..a85b1a3d7 100644 --- a/crates/bitwarden-api-api/src/apis/config_api.rs +++ b/crates/bitwarden-api-api/src/apis/config_api.rs @@ -21,6 +21,7 @@ pub enum ConfigGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/ConfigController.cs#L25`] pub async fn config_get( configuration: &configuration::Configuration, ) -> Result> { diff --git a/crates/bitwarden-api-api/src/apis/configuration.rs b/crates/bitwarden-api-api/src/apis/configuration.rs index faa9e6f6d..c184fc18f 100644 --- a/crates/bitwarden-api-api/src/apis/configuration.rs +++ b/crates/bitwarden-api-api/src/apis/configuration.rs @@ -36,7 +36,7 @@ impl Configuration { impl Default for Configuration { fn default() -> Self { Configuration { - base_path: "http://localhost".to_owned(), + base_path: "https://api.bitwarden.com".to_owned(), user_agent: Some("OpenAPI-Generator/latest/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, diff --git a/crates/bitwarden-api-api/src/apis/counts_api.rs b/crates/bitwarden-api-api/src/apis/counts_api.rs index 0604e46e8..3fc1d7456 100644 --- a/crates/bitwarden-api-api/src/apis/counts_api.rs +++ b/crates/bitwarden-api-api/src/apis/counts_api.rs @@ -35,6 +35,7 @@ pub enum ServiceAccountsServiceAccountIdSmCountsGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/CountsController.cs#L38`] pub async fn organizations_organization_id_sm_counts_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -89,6 +90,7 @@ pub async fn organizations_organization_id_sm_counts_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/CountsController.cs#L63`] pub async fn projects_project_id_sm_counts_get( configuration: &configuration::Configuration, project_id: uuid::Uuid, @@ -139,6 +141,7 @@ pub async fn projects_project_id_sm_counts_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/CountsController.cs#L84`] pub async fn service_accounts_service_account_id_sm_counts_get( configuration: &configuration::Configuration, service_account_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/devices_api.rs b/crates/bitwarden-api-api/src/apis/devices_api.rs index 7a4025256..e98b61438 100644 --- a/crates/bitwarden-api-api/src/apis/devices_api.rs +++ b/crates/bitwarden-api-api/src/apis/devices_api.rs @@ -168,6 +168,7 @@ pub enum DevicesUpdateTrustPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L79`] pub async fn devices_get( configuration: &configuration::Configuration, ) -> Result> { @@ -210,6 +211,7 @@ pub async fn devices_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L236`] pub async fn devices_id_deactivate_post( configuration: &configuration::Configuration, id: &str, @@ -251,6 +253,7 @@ pub async fn devices_id_deactivate_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L236`] pub async fn devices_id_delete( configuration: &configuration::Configuration, id: &str, @@ -292,6 +295,7 @@ pub async fn devices_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L53`] pub async fn devices_id_get( configuration: &configuration::Configuration, id: &str, @@ -342,6 +346,7 @@ pub async fn devices_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L104`] pub async fn devices_id_post( configuration: &configuration::Configuration, id: &str, @@ -397,6 +402,7 @@ pub async fn devices_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L104`] pub async fn devices_id_put( configuration: &configuration::Configuration, id: &str, @@ -450,6 +456,7 @@ pub async fn devices_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L223`] pub async fn devices_identifier_identifier_clear_token_post( configuration: &configuration::Configuration, identifier: &str, @@ -492,6 +499,7 @@ pub async fn devices_identifier_identifier_clear_token_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L223`] pub async fn devices_identifier_identifier_clear_token_put( configuration: &configuration::Configuration, identifier: &str, @@ -532,6 +540,7 @@ pub async fn devices_identifier_identifier_clear_token_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L66`] pub async fn devices_identifier_identifier_get( configuration: &configuration::Configuration, identifier: &str, @@ -583,6 +592,7 @@ pub async fn devices_identifier_identifier_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L192`] pub async fn devices_identifier_identifier_token_post( configuration: &configuration::Configuration, identifier: &str, @@ -628,6 +638,7 @@ pub async fn devices_identifier_identifier_token_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L192`] pub async fn devices_identifier_identifier_token_put( configuration: &configuration::Configuration, identifier: &str, @@ -671,6 +682,7 @@ pub async fn devices_identifier_identifier_token_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L205`] pub async fn devices_identifier_identifier_web_push_auth_post( configuration: &configuration::Configuration, identifier: &str, @@ -716,6 +728,7 @@ pub async fn devices_identifier_identifier_web_push_auth_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L205`] pub async fn devices_identifier_identifier_web_push_auth_put( configuration: &configuration::Configuration, identifier: &str, @@ -759,6 +772,7 @@ pub async fn devices_identifier_identifier_web_push_auth_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L120`] pub async fn devices_identifier_keys_post( configuration: &configuration::Configuration, identifier: &str, @@ -814,6 +828,7 @@ pub async fn devices_identifier_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L120`] pub async fn devices_identifier_keys_put( configuration: &configuration::Configuration, identifier: &str, @@ -867,6 +882,7 @@ pub async fn devices_identifier_keys_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L136`] pub async fn devices_identifier_retrieve_keys_post( configuration: &configuration::Configuration, identifier: &str, @@ -920,6 +936,7 @@ pub async fn devices_identifier_retrieve_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L257`] pub async fn devices_knowndevice_email_identifier_get( configuration: &configuration::Configuration, email: &str, @@ -974,6 +991,7 @@ pub async fn devices_knowndevice_email_identifier_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L251`] pub async fn devices_knowndevice_get( configuration: &configuration::Configuration, x_request_email: &str, @@ -1024,6 +1042,7 @@ pub async fn devices_knowndevice_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L275`] pub async fn devices_lost_trust_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -1057,6 +1076,7 @@ pub async fn devices_lost_trust_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L93`] pub async fn devices_post( configuration: &configuration::Configuration, device_request_model: Option, @@ -1106,6 +1126,7 @@ pub async fn devices_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L178`] pub async fn devices_untrust_post( configuration: &configuration::Configuration, untrust_devices_request_model: Option, @@ -1144,6 +1165,7 @@ pub async fn devices_untrust_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/DevicesController.cs#L155`] pub async fn devices_update_trust_post( configuration: &configuration::Configuration, update_devices_trust_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/emergency_access_api.rs b/crates/bitwarden-api-api/src/apis/emergency_access_api.rs index 748f436b1..e983850ad 100644 --- a/crates/bitwarden-api-api/src/apis/emergency_access_api.rs +++ b/crates/bitwarden-api-api/src/apis/emergency_access_api.rs @@ -147,6 +147,7 @@ pub enum EmergencyAccessTrustedGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L55`] pub async fn emergency_access_granted_get( configuration: &configuration::Configuration, ) -> Result< @@ -192,6 +193,7 @@ pub async fn emergency_access_granted_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L119`] pub async fn emergency_access_id_accept_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -236,6 +238,7 @@ pub async fn emergency_access_id_accept_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L140`] pub async fn emergency_access_id_approve_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -277,6 +280,7 @@ pub async fn emergency_access_id_approve_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L177`] pub async fn emergency_access_id_cipher_id_attachment_attachment_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -337,6 +341,7 @@ pub async fn emergency_access_id_cipher_id_attachment_attachment_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L126`] pub async fn emergency_access_id_confirm_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -381,6 +386,7 @@ pub async fn emergency_access_id_confirm_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L98`] pub async fn emergency_access_id_delete( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -422,6 +428,7 @@ pub async fn emergency_access_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L98`] pub async fn emergency_access_id_delete_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -463,6 +470,7 @@ pub async fn emergency_access_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L66`] pub async fn emergency_access_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -513,6 +521,7 @@ pub async fn emergency_access_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L133`] pub async fn emergency_access_id_initiate_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -555,6 +564,7 @@ pub async fn emergency_access_id_initiate_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L162`] pub async fn emergency_access_id_password_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -600,6 +610,7 @@ pub async fn emergency_access_id_password_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L74`] pub async fn emergency_access_id_policies_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -651,6 +662,7 @@ pub async fn emergency_access_id_policies_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L84`] pub async fn emergency_access_id_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -695,6 +707,7 @@ pub async fn emergency_access_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L84`] pub async fn emergency_access_id_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -737,6 +750,7 @@ pub async fn emergency_access_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L112`] pub async fn emergency_access_id_reinvite_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -779,6 +793,7 @@ pub async fn emergency_access_id_reinvite_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L147`] pub async fn emergency_access_id_reject_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -820,6 +835,7 @@ pub async fn emergency_access_id_reject_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L154`] pub async fn emergency_access_id_takeover_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -874,6 +890,7 @@ pub async fn emergency_access_id_takeover_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L169`] pub async fn emergency_access_id_view_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -926,6 +943,7 @@ pub async fn emergency_access_id_view_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L105`] pub async fn emergency_access_invite_post( configuration: &configuration::Configuration, emergency_access_invite_request_model: Option, @@ -964,6 +982,7 @@ pub async fn emergency_access_invite_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/EmergencyAccessController.cs#L43`] pub async fn emergency_access_trusted_get( configuration: &configuration::Configuration, ) -> Result< diff --git a/crates/bitwarden-api-api/src/apis/events_api.rs b/crates/bitwarden-api-api/src/apis/events_api.rs index 8cd8fcc4b..cd61d83f4 100644 --- a/crates/bitwarden-api-api/src/apis/events_api.rs +++ b/crates/bitwarden-api-api/src/apis/events_api.rs @@ -28,6 +28,20 @@ pub enum EventsGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`organization_org_id_projects_id_events_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationOrgIdProjectsIdEventsGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`organization_org_id_secrets_id_events_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationOrgIdSecretsIdEventsGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`organizations_id_events_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -56,6 +70,7 @@ pub enum ProvidersProviderIdUsersIdEventsGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L69`] pub async fn ciphers_id_events_get( configuration: &configuration::Configuration, id: &str, @@ -121,6 +136,7 @@ pub async fn ciphers_id_events_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L57`] pub async fn events_get( configuration: &configuration::Configuration, start: Option, @@ -180,6 +196,153 @@ pub async fn events_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L167`] +pub async fn organization_org_id_projects_id_events_get( + configuration: &configuration::Configuration, + id: uuid::Uuid, + org_id: uuid::Uuid, + start: Option, + end: Option, + continuation_token: Option<&str>, +) -> Result< + models::EventResponseModelListResponseModel, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_id = id; + let p_org_id = org_id; + let p_start = start; + let p_end = end; + let p_continuation_token = continuation_token; + + let uri_str = format!( + "{}/organization/{orgId}/projects/{id}/events", + configuration.base_path, + id = crate::apis::urlencode(p_id.to_string()), + orgId = crate::apis::urlencode(p_org_id.to_string()) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_start { + req_builder = req_builder.query(&[("start", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_end { + req_builder = req_builder.query(&[("end", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_continuation_token { + req_builder = req_builder.query(&[("continuationToken", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventResponseModelListResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L122`] +pub async fn organization_org_id_secrets_id_events_get( + configuration: &configuration::Configuration, + id: uuid::Uuid, + org_id: uuid::Uuid, + start: Option, + end: Option, + continuation_token: Option<&str>, +) -> Result< + models::EventResponseModelListResponseModel, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_id = id; + let p_org_id = org_id; + let p_start = start; + let p_end = end; + let p_continuation_token = continuation_token; + + let uri_str = format!( + "{}/organization/{orgId}/secrets/{id}/events", + configuration.base_path, + id = crate::apis::urlencode(p_id.to_string()), + orgId = crate::apis::urlencode(p_org_id.to_string()) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_start { + req_builder = req_builder.query(&[("start", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_end { + req_builder = req_builder.query(&[("end", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_continuation_token { + req_builder = req_builder.query(&[("continuationToken", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventResponseModelListResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L102`] pub async fn organizations_id_events_get( configuration: &configuration::Configuration, id: &str, @@ -245,6 +408,7 @@ pub async fn organizations_id_events_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L190`] pub async fn organizations_org_id_users_id_events_get( configuration: &configuration::Configuration, org_id: &str, @@ -317,6 +481,7 @@ pub async fn organizations_org_id_users_id_events_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L209`] pub async fn providers_provider_id_events_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -382,6 +547,7 @@ pub async fn providers_provider_id_events_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/EventsController.cs#L225`] pub async fn providers_provider_id_users_id_events_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/folders_api.rs b/crates/bitwarden-api-api/src/apis/folders_api.rs index e48e0f34c..cffa27b6a 100644 --- a/crates/bitwarden-api-api/src/apis/folders_api.rs +++ b/crates/bitwarden-api-api/src/apis/folders_api.rs @@ -70,6 +70,7 @@ pub enum FoldersPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L96`] pub async fn folders_all_delete( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -103,6 +104,7 @@ pub async fn folders_all_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L49`] pub async fn folders_get( configuration: &configuration::Configuration, ) -> Result> { @@ -145,6 +147,7 @@ pub async fn folders_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L83`] pub async fn folders_id_delete( configuration: &configuration::Configuration, id: &str, @@ -186,6 +189,7 @@ pub async fn folders_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L83`] pub async fn folders_id_delete_post( configuration: &configuration::Configuration, id: &str, @@ -227,6 +231,7 @@ pub async fn folders_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L36`] pub async fn folders_id_get( configuration: &configuration::Configuration, id: &str, @@ -277,6 +282,7 @@ pub async fn folders_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L68`] pub async fn folders_id_post( configuration: &configuration::Configuration, id: &str, @@ -332,6 +338,7 @@ pub async fn folders_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L68`] pub async fn folders_id_put( configuration: &configuration::Configuration, id: &str, @@ -385,6 +392,7 @@ pub async fn folders_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/FoldersController.cs#L58`] pub async fn folders_post( configuration: &configuration::Configuration, folder_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/groups_api.rs b/crates/bitwarden-api-api/src/apis/groups_api.rs index 2adc32ce6..ce89b01fe 100644 --- a/crates/bitwarden-api-api/src/apis/groups_api.rs +++ b/crates/bitwarden-api-api/src/apis/groups_api.rs @@ -113,6 +113,7 @@ pub enum OrganizationsOrgIdGroupsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L256`] pub async fn organizations_org_id_groups_delete( configuration: &configuration::Configuration, org_id: &str, @@ -158,6 +159,7 @@ pub async fn organizations_org_id_groups_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L256`] pub async fn organizations_org_id_groups_delete_post( configuration: &configuration::Configuration, org_id: &str, @@ -203,6 +205,7 @@ pub async fn organizations_org_id_groups_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L110`] pub async fn organizations_org_id_groups_details_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -257,6 +260,7 @@ pub async fn organizations_org_id_groups_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L96`] pub async fn organizations_org_id_groups_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -307,6 +311,7 @@ pub async fn organizations_org_id_groups_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L243`] pub async fn organizations_org_id_groups_id_delete( configuration: &configuration::Configuration, org_id: &str, @@ -352,6 +357,7 @@ pub async fn organizations_org_id_groups_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L243`] pub async fn organizations_org_id_groups_id_delete_post( configuration: &configuration::Configuration, org_id: &str, @@ -397,6 +403,7 @@ pub async fn organizations_org_id_groups_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L273`] pub async fn organizations_org_id_groups_id_delete_user_org_user_id_post( configuration: &configuration::Configuration, org_id: &str, @@ -445,6 +452,7 @@ pub async fn organizations_org_id_groups_id_delete_user_org_user_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L84`] pub async fn organizations_org_id_groups_id_details_get( configuration: &configuration::Configuration, org_id: &str, @@ -499,6 +507,7 @@ pub async fn organizations_org_id_groups_id_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L72`] pub async fn organizations_org_id_groups_id_get( configuration: &configuration::Configuration, org_id: &str, @@ -553,6 +562,7 @@ pub async fn organizations_org_id_groups_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L168`] pub async fn organizations_org_id_groups_id_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -612,6 +622,7 @@ pub async fn organizations_org_id_groups_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L168`] pub async fn organizations_org_id_groups_id_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -669,6 +680,7 @@ pub async fn organizations_org_id_groups_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L273`] pub async fn organizations_org_id_groups_id_user_org_user_id_delete( configuration: &configuration::Configuration, org_id: &str, @@ -717,6 +729,7 @@ pub async fn organizations_org_id_groups_id_user_org_user_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L125`] pub async fn organizations_org_id_groups_id_users_get( configuration: &configuration::Configuration, org_id: &str, @@ -771,6 +784,7 @@ pub async fn organizations_org_id_groups_id_users_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/GroupsController.cs#L139`] pub async fn organizations_org_id_groups_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/hibp_api.rs b/crates/bitwarden-api-api/src/apis/hibp_api.rs index 75a0a1fcc..c0827a700 100644 --- a/crates/bitwarden-api-api/src/apis/hibp_api.rs +++ b/crates/bitwarden-api-api/src/apis/hibp_api.rs @@ -21,6 +21,7 @@ pub enum HibpBreachGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/HibpController.cs#L47`] pub async fn hibp_breach_get( configuration: &configuration::Configuration, username: Option<&str>, diff --git a/crates/bitwarden-api-api/src/apis/import_ciphers_api.rs b/crates/bitwarden-api-api/src/apis/import_ciphers_api.rs index e6f767748..592553a81 100644 --- a/crates/bitwarden-api-api/src/apis/import_ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/import_ciphers_api.rs @@ -28,6 +28,7 @@ pub enum CiphersImportPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/ImportCiphersController.cs#L68`] pub async fn ciphers_import_organization_post( configuration: &configuration::Configuration, organization_id: Option<&str>, @@ -74,6 +75,7 @@ pub async fn ciphers_import_organization_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/ImportCiphersController.cs#L51`] pub async fn ciphers_import_post( configuration: &configuration::Configuration, import_ciphers_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/info_api.rs b/crates/bitwarden-api-api/src/apis/info_api.rs index c3511a58e..0dd0539bc 100644 --- a/crates/bitwarden-api-api/src/apis/info_api.rs +++ b/crates/bitwarden-api-api/src/apis/info_api.rs @@ -35,6 +35,7 @@ pub enum VersionGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/InfoController.cs#L11`] pub async fn alive_get( configuration: &configuration::Configuration, ) -> Result> { @@ -77,6 +78,7 @@ pub async fn alive_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/InfoController.cs#L11`] pub async fn now_get( configuration: &configuration::Configuration, ) -> Result> { @@ -119,6 +121,7 @@ pub async fn now_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/InfoController.cs#L17`] pub async fn version_get( configuration: &configuration::Configuration, ) -> Result<(), Error> { diff --git a/crates/bitwarden-api-api/src/apis/installations_api.rs b/crates/bitwarden-api-api/src/apis/installations_api.rs index 38d362f42..8880fa8e9 100644 --- a/crates/bitwarden-api-api/src/apis/installations_api.rs +++ b/crates/bitwarden-api-api/src/apis/installations_api.rs @@ -28,6 +28,7 @@ pub enum InstallationsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Platform/Installations/Controllers/InstallationsController.cs#L33`] pub async fn installations_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -78,6 +79,7 @@ pub async fn installations_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Platform/Installations/Controllers/InstallationsController.cs#L46`] pub async fn installations_post( configuration: &configuration::Configuration, installation_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/invoices_api.rs b/crates/bitwarden-api-api/src/apis/invoices_api.rs index 30742faf8..6d12dbbe4 100644 --- a/crates/bitwarden-api-api/src/apis/invoices_api.rs +++ b/crates/bitwarden-api-api/src/apis/invoices_api.rs @@ -21,6 +21,7 @@ pub enum InvoicesPreviewOrganizationPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/InvoicesController.cs#L24`] pub async fn invoices_preview_organization_post( configuration: &configuration::Configuration, preview_organization_invoice_request_body: Option< diff --git a/crates/bitwarden-api-api/src/apis/licenses_api.rs b/crates/bitwarden-api-api/src/apis/licenses_api.rs index c6018738d..8ec50c517 100644 --- a/crates/bitwarden-api-api/src/apis/licenses_api.rs +++ b/crates/bitwarden-api-api/src/apis/licenses_api.rs @@ -28,6 +28,7 @@ pub enum LicensesUserIdGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/LicensesController.cs#L70`] pub async fn licenses_organization_id_get( configuration: &configuration::Configuration, id: &str, @@ -84,6 +85,7 @@ pub async fn licenses_organization_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/LicensesController.cs#L49`] pub async fn licenses_user_id_get( configuration: &configuration::Configuration, id: &str, diff --git a/crates/bitwarden-api-api/src/apis/misc_api.rs b/crates/bitwarden-api-api/src/apis/misc_api.rs index cfa45a822..b96fad447 100644 --- a/crates/bitwarden-api-api/src/apis/misc_api.rs +++ b/crates/bitwarden-api-api/src/apis/misc_api.rs @@ -28,6 +28,7 @@ pub enum SetupPaymentPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/MiscController.cs#L27`] pub async fn bitpay_invoice_post( configuration: &configuration::Configuration, bit_pay_invoice_request_model: Option, @@ -77,6 +78,7 @@ pub async fn bitpay_invoice_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/MiscController.cs#L36`] pub async fn setup_payment_post( configuration: &configuration::Configuration, ) -> Result> { diff --git a/crates/bitwarden-api-api/src/apis/notifications_api.rs b/crates/bitwarden-api-api/src/apis/notifications_api.rs index 23524dc14..a2516d53a 100644 --- a/crates/bitwarden-api-api/src/apis/notifications_api.rs +++ b/crates/bitwarden-api-api/src/apis/notifications_api.rs @@ -35,6 +35,7 @@ pub enum NotificationsIdReadPatchError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/NotificationCenter/Controllers/NotificationsController.cs#L35`] pub async fn notifications_get( configuration: &configuration::Configuration, read_status_filter: Option, @@ -99,6 +100,7 @@ pub async fn notifications_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/NotificationCenter/Controllers/NotificationsController.cs#L62`] pub async fn notifications_id_delete_patch( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -140,6 +142,7 @@ pub async fn notifications_id_delete_patch( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/NotificationCenter/Controllers/NotificationsController.cs#L68`] pub async fn notifications_id_read_patch( configuration: &configuration::Configuration, id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/organization_auth_requests_api.rs b/crates/bitwarden-api-api/src/apis/organization_auth_requests_api.rs index 50138e8b3..8bf9fc8b0 100644 --- a/crates/bitwarden-api-api/src/apis/organization_auth_requests_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_auth_requests_api.rs @@ -42,6 +42,7 @@ pub enum OrganizationsOrgIdAuthRequestsRequestIdPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationAuthRequestsController.cs#L64`] pub async fn organizations_org_id_auth_requests_deny_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -89,6 +90,7 @@ pub async fn organizations_org_id_auth_requests_deny_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationAuthRequestsController.cs#L36`] pub async fn organizations_org_id_auth_requests_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -143,6 +145,7 @@ pub async fn organizations_org_id_auth_requests_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationAuthRequestsController.cs#L78`] pub async fn organizations_org_id_auth_requests_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -191,6 +194,7 @@ pub async fn organizations_org_id_auth_requests_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationAuthRequestsController.cs#L48`] pub async fn organizations_org_id_auth_requests_request_id_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/organization_billing_api.rs b/crates/bitwarden-api-api/src/apis/organization_billing_api.rs index 0599efcb3..4ddb92b66 100644 --- a/crates/bitwarden-api-api/src/apis/organization_billing_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_billing_api.rs @@ -109,13 +109,7 @@ pub enum OrganizationsOrganizationIdBillingTransactionsGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`organizations_organization_id_billing_warnings_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrganizationsOrganizationIdBillingWarningsGetError { - UnknownValue(serde_json::Value), -} - +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L365`] pub async fn organizations_organization_id_billing_change_frequency_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -161,6 +155,7 @@ pub async fn organizations_organization_id_billing_change_frequency_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L126`] pub async fn organizations_organization_id_billing_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -201,6 +196,7 @@ pub async fn organizations_organization_id_billing_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L58`] pub async fn organizations_organization_id_billing_history_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -241,6 +237,7 @@ pub async fn organizations_organization_id_billing_history_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L78`] pub async fn organizations_organization_id_billing_invoices_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -291,6 +288,7 @@ pub async fn organizations_organization_id_billing_invoices_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L38`] pub async fn organizations_organization_id_billing_metadata_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -331,6 +329,7 @@ pub async fn organizations_organization_id_billing_metadata_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L148`] pub async fn organizations_organization_id_billing_payment_method_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -371,6 +370,7 @@ pub async fn organizations_organization_id_billing_payment_method_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L172`] pub async fn organizations_organization_id_billing_payment_method_put( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -414,6 +414,7 @@ pub async fn organizations_organization_id_billing_payment_method_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L198`] pub async fn organizations_organization_id_billing_payment_method_verify_bank_account_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -460,6 +461,7 @@ pub async fn organizations_organization_id_billing_payment_method_verify_bank_ac } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L270`] pub async fn organizations_organization_id_billing_restart_subscription_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -505,6 +507,7 @@ pub async fn organizations_organization_id_billing_restart_subscription_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L337`] pub async fn organizations_organization_id_billing_setup_business_unit_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -550,6 +553,7 @@ pub async fn organizations_organization_id_billing_setup_business_unit_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L223`] pub async fn organizations_organization_id_billing_tax_information_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -590,6 +594,7 @@ pub async fn organizations_organization_id_billing_tax_information_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L247`] pub async fn organizations_organization_id_billing_tax_information_put( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -633,6 +638,7 @@ pub async fn organizations_organization_id_billing_tax_information_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationBillingController.cs#L102`] pub async fn organizations_organization_id_billing_transactions_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -677,43 +683,3 @@ pub async fn organizations_organization_id_billing_transactions_get( })) } } - -pub async fn organizations_organization_id_billing_warnings_get( - configuration: &configuration::Configuration, - organization_id: uuid::Uuid, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_organization_id = organization_id; - - let uri_str = format!( - "{}/organizations/{organizationId}/billing/warnings", - configuration.base_path, - organizationId = crate::apis::urlencode(p_organization_id.to_string()) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.oauth_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs b/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs index 4d8bc6dcf..aa1e03985 100644 --- a/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs @@ -67,6 +67,14 @@ pub enum OrganizationsOrganizationIdBillingVnextPaymentMethodVerifyBankAccountPo UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`organizations_organization_id_billing_vnext_warnings_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationsOrganizationIdBillingVnextWarningsGetError { + UnknownValue(serde_json::Value), +} + +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L36`] pub async fn organizations_organization_id_billing_vnext_address_get( configuration: &configuration::Configuration, organization_id: &str, @@ -128,6 +136,7 @@ pub async fn organizations_organization_id_billing_vnext_address_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -189,6 +198,7 @@ pub async fn organizations_organization_id_billing_vnext_address_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/address", @@ -376,6 +386,9 @@ pub async fn organizations_organization_id_billing_vnext_address_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -402,6 +415,7 @@ pub async fn organizations_organization_id_billing_vnext_address_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L47`] pub async fn organizations_organization_id_billing_vnext_address_put( configuration: &configuration::Configuration, organization_id: &str, @@ -463,6 +477,7 @@ pub async fn organizations_organization_id_billing_vnext_address_put( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, billing_address_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -525,6 +540,7 @@ pub async fn organizations_organization_id_billing_vnext_address_put( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_billing_address_request = billing_address_request; let uri_str = format!( @@ -713,6 +729,9 @@ pub async fn organizations_organization_id_billing_vnext_address_put( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -740,6 +759,7 @@ pub async fn organizations_organization_id_billing_vnext_address_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L69`] pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( configuration: &configuration::Configuration, organization_id: &str, @@ -801,6 +821,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, bit_pay_credit_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -863,6 +884,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_bit_pay_credit_request = bit_pay_credit_request; let uri_str = format!( @@ -1053,6 +1075,9 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1080,6 +1105,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L58`] pub async fn organizations_organization_id_billing_vnext_credit_get( configuration: &configuration::Configuration, organization_id: &str, @@ -1141,6 +1167,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -1202,6 +1229,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/credit", @@ -1389,6 +1417,9 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1415,6 +1446,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L82`] pub async fn organizations_organization_id_billing_vnext_payment_method_get( configuration: &configuration::Configuration, organization_id: &str, @@ -1476,6 +1508,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -1537,6 +1570,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/payment-method", @@ -1724,6 +1758,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1750,6 +1787,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L93`] pub async fn organizations_organization_id_billing_vnext_payment_method_put( configuration: &configuration::Configuration, organization_id: &str, @@ -1811,6 +1849,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, tokenized_payment_method_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -1873,6 +1912,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_tokenized_payment_method_request = tokenized_payment_method_request; let uri_str = format!( @@ -2061,6 +2101,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -2088,6 +2131,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L105`] pub async fn organizations_organization_id_billing_vnext_payment_method_verify_bank_account_post( configuration: &configuration::Configuration, organization_id: &str, @@ -2149,6 +2193,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, verify_bank_account_request: Option, ) -> Result<(), Error> { @@ -2212,6 +2257,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_verify_bank_account_request = verify_bank_account_request; let uri_str = format!( @@ -2402,6 +2448,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -2429,3 +2478,344 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b })) } } + +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs#L115`] +pub async fn organizations_organization_id_billing_vnext_warnings_get( + configuration: &configuration::Configuration, + organization_id: &str, + id: Option, + identifier: Option<&str>, + name: Option<&str>, + business_name: Option<&str>, + business_address1: Option<&str>, + business_address2: Option<&str>, + business_address3: Option<&str>, + business_country: Option<&str>, + business_tax_number: Option<&str>, + billing_email: Option<&str>, + plan: Option<&str>, + plan_type: Option, + seats: Option, + max_collections: Option, + use_policies: Option, + use_sso: Option, + use_key_connector: Option, + use_scim: Option, + use_groups: Option, + use_directory: Option, + use_events: Option, + use_totp: Option, + use2fa: Option, + use_api: Option, + use_reset_password: Option, + use_secrets_manager: Option, + self_host: Option, + users_get_premium: Option, + use_custom_permissions: Option, + storage: Option, + max_storage_gb: Option, + gateway: Option, + gateway_customer_id: Option<&str>, + gateway_subscription_id: Option<&str>, + reference_data: Option<&str>, + enabled: Option, + license_key: Option<&str>, + public_key: Option<&str>, + private_key: Option<&str>, + two_factor_providers: Option<&str>, + expiration_date: Option, + creation_date: Option, + revision_date: Option, + max_autoscale_seats: Option, + owners_notified_of_autoscaling: Option, + status: Option, + use_password_manager: Option, + sm_seats: Option, + sm_service_accounts: Option, + max_autoscale_sm_seats: Option, + max_autoscale_sm_service_accounts: Option, + limit_collection_creation: Option, + limit_collection_deletion: Option, + allow_admin_access_to_all_collection_items: Option, + limit_item_deletion: Option, + use_risk_insights: Option, + use_organization_domains: Option, + use_admin_sponsored_families: Option, + sync_seats: Option, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_organization_id = organization_id; + let p_id = id; + let p_identifier = identifier; + let p_name = name; + let p_business_name = business_name; + let p_business_address1 = business_address1; + let p_business_address2 = business_address2; + let p_business_address3 = business_address3; + let p_business_country = business_country; + let p_business_tax_number = business_tax_number; + let p_billing_email = billing_email; + let p_plan = plan; + let p_plan_type = plan_type; + let p_seats = seats; + let p_max_collections = max_collections; + let p_use_policies = use_policies; + let p_use_sso = use_sso; + let p_use_key_connector = use_key_connector; + let p_use_scim = use_scim; + let p_use_groups = use_groups; + let p_use_directory = use_directory; + let p_use_events = use_events; + let p_use_totp = use_totp; + let p_use2fa = use2fa; + let p_use_api = use_api; + let p_use_reset_password = use_reset_password; + let p_use_secrets_manager = use_secrets_manager; + let p_self_host = self_host; + let p_users_get_premium = users_get_premium; + let p_use_custom_permissions = use_custom_permissions; + let p_storage = storage; + let p_max_storage_gb = max_storage_gb; + let p_gateway = gateway; + let p_gateway_customer_id = gateway_customer_id; + let p_gateway_subscription_id = gateway_subscription_id; + let p_reference_data = reference_data; + let p_enabled = enabled; + let p_license_key = license_key; + let p_public_key = public_key; + let p_private_key = private_key; + let p_two_factor_providers = two_factor_providers; + let p_expiration_date = expiration_date; + let p_creation_date = creation_date; + let p_revision_date = revision_date; + let p_max_autoscale_seats = max_autoscale_seats; + let p_owners_notified_of_autoscaling = owners_notified_of_autoscaling; + let p_status = status; + let p_use_password_manager = use_password_manager; + let p_sm_seats = sm_seats; + let p_sm_service_accounts = sm_service_accounts; + let p_max_autoscale_sm_seats = max_autoscale_sm_seats; + let p_max_autoscale_sm_service_accounts = max_autoscale_sm_service_accounts; + let p_limit_collection_creation = limit_collection_creation; + let p_limit_collection_deletion = limit_collection_deletion; + let p_allow_admin_access_to_all_collection_items = allow_admin_access_to_all_collection_items; + let p_limit_item_deletion = limit_item_deletion; + let p_use_risk_insights = use_risk_insights; + let p_use_organization_domains = use_organization_domains; + let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; + + let uri_str = format!( + "{}/organizations/{organizationId}/billing/vnext/warnings", + configuration.base_path, + organizationId = crate::apis::urlencode(p_organization_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_id { + req_builder = req_builder.query(&[("id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_identifier { + req_builder = req_builder.query(&[("identifier", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_name { + req_builder = req_builder.query(&[("businessName", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_address1 { + req_builder = req_builder.query(&[("businessAddress1", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_address2 { + req_builder = req_builder.query(&[("businessAddress2", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_address3 { + req_builder = req_builder.query(&[("businessAddress3", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_country { + req_builder = req_builder.query(&[("businessCountry", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_tax_number { + req_builder = req_builder.query(&[("businessTaxNumber", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_billing_email { + req_builder = req_builder.query(&[("billingEmail", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_plan { + req_builder = req_builder.query(&[("plan", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_plan_type { + req_builder = req_builder.query(&[("planType", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_seats { + req_builder = req_builder.query(&[("seats", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_max_collections { + req_builder = req_builder.query(&[("maxCollections", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_policies { + req_builder = req_builder.query(&[("usePolicies", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_sso { + req_builder = req_builder.query(&[("useSso", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_key_connector { + req_builder = req_builder.query(&[("useKeyConnector", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_scim { + req_builder = req_builder.query(&[("useScim", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_groups { + req_builder = req_builder.query(&[("useGroups", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_directory { + req_builder = req_builder.query(&[("useDirectory", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_events { + req_builder = req_builder.query(&[("useEvents", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_totp { + req_builder = req_builder.query(&[("useTotp", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use2fa { + req_builder = req_builder.query(&[("use2fa", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_api { + req_builder = req_builder.query(&[("useApi", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_reset_password { + req_builder = req_builder.query(&[("useResetPassword", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_secrets_manager { + req_builder = req_builder.query(&[("useSecretsManager", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_self_host { + req_builder = req_builder.query(&[("selfHost", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_users_get_premium { + req_builder = req_builder.query(&[("usersGetPremium", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_custom_permissions { + req_builder = req_builder.query(&[("useCustomPermissions", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_storage { + req_builder = req_builder.query(&[("storage", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_max_storage_gb { + req_builder = req_builder.query(&[("maxStorageGb", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_gateway { + req_builder = req_builder.query(&[("gateway", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_gateway_customer_id { + req_builder = req_builder.query(&[("gatewayCustomerId", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_gateway_subscription_id { + req_builder = req_builder.query(&[("gatewaySubscriptionId", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_reference_data { + req_builder = req_builder.query(&[("referenceData", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_license_key { + req_builder = req_builder.query(&[("licenseKey", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_public_key { + req_builder = req_builder.query(&[("publicKey", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_private_key { + req_builder = req_builder.query(&[("privateKey", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_two_factor_providers { + req_builder = req_builder.query(&[("twoFactorProviders", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_expiration_date { + req_builder = req_builder.query(&[("expirationDate", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_creation_date { + req_builder = req_builder.query(&[("creationDate", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_revision_date { + req_builder = req_builder.query(&[("revisionDate", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_max_autoscale_seats { + req_builder = req_builder.query(&[("maxAutoscaleSeats", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_owners_notified_of_autoscaling { + req_builder = + req_builder.query(&[("ownersNotifiedOfAutoscaling", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_status { + req_builder = req_builder.query(&[("status", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_password_manager { + req_builder = req_builder.query(&[("usePasswordManager", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_sm_seats { + req_builder = req_builder.query(&[("smSeats", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_sm_service_accounts { + req_builder = req_builder.query(&[("smServiceAccounts", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_max_autoscale_sm_seats { + req_builder = req_builder.query(&[("maxAutoscaleSmSeats", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_max_autoscale_sm_service_accounts { + req_builder = + req_builder.query(&[("maxAutoscaleSmServiceAccounts", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_limit_collection_creation { + req_builder = req_builder.query(&[("limitCollectionCreation", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_limit_collection_deletion { + req_builder = req_builder.query(&[("limitCollectionDeletion", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_allow_admin_access_to_all_collection_items { + req_builder = req_builder.query(&[( + "allowAdminAccessToAllCollectionItems", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_limit_item_deletion { + req_builder = req_builder.query(&[("limitItemDeletion", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_risk_insights { + req_builder = req_builder.query(&[("useRiskInsights", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_organization_domains { + req_builder = req_builder.query(&[("useOrganizationDomains", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_admin_sponsored_families { + req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/crates/bitwarden-api-api/src/apis/organization_connections_api.rs b/crates/bitwarden-api-api/src/apis/organization_connections_api.rs index a67bca081..ebf41c408 100644 --- a/crates/bitwarden-api-api/src/apis/organization_connections_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_connections_api.rs @@ -58,6 +58,7 @@ pub enum OrganizationsConnectionsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs#L53`] pub async fn organizations_connections_enabled_get( configuration: &configuration::Configuration, ) -> Result> { @@ -104,6 +105,7 @@ pub async fn organizations_connections_enabled_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs#L145`] pub async fn organizations_connections_organization_connection_id_delete( configuration: &configuration::Configuration, organization_connection_id: uuid::Uuid, @@ -146,6 +148,7 @@ pub async fn organizations_connections_organization_connection_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs#L145`] pub async fn organizations_connections_organization_connection_id_delete_post( configuration: &configuration::Configuration, organization_connection_id: uuid::Uuid, @@ -188,6 +191,7 @@ pub async fn organizations_connections_organization_connection_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs#L83`] pub async fn organizations_connections_organization_connection_id_put( configuration: &configuration::Configuration, organization_connection_id: uuid::Uuid, @@ -245,6 +249,7 @@ pub async fn organizations_connections_organization_connection_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs#L118`] pub async fn organizations_connections_organization_id_type_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -297,6 +302,7 @@ pub async fn organizations_connections_organization_id_type_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs#L59`] pub async fn organizations_connections_post( configuration: &configuration::Configuration, organization_connection_request_model: Option, 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 b5f8c6ea3..3384eb0e7 100644 --- a/crates/bitwarden-api-api/src/apis/organization_domain_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_domain_api.rs @@ -70,6 +70,7 @@ pub enum OrganizationsOrgIdDomainPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L126`] pub async fn organizations_domain_sso_details_post( configuration: &configuration::Configuration, organization_domain_sso_details_request_model: Option< @@ -129,6 +130,7 @@ pub async fn organizations_domain_sso_details_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L140`] pub async fn organizations_domain_sso_verified_post( configuration: &configuration::Configuration, organization_domain_sso_details_request_model: Option< @@ -188,6 +190,7 @@ pub async fn organizations_domain_sso_verified_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L50`] pub async fn organizations_org_id_domain_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -241,6 +244,7 @@ pub async fn organizations_org_id_domain_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L110`] pub async fn organizations_org_id_domain_id_delete( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -286,6 +290,7 @@ pub async fn organizations_org_id_domain_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L61`] pub async fn organizations_org_id_domain_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -340,6 +345,7 @@ pub async fn organizations_org_id_domain_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L110`] pub async fn organizations_org_id_domain_id_remove_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -385,6 +391,7 @@ pub async fn organizations_org_id_domain_id_remove_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L93`] pub async fn organizations_org_id_domain_id_verify_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -442,6 +449,7 @@ pub async fn organizations_org_id_domain_id_verify_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationDomainController.cs#L77`] pub async fn organizations_org_id_domain_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/organization_export_api.rs b/crates/bitwarden-api-api/src/apis/organization_export_api.rs index fa0e79e2f..17cf780a6 100644 --- a/crates/bitwarden-api-api/src/apis/organization_export_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_export_api.rs @@ -21,6 +21,7 @@ pub enum OrganizationsOrganizationIdExportGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/OrganizationExportController.cs#L40`] pub async fn organizations_organization_id_export_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/organization_integration_api.rs b/crates/bitwarden-api-api/src/apis/organization_integration_api.rs index 206a411ce..886301368 100644 --- a/crates/bitwarden-api-api/src/apis/organization_integration_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_integration_api.rs @@ -52,6 +52,7 @@ pub enum OrganizationsOrganizationIdIntegrationsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationController.cs#L24`] pub async fn organizations_organization_id_integrations_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -106,6 +107,7 @@ pub async fn organizations_organization_id_integrations_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationController.cs#L69`] pub async fn organizations_organization_id_integrations_integration_id_delete( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -151,6 +153,7 @@ pub async fn organizations_organization_id_integrations_integration_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationController.cs#L69`] pub async fn organizations_organization_id_integrations_integration_id_delete_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -196,6 +199,7 @@ pub async fn organizations_organization_id_integrations_integration_id_delete_po } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationController.cs#L50`] pub async fn organizations_organization_id_integrations_integration_id_put( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -256,6 +260,7 @@ pub async fn organizations_organization_id_integrations_integration_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationController.cs#L38`] pub async fn organizations_organization_id_integrations_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/organization_integration_configuration_api.rs b/crates/bitwarden-api-api/src/apis/organization_integration_configuration_api.rs index 529990514..7c4ecc1a3 100644 --- a/crates/bitwarden-api-api/src/apis/organization_integration_configuration_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_integration_configuration_api.rs @@ -56,7 +56,7 @@ pub enum OrganizationsOrganizationIdIntegrationsIntegrationIdConfigurationsPostE UnknownValue(serde_json::Value), } - +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationConfigurationController.cs#L103`] pub async fn organizations_organization_id_integrations_integration_id_configurations_configuration_id_delete(configuration: &configuration::Configuration, organization_id: uuid::Uuid, integration_id: uuid::Uuid, configuration_id: uuid::Uuid) -> Result<(), Error>{ // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -93,6 +93,7 @@ pub async fn organizations_organization_id_integrations_integration_id_configura } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationConfigurationController.cs#L103`] pub async fn organizations_organization_id_integrations_integration_id_configurations_configuration_id_delete_post(configuration: &configuration::Configuration, organization_id: uuid::Uuid, integration_id: uuid::Uuid, configuration_id: uuid::Uuid) -> Result<(), Error>{ // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -129,6 +130,7 @@ pub async fn organizations_organization_id_integrations_integration_id_configura } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationConfigurationController.cs#L73`] pub async fn organizations_organization_id_integrations_integration_id_configurations_configuration_id_put( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -190,6 +192,7 @@ pub async fn organizations_organization_id_integrations_integration_id_configura } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationConfigurationController.cs#L25`] pub async fn organizations_organization_id_integrations_integration_id_configurations_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -248,6 +251,7 @@ pub async fn organizations_organization_id_integrations_integration_id_configura } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationIntegrationConfigurationController.cs#L47`] pub async fn organizations_organization_id_integrations_integration_id_configurations_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/organization_sponsorships_api.rs b/crates/bitwarden-api-api/src/apis/organization_sponsorships_api.rs index 2bf464a76..a3e2e0ffa 100644 --- a/crates/bitwarden-api-api/src/apis/organization_sponsorships_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_sponsorships_api.rs @@ -103,6 +103,7 @@ pub enum OrganizationSponsorshipValidateTokenPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L168`] pub async fn organization_sponsorship_redeem_post( configuration: &configuration::Configuration, sponsorship_token: Option<&str>, @@ -153,6 +154,7 @@ pub async fn organization_sponsorship_redeem_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L247`] pub async fn organization_sponsorship_sponsored_sponsored_org_id_delete( configuration: &configuration::Configuration, sponsored_org_id: uuid::Uuid, @@ -195,6 +197,7 @@ pub async fn organization_sponsorship_sponsored_sponsored_org_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L247`] pub async fn organization_sponsorship_sponsored_sponsored_org_id_remove_post( configuration: &configuration::Configuration, sponsored_org_id: uuid::Uuid, @@ -237,6 +240,7 @@ pub async fn organization_sponsorship_sponsored_sponsored_org_id_remove_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L82`] pub async fn organization_sponsorship_sponsoring_org_id_families_for_enterprise_post( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -285,6 +289,7 @@ pub async fn organization_sponsorship_sponsoring_org_id_families_for_enterprise_ } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L123`] pub async fn organization_sponsorship_sponsoring_org_id_families_for_enterprise_resend_post( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -333,6 +338,7 @@ pub async fn organization_sponsorship_sponsoring_org_id_families_for_enterprise_ } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L232`] pub async fn organization_sponsorship_sponsoring_org_id_sponsored_friendly_name_revoke_delete( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -380,6 +386,7 @@ pub async fn organization_sponsorship_sponsoring_org_id_sponsored_friendly_name_ } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L278`] pub async fn organization_sponsorship_sponsoring_org_id_sponsored_get( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -434,6 +441,7 @@ pub async fn organization_sponsorship_sponsoring_org_id_sponsored_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L262`] pub async fn organization_sponsorship_sponsoring_org_id_sync_status_get( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -474,6 +482,7 @@ pub async fn organization_sponsorship_sponsoring_org_id_sync_status_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L214`] pub async fn organization_sponsorship_sponsoring_organization_id_delete( configuration: &configuration::Configuration, sponsoring_organization_id: uuid::Uuid, @@ -516,6 +525,7 @@ pub async fn organization_sponsorship_sponsoring_organization_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L214`] pub async fn organization_sponsorship_sponsoring_organization_id_delete_post( configuration: &configuration::Configuration, sponsoring_organization_id: uuid::Uuid, @@ -558,6 +568,7 @@ pub async fn organization_sponsorship_sponsoring_organization_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L197`] pub async fn organization_sponsorship_sync_post( configuration: &configuration::Configuration, organization_sponsorship_sync_request_model: Option< @@ -613,6 +624,7 @@ pub async fn organization_sponsorship_sync_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs#L149`] pub async fn organization_sponsorship_validate_token_post( configuration: &configuration::Configuration, sponsorship_token: Option<&str>, 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 2936f5316..7326f4363 100644 --- a/crates/bitwarden-api-api/src/apis/organization_users_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_users_api.rs @@ -262,6 +262,7 @@ pub enum OrganizationsOrgIdUsersUserIdResetPasswordEnrollmentPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L231`] pub async fn organizations_org_id_users_account_recovery_details_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -321,6 +322,7 @@ pub async fn organizations_org_id_users_account_recovery_details_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L345`] pub async fn organizations_org_id_users_confirm_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -383,6 +385,7 @@ pub async fn organizations_org_id_users_confirm_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L507`] pub async fn organizations_org_id_users_delete( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -442,6 +445,7 @@ pub async fn organizations_org_id_users_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L532`] pub async fn organizations_org_id_users_delete_account_delete( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -501,6 +505,7 @@ pub async fn organizations_org_id_users_delete_account_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L532`] pub async fn organizations_org_id_users_delete_account_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -560,6 +565,7 @@ pub async fn organizations_org_id_users_delete_account_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L582`] pub async fn organizations_org_id_users_enable_secrets_manager_patch( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -605,6 +611,7 @@ pub async fn organizations_org_id_users_enable_secrets_manager_patch( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L582`] pub async fn organizations_org_id_users_enable_secrets_manager_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -648,6 +655,7 @@ pub async fn organizations_org_id_users_enable_secrets_manager_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L171`] pub async fn organizations_org_id_users_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -711,6 +719,7 @@ pub async fn organizations_org_id_users_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L336`] pub async fn organizations_org_id_users_id_confirm_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -759,6 +768,7 @@ pub async fn organizations_org_id_users_id_confirm_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L498`] pub async fn organizations_org_id_users_id_delete( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -804,6 +814,7 @@ pub async fn organizations_org_id_users_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L518`] pub async fn organizations_org_id_users_id_delete_account_delete( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -849,6 +860,7 @@ pub async fn organizations_org_id_users_id_delete_account_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L518`] pub async fn organizations_org_id_users_id_delete_account_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -894,6 +906,7 @@ pub async fn organizations_org_id_users_id_delete_account_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L132`] pub async fn organizations_org_id_users_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -953,6 +966,7 @@ pub async fn organizations_org_id_users_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L366`] pub async fn organizations_org_id_users_id_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1001,6 +1015,7 @@ pub async fn organizations_org_id_users_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L366`] pub async fn organizations_org_id_users_id_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1046,6 +1061,7 @@ pub async fn organizations_org_id_users_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L271`] pub async fn organizations_org_id_users_id_reinvite_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1091,6 +1107,7 @@ pub async fn organizations_org_id_users_id_reinvite_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L498`] pub async fn organizations_org_id_users_id_remove_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1136,6 +1153,7 @@ pub async fn organizations_org_id_users_id_remove_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L203`] pub async fn organizations_org_id_users_id_reset_password_details_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1193,6 +1211,7 @@ pub async fn organizations_org_id_users_id_reset_password_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L469`] pub async fn organizations_org_id_users_id_reset_password_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1242,6 +1261,7 @@ pub async fn organizations_org_id_users_id_reset_password_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L565`] pub async fn organizations_org_id_users_id_restore_patch( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1287,6 +1307,7 @@ pub async fn organizations_org_id_users_id_restore_patch( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L565`] pub async fn organizations_org_id_users_id_restore_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1330,6 +1351,7 @@ pub async fn organizations_org_id_users_id_restore_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L549`] pub async fn organizations_org_id_users_id_revoke_patch( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1375,6 +1397,7 @@ pub async fn organizations_org_id_users_id_revoke_patch( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L549`] pub async fn organizations_org_id_users_id_revoke_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1418,6 +1441,7 @@ pub async fn organizations_org_id_users_id_revoke_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L239`] pub async fn organizations_org_id_users_invite_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1463,6 +1487,7 @@ pub async fn organizations_org_id_users_invite_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L163`] pub async fn organizations_org_id_users_mini_details_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1517,6 +1542,7 @@ pub async fn organizations_org_id_users_mini_details_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L278`] pub async fn organizations_org_id_users_organization_user_id_accept_init_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1567,6 +1593,7 @@ pub async fn organizations_org_id_users_organization_user_id_accept_init_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L292`] pub async fn organizations_org_id_users_organization_user_id_accept_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1615,6 +1642,7 @@ pub async fn organizations_org_id_users_organization_user_id_accept_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L356`] pub async fn organizations_org_id_users_public_keys_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1674,6 +1702,7 @@ pub async fn organizations_org_id_users_public_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L261`] pub async fn organizations_org_id_users_reinvite_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1733,6 +1762,7 @@ pub async fn organizations_org_id_users_reinvite_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L507`] pub async fn organizations_org_id_users_remove_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1792,6 +1822,7 @@ pub async fn organizations_org_id_users_remove_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L573`] pub async fn organizations_org_id_users_restore_patch( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1851,6 +1882,7 @@ pub async fn organizations_org_id_users_restore_patch( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L573`] pub async fn organizations_org_id_users_restore_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1908,6 +1940,7 @@ pub async fn organizations_org_id_users_restore_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L557`] pub async fn organizations_org_id_users_revoke_patch( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -1967,6 +2000,7 @@ pub async fn organizations_org_id_users_revoke_patch( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L557`] pub async fn organizations_org_id_users_revoke_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -2024,6 +2058,7 @@ pub async fn organizations_org_id_users_revoke_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L441`] pub async fn organizations_org_id_users_user_id_reset_password_enrollment_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/organizations_api.rs b/crates/bitwarden-api-api/src/apis/organizations_api.rs index 653cf455b..96e13c8db 100644 --- a/crates/bitwarden-api-api/src/apis/organizations_api.rs +++ b/crates/bitwarden-api-api/src/apis/organizations_api.rs @@ -252,6 +252,7 @@ pub enum OrganizationsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L214`] pub async fn organizations_create_without_payment_post( configuration: &configuration::Configuration, organization_no_payment_create_request: Option, @@ -305,6 +306,7 @@ pub async fn organizations_create_without_payment_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L145`] pub async fn organizations_get( configuration: &configuration::Configuration, ) -> Result> @@ -348,6 +350,7 @@ pub async fn organizations_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L418`] pub async fn organizations_id_api_key_information_type_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -400,6 +403,7 @@ pub async fn organizations_id_api_key_information_type_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L369`] pub async fn organizations_id_api_key_post( configuration: &configuration::Configuration, id: &str, @@ -455,6 +459,7 @@ pub async fn organizations_id_api_key_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L228`] pub async fn organizations_id_cancel_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -499,6 +504,7 @@ pub async fn organizations_id_cancel_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L556`] pub async fn organizations_id_collection_management_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -556,6 +562,7 @@ pub async fn organizations_id_collection_management_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L296`] pub async fn organizations_id_delete( configuration: &configuration::Configuration, id: &str, @@ -600,6 +607,7 @@ pub async fn organizations_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L296`] pub async fn organizations_id_delete_post( configuration: &configuration::Configuration, id: &str, @@ -644,6 +652,7 @@ pub async fn organizations_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L340`] pub async fn organizations_id_delete_recover_token_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -692,6 +701,7 @@ pub async fn organizations_id_delete_recover_token_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L126`] pub async fn organizations_id_get( configuration: &configuration::Configuration, id: &str, @@ -742,6 +752,7 @@ pub async fn organizations_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L493`] pub async fn organizations_id_keys_get( configuration: &configuration::Configuration, id: &str, @@ -792,6 +803,7 @@ pub async fn organizations_id_keys_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L499`] pub async fn organizations_id_keys_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -847,6 +859,7 @@ pub async fn organizations_id_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L271`] pub async fn organizations_id_leave_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -888,6 +901,7 @@ pub async fn organizations_id_leave_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L94`] pub async fn organizations_id_license_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -943,6 +957,7 @@ pub async fn organizations_id_license_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L575`] pub async fn organizations_id_plan_type_get( configuration: &configuration::Configuration, id: &str, @@ -993,6 +1008,7 @@ pub async fn organizations_id_plan_type_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L230`] pub async fn organizations_id_post( configuration: &configuration::Configuration, id: &str, @@ -1048,6 +1064,7 @@ pub async fn organizations_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L480`] pub async fn organizations_id_public_key_get( configuration: &configuration::Configuration, id: &str, @@ -1098,6 +1115,7 @@ pub async fn organizations_id_public_key_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L230`] pub async fn organizations_id_put( configuration: &configuration::Configuration, id: &str, @@ -1151,6 +1169,7 @@ pub async fn organizations_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L254`] pub async fn organizations_id_reinstate_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1192,6 +1211,7 @@ pub async fn organizations_id_reinstate_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L432`] pub async fn organizations_id_rotate_api_key_post( configuration: &configuration::Configuration, id: &str, @@ -1248,6 +1268,7 @@ pub async fn organizations_id_rotate_api_key_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L204`] pub async fn organizations_id_seat_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1303,6 +1324,7 @@ pub async fn organizations_id_seat_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L136`] pub async fn organizations_id_sm_subscription_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1363,6 +1385,7 @@ pub async fn organizations_id_sm_subscription_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L513`] pub async fn organizations_id_sso_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1413,6 +1436,7 @@ pub async fn organizations_id_sso_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L532`] pub async fn organizations_id_sso_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1468,6 +1492,7 @@ pub async fn organizations_id_sso_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L258`] pub async fn organizations_id_storage_post( configuration: &configuration::Configuration, id: &str, @@ -1523,6 +1548,7 @@ pub async fn organizations_id_storage_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L179`] pub async fn organizations_id_subscribe_secrets_manager_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1582,6 +1608,7 @@ pub async fn organizations_id_subscribe_secrets_manager_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L55`] pub async fn organizations_id_subscription_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1634,6 +1661,7 @@ pub async fn organizations_id_subscription_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L163`] pub async fn organizations_id_subscription_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1693,6 +1721,7 @@ pub async fn organizations_id_subscription_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L266`] pub async fn organizations_id_tax_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1743,6 +1772,7 @@ pub async fn organizations_id_tax_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L285`] pub async fn organizations_id_tax_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1785,6 +1815,7 @@ pub async fn organizations_id_tax_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L115`] pub async fn organizations_id_upgrade_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1840,6 +1871,7 @@ pub async fn organizations_id_upgrade_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/OrganizationsController.cs#L217`] pub async fn organizations_id_verify_bank_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -1885,6 +1917,7 @@ pub async fn organizations_id_verify_bank_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L159`] pub async fn organizations_identifier_auto_enroll_status_get( configuration: &configuration::Configuration, identifier: &str, @@ -1939,6 +1972,7 @@ pub async fn organizations_identifier_auto_enroll_status_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/OrganizationsController.cs#L198`] pub async fn organizations_post( configuration: &configuration::Configuration, organization_create_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/phishing_domains_api.rs b/crates/bitwarden-api-api/src/apis/phishing_domains_api.rs index 4e963327a..17f2fc04a 100644 --- a/crates/bitwarden-api-api/src/apis/phishing_domains_api.rs +++ b/crates/bitwarden-api-api/src/apis/phishing_domains_api.rs @@ -28,6 +28,7 @@ pub enum PhishingDomainsGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/PhishingDomainsController.cs#L25`] pub async fn phishing_domains_checksum_get( configuration: &configuration::Configuration, ) -> Result> { @@ -70,6 +71,7 @@ pub async fn phishing_domains_checksum_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/PhishingDomainsController.cs#L13`] pub async fn phishing_domains_get( configuration: &configuration::Configuration, ) -> Result, Error> { diff --git a/crates/bitwarden-api-api/src/apis/plans_api.rs b/crates/bitwarden-api-api/src/apis/plans_api.rs index 7fccf0bac..df80c9936 100644 --- a/crates/bitwarden-api-api/src/apis/plans_api.rs +++ b/crates/bitwarden-api-api/src/apis/plans_api.rs @@ -21,6 +21,7 @@ pub enum PlansGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/PlansController.cs#L16`] pub async fn plans_get( configuration: &configuration::Configuration, ) -> Result> { diff --git a/crates/bitwarden-api-api/src/apis/policies_api.rs b/crates/bitwarden-api-api/src/apis/policies_api.rs index 0418f6fa9..7e0c3ae9e 100644 --- a/crates/bitwarden-api-api/src/apis/policies_api.rs +++ b/crates/bitwarden-api-api/src/apis/policies_api.rs @@ -56,6 +56,7 @@ pub enum OrganizationsOrgIdPoliciesTypePutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/PoliciesController.cs#L94`] pub async fn organizations_org_id_policies_get( configuration: &configuration::Configuration, org_id: &str, @@ -108,6 +109,7 @@ pub async fn organizations_org_id_policies_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/PoliciesController.cs#L147`] pub async fn organizations_org_id_policies_invited_user_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -167,6 +169,7 @@ pub async fn organizations_org_id_policies_invited_user_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/PoliciesController.cs#L171`] pub async fn organizations_org_id_policies_master_password_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -218,6 +221,7 @@ pub async fn organizations_org_id_policies_master_password_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/PoliciesController.cs#L110`] pub async fn organizations_org_id_policies_token_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -287,6 +291,7 @@ pub async fn organizations_org_id_policies_token_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/PoliciesController.cs#L73`] pub async fn organizations_org_id_policies_type_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -336,6 +341,7 @@ pub async fn organizations_org_id_policies_type_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/PoliciesController.cs#L200`] pub async fn organizations_org_id_policies_type_put( configuration: &configuration::Configuration, org_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/projects_api.rs b/crates/bitwarden-api-api/src/apis/projects_api.rs index 685b8ade9..a07994074 100644 --- a/crates/bitwarden-api-api/src/apis/projects_api.rs +++ b/crates/bitwarden-api-api/src/apis/projects_api.rs @@ -49,6 +49,7 @@ pub enum ProjectsIdPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ProjectsController.cs#L59`] pub async fn organizations_organization_id_projects_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -103,6 +104,7 @@ pub async fn organizations_organization_id_projects_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ProjectsController.cs#L78`] pub async fn organizations_organization_id_projects_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -159,6 +161,7 @@ pub async fn organizations_organization_id_projects_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ProjectsController.cs#L160`] pub async fn projects_delete_post( configuration: &configuration::Configuration, uuid_colon_colon_uuid: Option>, @@ -208,6 +211,7 @@ pub async fn projects_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ProjectsController.cs#L129`] pub async fn projects_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -258,6 +262,7 @@ pub async fn projects_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ProjectsController.cs#L108`] pub async fn projects_id_put( configuration: &configuration::Configuration, id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/provider_billing_api.rs b/crates/bitwarden-api-api/src/apis/provider_billing_api.rs index f70d9ca9f..5d09dd934 100644 --- a/crates/bitwarden-api-api/src/apis/provider_billing_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_billing_api.rs @@ -64,6 +64,7 @@ pub enum ProvidersProviderIdBillingTaxInformationPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/ProviderBillingController.cs#L40`] pub async fn providers_provider_id_billing_invoices_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -104,6 +105,7 @@ pub async fn providers_provider_id_billing_invoices_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/ProviderBillingController.cs#L60`] pub async fn providers_provider_id_billing_invoices_invoice_id_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -147,6 +149,7 @@ pub async fn providers_provider_id_billing_invoices_invoice_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/ProviderBillingController.cs#L84`] pub async fn providers_provider_id_billing_payment_method_put( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -190,6 +193,7 @@ pub async fn providers_provider_id_billing_payment_method_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/ProviderBillingController.cs#L107`] pub async fn providers_provider_id_billing_payment_method_verify_bank_account_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -235,6 +239,7 @@ pub async fn providers_provider_id_billing_payment_method_verify_bank_account_po } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/ProviderBillingController.cs#L127`] pub async fn providers_provider_id_billing_subscription_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -275,6 +280,7 @@ pub async fn providers_provider_id_billing_subscription_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/ProviderBillingController.cs#L179`] pub async fn providers_provider_id_billing_tax_information_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -315,6 +321,7 @@ pub async fn providers_provider_id_billing_tax_information_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/ProviderBillingController.cs#L198`] pub async fn providers_provider_id_billing_tax_information_put( configuration: &configuration::Configuration, provider_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/provider_billing_v_next_api.rs b/crates/bitwarden-api-api/src/apis/provider_billing_v_next_api.rs index 7a762e33e..527c4ce19 100644 --- a/crates/bitwarden-api-api/src/apis/provider_billing_v_next_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_billing_v_next_api.rs @@ -64,6 +64,14 @@ pub enum ProvidersProviderIdBillingVnextPaymentMethodVerifyBankAccountPostError UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`providers_provider_id_billing_vnext_warnings_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProviderIdBillingVnextWarningsGetError { + UnknownValue(serde_json::Value), +} + +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L33`] pub async fn providers_provider_id_billing_vnext_address_get( configuration: &configuration::Configuration, provider_id: &str, @@ -204,6 +212,7 @@ pub async fn providers_provider_id_billing_vnext_address_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L43`] pub async fn providers_provider_id_billing_vnext_address_put( configuration: &configuration::Configuration, provider_id: &str, @@ -347,6 +356,7 @@ pub async fn providers_provider_id_billing_vnext_address_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L63`] pub async fn providers_provider_id_billing_vnext_credit_bitpay_post( configuration: &configuration::Configuration, provider_id: &str, @@ -492,6 +502,7 @@ pub async fn providers_provider_id_billing_vnext_credit_bitpay_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L53`] pub async fn providers_provider_id_billing_vnext_credit_get( configuration: &configuration::Configuration, provider_id: &str, @@ -632,6 +643,7 @@ pub async fn providers_provider_id_billing_vnext_credit_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L75`] pub async fn providers_provider_id_billing_vnext_payment_method_get( configuration: &configuration::Configuration, provider_id: &str, @@ -772,6 +784,7 @@ pub async fn providers_provider_id_billing_vnext_payment_method_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L85`] pub async fn providers_provider_id_billing_vnext_payment_method_put( configuration: &configuration::Configuration, provider_id: &str, @@ -915,6 +928,7 @@ pub async fn providers_provider_id_billing_vnext_payment_method_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L105`] pub async fn providers_provider_id_billing_vnext_payment_method_verify_bank_account_post( configuration: &configuration::Configuration, provider_id: &str, @@ -1059,3 +1073,144 @@ pub async fn providers_provider_id_billing_vnext_payment_method_verify_bank_acco })) } } + +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs#L114`] +pub async fn providers_provider_id_billing_vnext_warnings_get( + configuration: &configuration::Configuration, + provider_id: &str, + id: Option, + name: Option<&str>, + business_name: Option<&str>, + business_address1: Option<&str>, + business_address2: Option<&str>, + business_address3: Option<&str>, + business_country: Option<&str>, + business_tax_number: Option<&str>, + billing_email: Option<&str>, + billing_phone: Option<&str>, + status: Option, + use_events: Option, + r#type: Option, + enabled: Option, + creation_date: Option, + revision_date: Option, + gateway: Option, + gateway_customer_id: Option<&str>, + gateway_subscription_id: Option<&str>, + discount_id: Option<&str>, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_provider_id = provider_id; + let p_id = id; + let p_name = name; + let p_business_name = business_name; + let p_business_address1 = business_address1; + let p_business_address2 = business_address2; + let p_business_address3 = business_address3; + let p_business_country = business_country; + let p_business_tax_number = business_tax_number; + let p_billing_email = billing_email; + let p_billing_phone = billing_phone; + let p_status = status; + let p_use_events = use_events; + let p_type = r#type; + let p_enabled = enabled; + let p_creation_date = creation_date; + let p_revision_date = revision_date; + let p_gateway = gateway; + let p_gateway_customer_id = gateway_customer_id; + let p_gateway_subscription_id = gateway_subscription_id; + let p_discount_id = discount_id; + + let uri_str = format!( + "{}/providers/{providerId}/billing/vnext/warnings", + configuration.base_path, + providerId = crate::apis::urlencode(p_provider_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_id { + req_builder = req_builder.query(&[("id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_name { + req_builder = req_builder.query(&[("businessName", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_address1 { + req_builder = req_builder.query(&[("businessAddress1", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_address2 { + req_builder = req_builder.query(&[("businessAddress2", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_address3 { + req_builder = req_builder.query(&[("businessAddress3", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_country { + req_builder = req_builder.query(&[("businessCountry", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_business_tax_number { + req_builder = req_builder.query(&[("businessTaxNumber", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_billing_email { + req_builder = req_builder.query(&[("billingEmail", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_billing_phone { + req_builder = req_builder.query(&[("billingPhone", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_status { + req_builder = req_builder.query(&[("status", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_use_events { + req_builder = req_builder.query(&[("useEvents", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_type { + req_builder = req_builder.query(&[("type", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_creation_date { + req_builder = req_builder.query(&[("creationDate", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_revision_date { + req_builder = req_builder.query(&[("revisionDate", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_gateway { + req_builder = req_builder.query(&[("gateway", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_gateway_customer_id { + req_builder = req_builder.query(&[("gatewayCustomerId", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_gateway_subscription_id { + req_builder = req_builder.query(&[("gatewaySubscriptionId", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_discount_id { + req_builder = req_builder.query(&[("discountId", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/crates/bitwarden-api-api/src/apis/provider_clients_api.rs b/crates/bitwarden-api-api/src/apis/provider_clients_api.rs index 4548086b6..95ed34325 100644 --- a/crates/bitwarden-api-api/src/apis/provider_clients_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_clients_api.rs @@ -42,6 +42,7 @@ pub enum ProvidersProviderIdClientsProviderOrganizationIdPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderClientsController.cs#L143`] pub async fn providers_provider_id_clients_addable_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -82,6 +83,7 @@ pub async fn providers_provider_id_clients_addable_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderClientsController.cs#L169`] pub async fn providers_provider_id_clients_existing_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -127,6 +129,7 @@ pub async fn providers_provider_id_clients_existing_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderClientsController.cs#L37`] pub async fn providers_provider_id_clients_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -172,6 +175,7 @@ pub async fn providers_provider_id_clients_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderClientsController.cs#L96`] pub async fn providers_provider_id_clients_provider_organization_id_put( configuration: &configuration::Configuration, provider_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/provider_organizations_api.rs b/crates/bitwarden-api-api/src/apis/provider_organizations_api.rs index 6b7306ed7..50da9fc5d 100644 --- a/crates/bitwarden-api-api/src/apis/provider_organizations_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_organizations_api.rs @@ -49,6 +49,7 @@ pub enum ProvidersProviderIdOrganizationsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs#L65`] pub async fn providers_provider_id_organizations_add_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -94,6 +95,7 @@ pub async fn providers_provider_id_organizations_add_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs#L52`] pub async fn providers_provider_id_organizations_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -148,6 +150,7 @@ pub async fn providers_provider_id_organizations_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs#L98`] pub async fn providers_provider_id_organizations_id_delete( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -193,6 +196,7 @@ pub async fn providers_provider_id_organizations_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs#L98`] pub async fn providers_provider_id_organizations_id_delete_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -238,6 +242,7 @@ pub async fn providers_provider_id_organizations_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderOrganizationsController.cs#L77`] pub async fn providers_provider_id_organizations_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/provider_users_api.rs b/crates/bitwarden-api-api/src/apis/provider_users_api.rs index 63a30f89e..83ab64101 100644 --- a/crates/bitwarden-api-api/src/apis/provider_users_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_users_api.rs @@ -119,6 +119,7 @@ pub enum ProvidersProviderIdUsersReinvitePostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L131`] pub async fn providers_provider_id_users_confirm_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -178,6 +179,7 @@ pub async fn providers_provider_id_users_confirm_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L192`] pub async fn providers_provider_id_users_delete( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -237,6 +239,7 @@ pub async fn providers_provider_id_users_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L192`] pub async fn providers_provider_id_users_delete_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -296,6 +299,7 @@ pub async fn providers_provider_id_users_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L53`] pub async fn providers_provider_id_users_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -349,6 +353,7 @@ pub async fn providers_provider_id_users_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L106`] pub async fn providers_provider_id_users_id_accept_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -397,6 +402,7 @@ pub async fn providers_provider_id_users_id_accept_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L118`] pub async fn providers_provider_id_users_id_confirm_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -445,6 +451,7 @@ pub async fn providers_provider_id_users_id_confirm_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L179`] pub async fn providers_provider_id_users_id_delete( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -490,6 +497,7 @@ pub async fn providers_provider_id_users_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L179`] pub async fn providers_provider_id_users_id_delete_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -535,6 +543,7 @@ pub async fn providers_provider_id_users_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L41`] pub async fn providers_provider_id_users_id_get( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -589,6 +598,7 @@ pub async fn providers_provider_id_users_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L160`] pub async fn providers_provider_id_users_id_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -637,6 +647,7 @@ pub async fn providers_provider_id_users_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L160`] pub async fn providers_provider_id_users_id_put( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -683,6 +694,7 @@ pub async fn providers_provider_id_users_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L93`] pub async fn providers_provider_id_users_id_reinvite_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -728,6 +740,7 @@ pub async fn providers_provider_id_users_id_reinvite_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L66`] pub async fn providers_provider_id_users_invite_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -773,6 +786,7 @@ pub async fn providers_provider_id_users_invite_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L146`] pub async fn providers_provider_id_users_public_keys_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, @@ -832,6 +846,7 @@ pub async fn providers_provider_id_users_public_keys_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProviderUsersController.cs#L79`] pub async fn providers_provider_id_users_reinvite_post( configuration: &configuration::Configuration, provider_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/providers_api.rs b/crates/bitwarden-api-api/src/apis/providers_api.rs index 0c68114f6..5cea427f3 100644 --- a/crates/bitwarden-api-api/src/apis/providers_api.rs +++ b/crates/bitwarden-api-api/src/apis/providers_api.rs @@ -63,6 +63,7 @@ pub enum ProvidersIdSetupPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProvidersController.cs#L125`] pub async fn providers_id_delete( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -104,6 +105,7 @@ pub async fn providers_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProvidersController.cs#L125`] pub async fn providers_id_delete_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -145,6 +147,7 @@ pub async fn providers_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProvidersController.cs#L113`] pub async fn providers_id_delete_recover_token_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -193,6 +196,7 @@ pub async fn providers_id_delete_recover_token_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProvidersController.cs#L40`] pub async fn providers_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -243,6 +247,7 @@ pub async fn providers_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProvidersController.cs#L58`] pub async fn providers_id_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -298,6 +303,7 @@ pub async fn providers_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProvidersController.cs#L58`] pub async fn providers_id_put( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -351,6 +357,7 @@ pub async fn providers_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/ProvidersController.cs#L76`] pub async fn providers_id_setup_post( configuration: &configuration::Configuration, id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/push_api.rs b/crates/bitwarden-api-api/src/apis/push_api.rs index 51c4665b3..1bae4139e 100644 --- a/crates/bitwarden-api-api/src/apis/push_api.rs +++ b/crates/bitwarden-api-api/src/apis/push_api.rs @@ -49,6 +49,7 @@ pub enum PushSendPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Platform/Push/Controllers/PushController.cs#L66`] pub async fn push_add_organization_put( configuration: &configuration::Configuration, push_update_request_model: Option, @@ -85,6 +86,7 @@ pub async fn push_add_organization_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Platform/Push/Controllers/PushController.cs#L75`] pub async fn push_delete_organization_put( configuration: &configuration::Configuration, push_update_request_model: Option, @@ -121,6 +123,7 @@ pub async fn push_delete_organization_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Platform/Push/Controllers/PushController.cs#L59`] pub async fn push_delete_post( configuration: &configuration::Configuration, push_device_request_model: Option, @@ -159,6 +162,7 @@ pub async fn push_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Platform/Push/Controllers/PushController.cs#L50`] pub async fn push_register_post( configuration: &configuration::Configuration, push_registration_request_model: Option, @@ -197,6 +201,7 @@ pub async fn push_register_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Platform/Push/Controllers/PushController.cs#L84`] pub async fn push_send_post( configuration: &configuration::Configuration, json_element_push_send_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/reports_api.rs b/crates/bitwarden-api-api/src/apis/reports_api.rs index 0daec6ffb..b2301aa3f 100644 --- a/crates/bitwarden-api-api/src/apis/reports_api.rs +++ b/crates/bitwarden-api-api/src/apis/reports_api.rs @@ -105,6 +105,7 @@ pub enum ReportsPasswordHealthReportApplicationsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L86`] pub async fn reports_member_access_org_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -158,6 +159,7 @@ pub async fn reports_member_access_org_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L62`] pub async fn reports_member_cipher_details_org_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -212,6 +214,7 @@ pub async fn reports_member_cipher_details_org_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L300`] pub async fn reports_organization_report_summary_org_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -276,6 +279,7 @@ pub async fn reports_organization_report_summary_org_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L324`] pub async fn reports_organization_report_summary_post( configuration: &configuration::Configuration, organization_report_summary_model: Option, @@ -318,6 +322,7 @@ pub async fn reports_organization_report_summary_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L340`] pub async fn reports_organization_report_summary_put( configuration: &configuration::Configuration, organization_report_summary_model: Option, @@ -358,6 +363,7 @@ pub async fn reports_organization_report_summary_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L243`] pub async fn reports_organization_reports_delete( configuration: &configuration::Configuration, drop_organization_report_request: Option, @@ -397,6 +403,7 @@ pub async fn reports_organization_reports_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L277`] pub async fn reports_organization_reports_latest_org_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -448,6 +455,7 @@ pub async fn reports_organization_reports_latest_org_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L260`] pub async fn reports_organization_reports_org_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -499,6 +507,7 @@ pub async fn reports_organization_reports_org_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L226`] pub async fn reports_organization_reports_post( configuration: &configuration::Configuration, add_organization_report_request: Option, @@ -549,6 +558,7 @@ pub async fn reports_organization_reports_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L208`] pub async fn reports_password_health_report_application_delete( configuration: &configuration::Configuration, drop_password_health_report_application_request: Option< @@ -594,6 +604,7 @@ pub async fn reports_password_health_report_application_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L155`] pub async fn reports_password_health_report_application_post( configuration: &configuration::Configuration, password_health_report_application_model: Option, @@ -650,6 +661,7 @@ pub async fn reports_password_health_report_application_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L136`] pub async fn reports_password_health_report_applications_org_id_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -704,6 +716,7 @@ pub async fn reports_password_health_report_applications_org_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Dirt/Controllers/ReportsController.cs#L180`] pub async fn reports_password_health_report_applications_post( configuration: &configuration::Configuration, password_health_report_application_model: Option< diff --git a/crates/bitwarden-api-api/src/apis/request_sm_access_api.rs b/crates/bitwarden-api-api/src/apis/request_sm_access_api.rs index 0c3ec8aef..25afb4435 100644 --- a/crates/bitwarden-api-api/src/apis/request_sm_access_api.rs +++ b/crates/bitwarden-api-api/src/apis/request_sm_access_api.rs @@ -21,6 +21,7 @@ pub enum RequestAccessRequestSmAccessPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/RequestSMAccessController.cs#L34`] pub async fn request_access_request_sm_access_post( configuration: &configuration::Configuration, request_sm_access_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/secrets_api.rs b/crates/bitwarden-api-api/src/apis/secrets_api.rs index a75c7d8c4..e3ca351ee 100644 --- a/crates/bitwarden-api-api/src/apis/secrets_api.rs +++ b/crates/bitwarden-api-api/src/apis/secrets_api.rs @@ -70,6 +70,7 @@ pub enum SecretsIdPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L73`] pub async fn organizations_organization_id_secrets_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -124,6 +125,7 @@ pub async fn organizations_organization_id_secrets_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L91`] pub async fn organizations_organization_id_secrets_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -180,6 +182,7 @@ pub async fn organizations_organization_id_secrets_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L266`] pub async fn organizations_organization_id_secrets_sync_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -237,6 +240,7 @@ pub async fn organizations_organization_id_secrets_sync_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L148`] pub async fn projects_project_id_secrets_get( configuration: &configuration::Configuration, project_id: uuid::Uuid, @@ -287,6 +291,7 @@ pub async fn projects_project_id_secrets_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L202`] pub async fn secrets_delete_post( configuration: &configuration::Configuration, uuid_colon_colon_uuid: Option>, @@ -336,6 +341,7 @@ pub async fn secrets_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L244`] pub async fn secrets_get_by_ids_post( configuration: &configuration::Configuration, get_secrets_request_model: Option, @@ -385,6 +391,7 @@ pub async fn secrets_get_by_ids_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L122`] pub async fn secrets_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -435,6 +442,7 @@ pub async fn secrets_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsController.cs#L166`] pub async fn secrets_id_put( configuration: &configuration::Configuration, id: uuid::Uuid, 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 index f83b19ec5..2000622f4 100644 --- a/crates/bitwarden-api-api/src/apis/secrets_manager_events_api.rs +++ b/crates/bitwarden-api-api/src/apis/secrets_manager_events_api.rs @@ -21,6 +21,7 @@ pub enum SmEventsServiceAccountsServiceAccountIdGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsManagerEventsController.cs#L37`] pub async fn sm_events_service_accounts_service_account_id_get( configuration: &configuration::Configuration, service_account_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/secrets_manager_porting_api.rs b/crates/bitwarden-api-api/src/apis/secrets_manager_porting_api.rs index 077432717..082d553b8 100644 --- a/crates/bitwarden-api-api/src/apis/secrets_manager_porting_api.rs +++ b/crates/bitwarden-api-api/src/apis/secrets_manager_porting_api.rs @@ -28,6 +28,7 @@ pub enum SmOrganizationIdImportPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsManagerPortingController.cs#L42`] pub async fn sm_organization_id_export_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -78,6 +79,7 @@ pub async fn sm_organization_id_export_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsManagerPortingController.cs#L62`] pub async fn sm_organization_id_import_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/security_task_api.rs b/crates/bitwarden-api-api/src/apis/security_task_api.rs index 9dd3d1743..754d436e5 100644 --- a/crates/bitwarden-api-api/src/apis/security_task_api.rs +++ b/crates/bitwarden-api-api/src/apis/security_task_api.rs @@ -35,6 +35,13 @@ pub enum TasksOrganizationGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tasks_organization_id_metrics_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksOrganizationIdMetricsGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tasks_task_id_complete_patch`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -42,6 +49,7 @@ pub enum TasksTaskIdCompletePatchError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/SecurityTaskController.cs#L54`] pub async fn tasks_get( configuration: &configuration::Configuration, status: Option, @@ -91,6 +99,7 @@ pub async fn tasks_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/SecurityTaskController.cs#L107`] pub async fn tasks_org_id_bulk_create_post( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -147,6 +156,7 @@ pub async fn tasks_org_id_bulk_create_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/SecurityTaskController.cs#L80`] pub async fn tasks_organization_get( configuration: &configuration::Configuration, organization_id: Option, @@ -201,6 +211,59 @@ pub async fn tasks_organization_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/SecurityTaskController.cs#L92`] +pub async fn tasks_organization_id_metrics_get( + configuration: &configuration::Configuration, + organization_id: uuid::Uuid, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_organization_id = organization_id; + + let uri_str = format!( + "{}/tasks/{organizationId}/metrics", + configuration.base_path, + organizationId = crate::apis::urlencode(p_organization_id.to_string()) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecurityTaskMetricsResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecurityTaskMetricsResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/SecurityTaskController.cs#L67`] pub async fn tasks_task_id_complete_patch( configuration: &configuration::Configuration, task_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/self_hosted_organization_licenses_api.rs b/crates/bitwarden-api-api/src/apis/self_hosted_organization_licenses_api.rs index 52b1dd702..aa26f7776 100644 --- a/crates/bitwarden-api-api/src/apis/self_hosted_organization_licenses_api.rs +++ b/crates/bitwarden-api-api/src/apis/self_hosted_organization_licenses_api.rs @@ -35,6 +35,7 @@ pub enum OrganizationsLicensesSelfHostedPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs#L78`] pub async fn organizations_licenses_self_hosted_id_post( configuration: &configuration::Configuration, id: &str, @@ -82,6 +83,7 @@ pub async fn organizations_licenses_self_hosted_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs#L104`] pub async fn organizations_licenses_self_hosted_id_sync_post( configuration: &configuration::Configuration, id: &str, @@ -124,6 +126,7 @@ pub async fn organizations_licenses_self_hosted_id_sync_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs#L57`] pub async fn organizations_licenses_self_hosted_post( configuration: &configuration::Configuration, key: &str, diff --git a/crates/bitwarden-api-api/src/apis/self_hosted_organization_sponsorships_api.rs b/crates/bitwarden-api-api/src/apis/self_hosted_organization_sponsorships_api.rs index cc46f990f..daa336fbf 100644 --- a/crates/bitwarden-api-api/src/apis/self_hosted_organization_sponsorships_api.rs +++ b/crates/bitwarden-api-api/src/apis/self_hosted_organization_sponsorships_api.rs @@ -53,6 +53,7 @@ pub enum OrganizationSponsorshipSelfHostedSponsoringOrgIdSponsoredFriendlyNameRe UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs#L113`] pub async fn organization_sponsorship_self_hosted_org_id_sponsored_get( configuration: &configuration::Configuration, org_id: uuid::Uuid, @@ -107,6 +108,7 @@ pub async fn organization_sponsorship_self_hosted_org_id_sponsored_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs#L84`] pub async fn organization_sponsorship_self_hosted_sponsoring_org_id_delete( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -149,6 +151,7 @@ pub async fn organization_sponsorship_self_hosted_sponsoring_org_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs#L84`] pub async fn organization_sponsorship_self_hosted_sponsoring_org_id_delete_post( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -191,6 +194,7 @@ pub async fn organization_sponsorship_self_hosted_sponsoring_org_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs#L57`] pub async fn organization_sponsorship_self_hosted_sponsoring_org_id_families_for_enterprise_post( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, @@ -241,6 +245,7 @@ pub async fn organization_sponsorship_self_hosted_sponsoring_org_id_families_for } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs#L100`] pub async fn organization_sponsorship_self_hosted_sponsoring_org_id_sponsored_friendly_name_revoke_delete( configuration: &configuration::Configuration, sponsoring_org_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/sends_api.rs b/crates/bitwarden-api-api/src/apis/sends_api.rs index dadbcecd2..18ab95186 100644 --- a/crates/bitwarden-api-api/src/apis/sends_api.rs +++ b/crates/bitwarden-api-api/src/apis/sends_api.rs @@ -98,6 +98,7 @@ pub enum SendsPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L63`] pub async fn sends_access_id_post( configuration: &configuration::Configuration, id: &str, @@ -142,6 +143,7 @@ pub async fn sends_access_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L102`] pub async fn sends_encoded_send_id_access_file_file_id_post( configuration: &configuration::Configuration, encoded_send_id: &str, @@ -190,6 +192,7 @@ pub async fn sends_encoded_send_id_access_file_file_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L215`] pub async fn sends_file_v2_post( configuration: &configuration::Configuration, send_request_model: Option, @@ -239,6 +242,7 @@ pub async fn sends_file_v2_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L145`] pub async fn sends_file_validate_azure_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -272,6 +276,7 @@ pub async fn sends_file_validate_azure_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L196`] pub async fn sends_get( configuration: &configuration::Configuration, ) -> Result> { @@ -314,6 +319,7 @@ pub async fn sends_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L317`] pub async fn sends_id_delete( configuration: &configuration::Configuration, id: &str, @@ -355,6 +361,7 @@ pub async fn sends_id_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L245`] pub async fn sends_id_file_file_id_get( configuration: &configuration::Configuration, id: &str, @@ -408,6 +415,7 @@ pub async fn sends_id_file_file_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L272`] pub async fn sends_id_file_file_id_post( configuration: &configuration::Configuration, id: &str, @@ -452,6 +460,7 @@ pub async fn sends_id_file_file_id_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L183`] pub async fn sends_id_get( configuration: &configuration::Configuration, id: &str, @@ -502,6 +511,7 @@ pub async fn sends_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L287`] pub async fn sends_id_put( configuration: &configuration::Configuration, id: &str, @@ -555,6 +565,7 @@ pub async fn sends_id_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L302`] pub async fn sends_id_remove_password_put( configuration: &configuration::Configuration, id: &str, @@ -605,6 +616,7 @@ pub async fn sends_id_remove_password_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Tools/Controllers/SendsController.cs#L205`] pub async fn sends_post( configuration: &configuration::Configuration, send_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/service_accounts_api.rs b/crates/bitwarden-api-api/src/apis/service_accounts_api.rs index 90c612460..769bff5b7 100644 --- a/crates/bitwarden-api-api/src/apis/service_accounts_api.rs +++ b/crates/bitwarden-api-api/src/apis/service_accounts_api.rs @@ -70,6 +70,7 @@ pub enum ServiceAccountsIdPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L83`] pub async fn organizations_organization_id_service_accounts_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -129,6 +130,7 @@ pub async fn organizations_organization_id_service_accounts_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L119`] pub async fn organizations_organization_id_service_accounts_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -188,6 +190,7 @@ pub async fn organizations_organization_id_service_accounts_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L166`] pub async fn service_accounts_delete_post( configuration: &configuration::Configuration, uuid_colon_colon_uuid: Option>, @@ -238,6 +241,7 @@ pub async fn service_accounts_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L206`] pub async fn service_accounts_id_access_tokens_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -292,6 +296,7 @@ pub async fn service_accounts_id_access_tokens_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L225`] pub async fn service_accounts_id_access_tokens_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -349,6 +354,7 @@ pub async fn service_accounts_id_access_tokens_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L242`] pub async fn service_accounts_id_access_tokens_revoke_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -394,6 +400,7 @@ pub async fn service_accounts_id_access_tokens_revoke_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L103`] pub async fn service_accounts_id_get( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -444,6 +451,7 @@ pub async fn service_accounts_id_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/ServiceAccountsController.cs#L150`] pub async fn service_accounts_id_put( configuration: &configuration::Configuration, id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/settings_api.rs b/crates/bitwarden-api-api/src/apis/settings_api.rs index 0217d0d61..a4b42a982 100644 --- a/crates/bitwarden-api-api/src/apis/settings_api.rs +++ b/crates/bitwarden-api-api/src/apis/settings_api.rs @@ -35,6 +35,7 @@ pub enum SettingsDomainsPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SettingsController.cs#L23`] pub async fn settings_domains_get( configuration: &configuration::Configuration, excluded: Option, @@ -84,6 +85,7 @@ pub async fn settings_domains_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SettingsController.cs#L37`] pub async fn settings_domains_post( configuration: &configuration::Configuration, update_domains_request_model: Option, @@ -133,6 +135,7 @@ pub async fn settings_domains_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/SettingsController.cs#L37`] pub async fn settings_domains_put( configuration: &configuration::Configuration, update_domains_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/slack_integration_api.rs b/crates/bitwarden-api-api/src/apis/slack_integration_api.rs index 095cc239e..4d04a472f 100644 --- a/crates/bitwarden-api-api/src/apis/slack_integration_api.rs +++ b/crates/bitwarden-api-api/src/apis/slack_integration_api.rs @@ -29,6 +29,7 @@ pub enum OrganizationsOrganizationIdIntegrationsSlackRedirectGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/SlackIntegrationController.cs#L51`] pub async fn create_async( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -73,6 +74,7 @@ pub async fn create_async( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/AdminConsole/Controllers/SlackIntegrationController.cs#L30`] pub async fn organizations_organization_id_integrations_slack_redirect_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/stripe_api.rs b/crates/bitwarden-api-api/src/apis/stripe_api.rs index 7585964ea..41ac133fd 100644 --- a/crates/bitwarden-api-api/src/apis/stripe_api.rs +++ b/crates/bitwarden-api-api/src/apis/stripe_api.rs @@ -35,6 +35,7 @@ pub enum TaxIsCountrySupportedGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/StripeController.cs#L17`] pub async fn setup_intent_bank_account_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -68,6 +69,7 @@ pub async fn setup_intent_bank_account_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/StripeController.cs#L39`] pub async fn setup_intent_card_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -101,6 +103,7 @@ pub async fn setup_intent_card_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/StripeController.cs#L56`] pub async fn tax_is_country_supported_get( configuration: &configuration::Configuration, country: Option<&str>, diff --git a/crates/bitwarden-api-api/src/apis/sync_api.rs b/crates/bitwarden-api-api/src/apis/sync_api.rs index 4cf9f4d73..065878843 100644 --- a/crates/bitwarden-api-api/src/apis/sync_api.rs +++ b/crates/bitwarden-api-api/src/apis/sync_api.rs @@ -21,6 +21,7 @@ pub enum SyncGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Vault/Controllers/SyncController.cs#L80`] pub async fn sync_get( configuration: &configuration::Configuration, exclude_domains: Option, diff --git a/crates/bitwarden-api-api/src/apis/tax_api.rs b/crates/bitwarden-api-api/src/apis/tax_api.rs index 92b33ea4e..df050e005 100644 --- a/crates/bitwarden-api-api/src/apis/tax_api.rs +++ b/crates/bitwarden-api-api/src/apis/tax_api.rs @@ -21,6 +21,7 @@ pub enum TaxPreviewAmountOrganizationTrialPostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Billing/Controllers/TaxController.cs#L16`] pub async fn tax_preview_amount_organization_trial_post( configuration: &configuration::Configuration, preview_tax_amount_for_organization_trial_request_body: Option< diff --git a/crates/bitwarden-api-api/src/apis/trash_api.rs b/crates/bitwarden-api-api/src/apis/trash_api.rs index 88f1b8950..18b9e3341 100644 --- a/crates/bitwarden-api-api/src/apis/trash_api.rs +++ b/crates/bitwarden-api-api/src/apis/trash_api.rs @@ -35,6 +35,7 @@ pub enum SecretsOrganizationIdTrashRestorePostError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsTrashController.cs#L60`] pub async fn secrets_organization_id_trash_empty_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -80,6 +81,7 @@ pub async fn secrets_organization_id_trash_empty_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsTrashController.cs#L43`] pub async fn secrets_organization_id_trash_get( configuration: &configuration::Configuration, organization_id: uuid::Uuid, @@ -132,6 +134,7 @@ pub async fn secrets_organization_id_trash_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/SecretsManager/Controllers/SecretsTrashController.cs#L78`] pub async fn secrets_organization_id_trash_restore_post( configuration: &configuration::Configuration, organization_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/apis/two_factor_api.rs b/crates/bitwarden-api-api/src/apis/two_factor_api.rs index 3ef1e16fc..6ca77e27b 100644 --- a/crates/bitwarden-api-api/src/apis/two_factor_api.rs +++ b/crates/bitwarden-api-api/src/apis/two_factor_api.rs @@ -238,6 +238,7 @@ pub enum TwoFactorYubikeyPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L384`] pub async fn organizations_id_two_factor_disable_post( configuration: &configuration::Configuration, id: &str, @@ -295,6 +296,7 @@ pub async fn organizations_id_two_factor_disable_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L384`] pub async fn organizations_id_two_factor_disable_put( configuration: &configuration::Configuration, id: &str, @@ -350,6 +352,7 @@ pub async fn organizations_id_two_factor_disable_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L223`] pub async fn organizations_id_two_factor_duo_post( configuration: &configuration::Configuration, id: &str, @@ -406,6 +409,7 @@ pub async fn organizations_id_two_factor_duo_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L223`] pub async fn organizations_id_two_factor_duo_put( configuration: &configuration::Configuration, id: &str, @@ -460,6 +464,7 @@ pub async fn organizations_id_two_factor_duo_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L83`] pub async fn organizations_id_two_factor_get( configuration: &configuration::Configuration, id: &str, @@ -513,6 +518,7 @@ pub async fn organizations_id_two_factor_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L205`] pub async fn organizations_id_two_factor_get_duo_post( configuration: &configuration::Configuration, id: &str, @@ -569,6 +575,7 @@ pub async fn organizations_id_two_factor_get_duo_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L139`] pub async fn two_factor_authenticator_delete( configuration: &configuration::Configuration, two_factor_authenticator_disable_request_model: Option< @@ -621,6 +628,7 @@ pub async fn two_factor_authenticator_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L116`] pub async fn two_factor_authenticator_post( configuration: &configuration::Configuration, update_two_factor_authenticator_request_model: Option< @@ -673,6 +681,7 @@ pub async fn two_factor_authenticator_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L116`] pub async fn two_factor_authenticator_put( configuration: &configuration::Configuration, update_two_factor_authenticator_request_model: Option< @@ -723,6 +732,7 @@ pub async fn two_factor_authenticator_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L438`] pub async fn two_factor_device_verification_settings_put( configuration: &configuration::Configuration, device_verification_request_model: Option, @@ -777,6 +787,7 @@ pub async fn two_factor_device_verification_settings_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L373`] pub async fn two_factor_disable_post( configuration: &configuration::Configuration, two_factor_provider_request_model: Option, @@ -826,6 +837,7 @@ pub async fn two_factor_disable_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L373`] pub async fn two_factor_disable_put( configuration: &configuration::Configuration, two_factor_provider_request_model: Option, @@ -873,6 +885,7 @@ pub async fn two_factor_disable_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L188`] pub async fn two_factor_duo_post( configuration: &configuration::Configuration, update_two_factor_duo_request_model: Option, @@ -922,6 +935,7 @@ pub async fn two_factor_duo_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L188`] pub async fn two_factor_duo_put( configuration: &configuration::Configuration, update_two_factor_duo_request_model: Option, @@ -969,6 +983,7 @@ pub async fn two_factor_duo_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L354`] pub async fn two_factor_email_post( configuration: &configuration::Configuration, update_two_factor_email_request_model: Option, @@ -1018,6 +1033,7 @@ pub async fn two_factor_email_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L354`] pub async fn two_factor_email_put( configuration: &configuration::Configuration, update_two_factor_email_request_model: Option, @@ -1065,6 +1081,7 @@ pub async fn two_factor_email_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L69`] pub async fn two_factor_get( configuration: &configuration::Configuration, ) -> Result> { @@ -1107,6 +1124,7 @@ pub async fn two_factor_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L104`] pub async fn two_factor_get_authenticator_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1158,6 +1176,7 @@ pub async fn two_factor_get_authenticator_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L430`] pub async fn two_factor_get_device_verification_settings_get( configuration: &configuration::Configuration, ) -> Result< @@ -1207,6 +1226,7 @@ pub async fn two_factor_get_device_verification_settings_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L179`] pub async fn two_factor_get_duo_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1256,6 +1276,7 @@ pub async fn two_factor_get_duo_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L292`] pub async fn two_factor_get_email_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1305,6 +1326,7 @@ pub async fn two_factor_get_email_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L406`] pub async fn two_factor_get_recover_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1354,6 +1376,7 @@ pub async fn two_factor_get_recover_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L248`] pub async fn two_factor_get_webauthn_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1403,6 +1426,7 @@ pub async fn two_factor_get_webauthn_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L153`] pub async fn two_factor_get_yubikey_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -1452,6 +1476,7 @@ pub async fn two_factor_get_yubikey_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L419`] pub async fn two_factor_recover_post( configuration: &configuration::Configuration, two_factor_recovery_request_model: Option, @@ -1490,6 +1515,7 @@ pub async fn two_factor_recover_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L315`] pub async fn two_factor_send_email_login_post( configuration: &configuration::Configuration, two_factor_email_request_model: Option, @@ -1528,6 +1554,7 @@ pub async fn two_factor_send_email_login_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L305`] pub async fn two_factor_send_email_post( configuration: &configuration::Configuration, two_factor_email_request_model: Option, @@ -1566,6 +1593,7 @@ pub async fn two_factor_send_email_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L283`] pub async fn two_factor_webauthn_delete( configuration: &configuration::Configuration, two_factor_web_authn_delete_request_model: Option, @@ -1615,6 +1643,7 @@ pub async fn two_factor_webauthn_delete( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L266`] pub async fn two_factor_webauthn_post( configuration: &configuration::Configuration, two_factor_web_authn_request_model: Option, @@ -1664,6 +1693,7 @@ pub async fn two_factor_webauthn_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L266`] pub async fn two_factor_webauthn_put( configuration: &configuration::Configuration, two_factor_web_authn_request_model: Option, @@ -1711,6 +1741,7 @@ pub async fn two_factor_webauthn_put( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L162`] pub async fn two_factor_yubikey_post( configuration: &configuration::Configuration, update_two_factor_yubico_otp_request_model: Option< @@ -1762,6 +1793,7 @@ pub async fn two_factor_yubikey_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/TwoFactorController.cs#L162`] pub async fn two_factor_yubikey_put( configuration: &configuration::Configuration, update_two_factor_yubico_otp_request_model: Option< diff --git a/crates/bitwarden-api-api/src/apis/users_api.rs b/crates/bitwarden-api-api/src/apis/users_api.rs index 75893cfbd..4d23fdd35 100644 --- a/crates/bitwarden-api-api/src/apis/users_api.rs +++ b/crates/bitwarden-api-api/src/apis/users_api.rs @@ -21,6 +21,7 @@ pub enum UsersIdPublicKeyGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Controllers/UsersController.cs#L23`] pub async fn users_id_public_key_get( configuration: &configuration::Configuration, id: &str, diff --git a/crates/bitwarden-api-api/src/apis/web_authn_api.rs b/crates/bitwarden-api-api/src/apis/web_authn_api.rs index fc1d73054..1d017c927 100644 --- a/crates/bitwarden-api-api/src/apis/web_authn_api.rs +++ b/crates/bitwarden-api-api/src/apis/web_authn_api.rs @@ -56,6 +56,7 @@ pub enum WebauthnPutError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/WebAuthnController.cs#L92`] pub async fn webauthn_assertion_options_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -108,6 +109,7 @@ pub async fn webauthn_assertion_options_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/WebAuthnController.cs#L75`] pub async fn webauthn_attestation_options_post( configuration: &configuration::Configuration, secret_verification_request_model: Option, @@ -161,6 +163,7 @@ pub async fn webauthn_attestation_options_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/WebAuthnController.cs#L66`] pub async fn webauthn_get( configuration: &configuration::Configuration, ) -> Result> { @@ -203,6 +206,7 @@ pub async fn webauthn_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/WebAuthnController.cs#L176`] pub async fn webauthn_id_delete_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -247,6 +251,7 @@ pub async fn webauthn_id_delete_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/WebAuthnController.cs#L108`] pub async fn webauthn_post( configuration: &configuration::Configuration, web_authn_login_credential_create_request_model: Option< @@ -288,6 +293,7 @@ pub async fn webauthn_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Api/Auth/Controllers/WebAuthnController.cs#L153`] pub async fn webauthn_put( configuration: &configuration::Configuration, web_authn_login_credential_update_request_model: Option< diff --git a/crates/bitwarden-api-api/src/models/cipher.rs b/crates/bitwarden-api-api/src/models/cipher.rs index 77587dac6..8bdcdb0bd 100644 --- a/crates/bitwarden-api-api/src/models/cipher.rs +++ b/crates/bitwarden-api-api/src/models/cipher.rs @@ -40,8 +40,6 @@ pub struct Cipher { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, } impl Cipher { @@ -60,7 +58,6 @@ impl Cipher { deleted_date: None, reprompt: None, key: None, - version: None, } } } 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 9ea5350d2..deef04d50 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 @@ -59,8 +59,6 @@ pub struct CipherDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -99,7 +97,6 @@ impl CipherDetailsResponseModel { deleted_date: None, reprompt: None, key: None, - version: None, folder_id: None, favorite: None, edit: 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 9b8594be2..37d33da67 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 @@ -59,8 +59,6 @@ pub struct CipherMiniDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, #[serde(rename = "collectionIds", skip_serializing_if = "Option::is_none")] pub collection_ids: Option>, } @@ -89,7 +87,6 @@ impl CipherMiniDetailsResponseModel { deleted_date: None, reprompt: None, key: None, - version: None, collection_ids: None, } } 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 44d279c63..f4596cf22 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 @@ -59,8 +59,6 @@ pub struct CipherMiniResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, } impl CipherMiniResponseModel { @@ -87,7 +85,6 @@ impl CipherMiniResponseModel { deleted_date: None, reprompt: None, key: None, - version: 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 1bce90648..0ec07f033 100644 --- a/crates/bitwarden-api-api/src/models/cipher_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_request_model.rs @@ -51,17 +51,13 @@ pub struct CipherRequestModel { pub secure_note: Option>, #[serde(rename = "sshKey", skip_serializing_if = "Option::is_none")] pub ssh_key: Option>, - /// The version of the cipher data. Default is 1 for backward compatibility. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Opaque data for versioned clients. - #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option, #[serde( rename = "lastKnownRevisionDate", skip_serializing_if = "Option::is_none" )] pub last_known_revision_date: Option, + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option, } impl CipherRequestModel { @@ -85,9 +81,8 @@ impl CipherRequestModel { identity: None, secure_note: None, ssh_key: None, - version: None, - data: None, last_known_revision_date: None, + data: None, } } } 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 8d24f139c..4470969c8 100644 --- a/crates/bitwarden-api-api/src/models/cipher_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_response_model.rs @@ -59,8 +59,6 @@ pub struct CipherResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -97,7 +95,6 @@ impl CipherResponseModel { deleted_date: None, reprompt: None, key: None, - version: None, folder_id: None, favorite: None, edit: None, 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 c9b3b6de4..21a2533df 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 @@ -51,17 +51,13 @@ pub struct CipherWithIdRequestModel { pub secure_note: Option>, #[serde(rename = "sshKey", skip_serializing_if = "Option::is_none")] pub ssh_key: Option>, - /// The version of the cipher data. Default is 1 for backward compatibility. - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - /// Opaque data for versioned clients. - #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option, #[serde( rename = "lastKnownRevisionDate", skip_serializing_if = "Option::is_none" )] pub last_known_revision_date: Option, + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option, #[serde(rename = "id")] pub id: uuid::Uuid, } @@ -87,9 +83,8 @@ impl CipherWithIdRequestModel { identity: None, secure_note: None, ssh_key: None, - version: None, - data: None, last_known_revision_date: None, + data: None, id, } } diff --git a/crates/bitwarden-api-api/src/models/collection_request_model.rs b/crates/bitwarden-api-api/src/models/create_collection_request_model.rs similarity index 83% rename from crates/bitwarden-api-api/src/models/collection_request_model.rs rename to crates/bitwarden-api-api/src/models/create_collection_request_model.rs index 7217fd160..68cb7c4eb 100644 --- a/crates/bitwarden-api-api/src/models/collection_request_model.rs +++ b/crates/bitwarden-api-api/src/models/create_collection_request_model.rs @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CollectionRequestModel { +pub struct CreateCollectionRequestModel { #[serde(rename = "name")] pub name: String, #[serde(rename = "externalId", skip_serializing_if = "Option::is_none")] @@ -24,9 +24,9 @@ pub struct CollectionRequestModel { pub users: Option>, } -impl CollectionRequestModel { - pub fn new(name: String) -> CollectionRequestModel { - CollectionRequestModel { +impl CreateCollectionRequestModel { + pub fn new(name: String) -> CreateCollectionRequestModel { + CreateCollectionRequestModel { name, external_id: None, groups: None, 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 487e0f30f..a8f1e7903 100644 --- a/crates/bitwarden-api-api/src/models/event_response_model.rs +++ b/crates/bitwarden-api-api/src/models/event_response_model.rs @@ -57,6 +57,8 @@ pub struct EventResponseModel { pub domain_name: Option, #[serde(rename = "secretId", skip_serializing_if = "Option::is_none")] pub secret_id: Option, + #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")] + pub project_id: Option, #[serde(rename = "serviceAccountId", skip_serializing_if = "Option::is_none")] pub service_account_id: Option, } @@ -84,6 +86,7 @@ impl EventResponseModel { system_user: None, domain_name: None, secret_id: None, + project_id: None, service_account_id: None, } } diff --git a/crates/bitwarden-api-api/src/models/event_type.rs b/crates/bitwarden-api-api/src/models/event_type.rs index 29cce16a4..6c04e71ed 100644 --- a/crates/bitwarden-api-api/src/models/event_type.rs +++ b/crates/bitwarden-api-api/src/models/event_type.rs @@ -98,6 +98,12 @@ pub enum EventType { Secret_Created = 2101, Secret_Edited = 2102, Secret_Deleted = 2103, + Secret_Permanently_Deleted = 2104, + Secret_Restored = 2105, + Project_Retrieved = 2200, + Project_Created = 2201, + Project_Edited = 2202, + Project_Deleted = 2203, } impl std::fmt::Display for EventType { @@ -186,6 +192,12 @@ impl std::fmt::Display for EventType { Self::Secret_Created => "2101", Self::Secret_Edited => "2102", Self::Secret_Deleted => "2103", + Self::Secret_Permanently_Deleted => "2104", + Self::Secret_Restored => "2105", + Self::Project_Retrieved => "2200", + Self::Project_Created => "2201", + Self::Project_Edited => "2202", + Self::Project_Deleted => "2203", } ) } diff --git a/crates/bitwarden-api-api/src/models/mod.rs b/crates/bitwarden-api-api/src/models/mod.rs index 0529112f4..4e1f81d56 100644 --- a/crates/bitwarden-api-api/src/models/mod.rs +++ b/crates/bitwarden-api-api/src/models/mod.rs @@ -174,8 +174,6 @@ pub mod collection_details_response_model; pub use self::collection_details_response_model::CollectionDetailsResponseModel; pub mod collection_details_response_model_list_response_model; pub use self::collection_details_response_model_list_response_model::CollectionDetailsResponseModelListResponseModel; -pub mod collection_request_model; -pub use self::collection_request_model::CollectionRequestModel; pub mod collection_response_model; pub use self::collection_response_model::CollectionResponseModel; pub mod collection_response_model_list_response_model; @@ -188,6 +186,8 @@ pub mod config_response_model; pub use self::config_response_model::ConfigResponseModel; pub mod create_client_organization_request_body; pub use self::create_client_organization_request_body::CreateClientOrganizationRequestBody; +pub mod create_collection_request_model; +pub use self::create_collection_request_model::CreateCollectionRequestModel; pub mod credential_create_options; pub use self::credential_create_options::CredentialCreateOptions; pub mod delete_attachment_response_data; @@ -728,6 +728,8 @@ pub mod secure_note_type; pub use self::secure_note_type::SecureNoteType; pub mod security_task_create_request; pub use self::security_task_create_request::SecurityTaskCreateRequest; +pub mod security_task_metrics_response_model; +pub use self::security_task_metrics_response_model::SecurityTaskMetricsResponseModel; pub mod security_task_status; pub use self::security_task_status::SecurityTaskStatus; pub mod security_task_type; @@ -870,6 +872,8 @@ pub mod update_avatar_request_model; pub use self::update_avatar_request_model::UpdateAvatarRequestModel; pub mod update_client_organization_request_body; pub use self::update_client_organization_request_body::UpdateClientOrganizationRequestBody; +pub mod update_collection_request_model; +pub use self::update_collection_request_model::UpdateCollectionRequestModel; pub mod update_devices_trust_request_model; pub use self::update_devices_trust_request_model::UpdateDevicesTrustRequestModel; pub mod update_domains_request_model; 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 7b0383cb8..c39a877f7 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 @@ -16,12 +16,20 @@ use crate::models; pub struct OrganizationUserBulkConfirmRequestModel { #[serde(rename = "keys")] pub keys: Vec, + #[serde( + rename = "defaultUserCollectionName", + skip_serializing_if = "Option::is_none" + )] + pub default_user_collection_name: Option, } impl OrganizationUserBulkConfirmRequestModel { pub fn new( keys: Vec, ) -> OrganizationUserBulkConfirmRequestModel { - OrganizationUserBulkConfirmRequestModel { keys } + OrganizationUserBulkConfirmRequestModel { + keys, + default_user_collection_name: None, + } } } diff --git a/crates/bitwarden-api-api/src/models/security_task_metrics_response_model.rs b/crates/bitwarden-api-api/src/models/security_task_metrics_response_model.rs new file mode 100644 index 000000000..1081cc485 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/security_task_metrics_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 + */ + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityTaskMetricsResponseModel { + /// Number of tasks that have been completed in the organization. + #[serde(rename = "completedTasks", skip_serializing_if = "Option::is_none")] + pub completed_tasks: Option, + /// Total number of tasks in the organization, regardless of their status. + #[serde(rename = "totalTasks", skip_serializing_if = "Option::is_none")] + pub total_tasks: Option, +} + +impl SecurityTaskMetricsResponseModel { + pub fn new() -> SecurityTaskMetricsResponseModel { + SecurityTaskMetricsResponseModel { + completed_tasks: None, + total_tasks: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/update_collection_request_model.rs b/crates/bitwarden-api-api/src/models/update_collection_request_model.rs new file mode 100644 index 000000000..06bb2bafa --- /dev/null +++ b/crates/bitwarden-api-api/src/models/update_collection_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 + */ + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateCollectionRequestModel { + #[serde(rename = "externalId", skip_serializing_if = "Option::is_none")] + pub external_id: 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>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl UpdateCollectionRequestModel { + pub fn new() -> UpdateCollectionRequestModel { + UpdateCollectionRequestModel { + external_id: None, + groups: None, + users: None, + name: None, + } + } +} diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index bdbcb8eaa..ec616cec1 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -12,10 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" serde_repr = "^0.1" -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } diff --git a/crates/bitwarden-api-identity/README.md b/crates/bitwarden-api-identity/README.md index 838deefae..5e082ceaa 100644 --- a/crates/bitwarden-api-identity/README.md +++ b/crates/bitwarden-api-identity/README.md @@ -25,7 +25,7 @@ bitwarden-api-identity = { path = "./bitwarden-api-identity" } ## Documentation for API Endpoints -All URIs are relative to _http://localhost_ +All URIs are relative to *https://identity.bitwarden.com* | Class | Method | HTTP request | Description | | ------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | ----------- | diff --git a/crates/bitwarden-api-identity/src/apis/accounts_api.rs b/crates/bitwarden-api-identity/src/apis/accounts_api.rs index 3618c3d58..5d47bcbcf 100644 --- a/crates/bitwarden-api-identity/src/apis/accounts_api.rs +++ b/crates/bitwarden-api-identity/src/apis/accounts_api.rs @@ -56,6 +56,7 @@ pub enum AccountsWebauthnAssertionOptionsGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/AccountsController.cs#L201`] pub async fn accounts_prelogin_post( configuration: &configuration::Configuration, prelogin_request_model: Option, @@ -102,6 +103,7 @@ pub async fn accounts_prelogin_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/AccountsController.cs#L143`] pub async fn accounts_register_finish_post( configuration: &configuration::Configuration, register_finish_request_model: Option, @@ -148,6 +150,7 @@ pub async fn accounts_register_finish_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/AccountsController.cs#L111`] pub async fn accounts_register_send_verification_email_post( configuration: &configuration::Configuration, register_send_verification_email_request_model: Option< @@ -190,6 +193,7 @@ pub async fn accounts_register_send_verification_email_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/AccountsController.cs#L125`] pub async fn accounts_register_verification_email_clicked_post( configuration: &configuration::Configuration, register_verification_email_clicked_request_model: Option< @@ -232,6 +236,7 @@ pub async fn accounts_register_verification_email_clicked_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Billing/Controller/AccountsController.cs#L20`] pub async fn accounts_trial_send_verification_email_post( configuration: &configuration::Configuration, trial_send_verification_email_request_model: Option< @@ -273,6 +278,7 @@ pub async fn accounts_trial_send_verification_email_post( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/AccountsController.cs#L212`] pub async fn accounts_webauthn_assertion_options_get( configuration: &configuration::Configuration, ) -> Result< diff --git a/crates/bitwarden-api-identity/src/apis/configuration.rs b/crates/bitwarden-api-identity/src/apis/configuration.rs index 96c5cca2a..e8270e9fc 100644 --- a/crates/bitwarden-api-identity/src/apis/configuration.rs +++ b/crates/bitwarden-api-identity/src/apis/configuration.rs @@ -36,7 +36,7 @@ impl Configuration { impl Default for Configuration { fn default() -> Self { Configuration { - base_path: "http://localhost".to_owned(), + base_path: "https://identity.bitwarden.com".to_owned(), user_agent: Some("OpenAPI-Generator/v1/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, diff --git a/crates/bitwarden-api-identity/src/apis/info_api.rs b/crates/bitwarden-api-identity/src/apis/info_api.rs index 503c7145a..983c87a8b 100644 --- a/crates/bitwarden-api-identity/src/apis/info_api.rs +++ b/crates/bitwarden-api-identity/src/apis/info_api.rs @@ -35,6 +35,7 @@ pub enum VersionGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/InfoController.cs#L11`] pub async fn alive_get( configuration: &configuration::Configuration, ) -> Result> { @@ -74,6 +75,7 @@ pub async fn alive_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/InfoController.cs#L11`] pub async fn now_get( configuration: &configuration::Configuration, ) -> Result> { @@ -113,6 +115,7 @@ pub async fn now_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/InfoController.cs#L17`] pub async fn version_get( configuration: &configuration::Configuration, ) -> Result<(), Error> { diff --git a/crates/bitwarden-api-identity/src/apis/sso_api.rs b/crates/bitwarden-api-identity/src/apis/sso_api.rs index 31030869b..07802760b 100644 --- a/crates/bitwarden-api-identity/src/apis/sso_api.rs +++ b/crates/bitwarden-api-identity/src/apis/sso_api.rs @@ -42,6 +42,7 @@ pub enum SsoPreValidateGetError { UnknownValue(serde_json::Value), } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/SsoController.cs#L147`] pub async fn sso_external_callback_get( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -70,6 +71,7 @@ pub async fn sso_external_callback_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/SsoController.cs#L107`] pub async fn sso_external_challenge_get( configuration: &configuration::Configuration, domain_hint: Option<&str>, @@ -120,6 +122,7 @@ pub async fn sso_external_challenge_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/SsoController.cs#L80`] pub async fn sso_login_get( configuration: &configuration::Configuration, return_url: Option<&str>, @@ -155,6 +158,7 @@ pub async fn sso_login_get( } } +/// This operation is defined on: [`https://github.com/bitwarden/server/blob/22420f595f2f50dd2fc0061743841285258aed22/src/Identity/Controllers/SsoController.cs#L45`] pub async fn sso_pre_validate_get( configuration: &configuration::Configuration, domain_hint: Option<&str>, diff --git a/crates/bitwarden-exporters/src/lib.rs b/crates/bitwarden-exporters/src/lib.rs index 07cd908d8..d23a66105 100644 --- a/crates/bitwarden-exporters/src/lib.rs +++ b/crates/bitwarden-exporters/src/lib.rs @@ -147,7 +147,7 @@ impl From for CipherView { creation_date: value.creation_date, deleted_date: None, revision_date: value.revision_date, - version: None, + // version: None, } } } diff --git a/crates/bitwarden-exporters/src/models.rs b/crates/bitwarden-exporters/src/models.rs index f7fe4842f..7647b330e 100644 --- a/crates/bitwarden-exporters/src/models.rs +++ b/crates/bitwarden-exporters/src/models.rs @@ -261,7 +261,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - version: None, + // version: None, }; let login = from_login(&view, &key_store).unwrap(); @@ -313,7 +313,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - version: None, + // version: None, }; let encrypted = key_store.encrypt(cipher_view).unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index dd7a0efe1..357666ab3 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -286,7 +286,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), - version: None, + // version: None, data: None, }, attachment, @@ -342,7 +342,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), - version: None, + // version: None, data: None, }; @@ -402,7 +402,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), - version: None, + // version: None, data: None, }; diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index 9e5855e91..db8bcdc47 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -146,7 +146,7 @@ pub struct Cipher { pub deleted_date: Option>, pub revision_date: DateTime, - pub version: Option, + // pub version: Option, pub data: Option, } @@ -191,8 +191,7 @@ pub struct CipherView { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, - - pub version: Option, + // pub version: Option, } #[allow(missing_docs)] @@ -347,7 +346,7 @@ impl CompositeEncryptable for CipherView { deleted_date: cipher_view.deleted_date, revision_date: cipher_view.revision_date, permissions: cipher_view.permissions, - version: cipher_view.version, + // version: cipher_view.version, data: None, }) } @@ -392,7 +391,7 @@ impl Decryptable for Cipher { creation_date: self.creation_date, deleted_date: self.deleted_date, revision_date: self.revision_date, - version: self.version, + // version: self.version, }; // For compatibility we only remove URLs with invalid checksums if the cipher has a key @@ -774,7 +773,7 @@ impl TryFrom for Cipher { deleted_date: cipher.deleted_date.map(|d| d.parse()).transpose()?, revision_date: require!(cipher.revision_date).parse()?, key: EncString::try_from_optional(cipher.key)?, - version: cipher.version.map(|v| v as u32), + // version: cipher.version.map(|v| v as u32), data: cipher.data, }) } @@ -850,7 +849,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - version: None, + // version: None, } } @@ -915,7 +914,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - version: None, + // version: None, data: None, }; diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 78411f0d7..411bee198 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -181,20 +181,22 @@ impl CiphersClient { let mut migrated_responses = Vec::new(); for mut cipher in ciphers { - let response_version = cipher.version.unwrap_or(1); - - if response_version < CURRENT_CIPHER_VERSION { - let key_store = self.client.internal.get_key_store(); - let mut ctx = key_store.context(); - let key = cipher.key_identifier(); - - let cipher_key = Cipher::decrypt_cipher_key(&mut ctx, key, &cipher.key) - .map_err(CipherError::CryptoError)?; - - if let Some(data_str) = &mut cipher.data { - let mut data_json: serde_json::Value = serde_json::from_str(data_str) - .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; - + let key = cipher.key_identifier(); + let key_store = self.client.internal.get_key_store(); + let mut ctx = key_store.context(); + let cipher_key = Cipher::decrypt_cipher_key(&mut ctx, key, &cipher.key) + .map_err(CipherError::CryptoError)?; + + if let Some(data_str) = &mut cipher.data { + let mut data_json: serde_json::Value = serde_json::from_str(data_str) + .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; + + let response_version = data_json + .get("version") + .and_then(|v| v.as_u64()) + .unwrap_or(1) as u32; + + if response_version < CURRENT_CIPHER_VERSION { registry.migrate( &mut data_json, response_version, @@ -203,11 +205,11 @@ impl CiphersClient { Some(cipher_key), )?; + data_json["version"] = serde_json::json!(CURRENT_CIPHER_VERSION); + *data_str = serde_json::to_string(&data_json) .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; } - - cipher.version = Some(CURRENT_CIPHER_VERSION); } migrated_responses.push(cipher); @@ -262,7 +264,7 @@ mod tests { creation_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), - version: None, + // version: None, data: None, } } @@ -304,7 +306,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - version: None, + // version: None, } } @@ -332,13 +334,13 @@ mod tests { fn test_cipher_v1() -> Cipher { let mut cipher = test_cipher(); - cipher.version = Some(1); cipher.data = Some( serde_json::to_string(&serde_json::json!({ "Username": "2.PE7g9afvjh9N57ORdUlCDQ==|d8C4kLo0CYAKfa9Gjp4mqg==|YmgGDxGWXtIzW+TJsjDW3CoS0k+U4NZSAwygzq6zV/0=", "Password": "2.sGpXvg4a6BPFOPN3ePxZaQ==|ChseXEroqhbB11sBk+hH4Q==|SVz2WMGDvZSJwTivSnCFCCfQmmnuiHHPEgw4gzr09pQ=", "Uris": [], - "Totp": null + "Totp": null, + "version": 1 })) .unwrap() ); @@ -347,14 +349,14 @@ mod tests { fn test_cipher_v2() -> Cipher { let mut cipher = test_cipher(); - cipher.version = Some(CURRENT_CIPHER_VERSION); cipher.data = Some( serde_json::to_string(&serde_json::json!({ "Username": "2.PE7g9afvjh9N57ORdUlCDQ==|d8C4kLo0CYAKfa9Gjp4mqg==|YmgGDxGWXtIzW+TJsjDW3CoS0k+U4NZSAwygzq6zV/0=", "Password": "2.sGpXvg4a6BPFOPN3ePxZaQ==|ChseXEroqhbB11sBk+hH4Q==|SVz2WMGDvZSJwTivSnCFCCfQmmnuiHHPEgw4gzr09pQ=", "Uris": [], "Totp": null, - "SecurityQuestions": [] + "SecurityQuestions": [], + "version": CURRENT_CIPHER_VERSION })) .unwrap() ); @@ -398,7 +400,7 @@ mod tests { creation_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), - version: None, + // version: None, data: None, }]) @@ -624,18 +626,25 @@ mod tests { // Test first cipher (v1 should be migrated to v2) let first_cipher = &migrated[0]; - assert_eq!(first_cipher.version, Some(CURRENT_CIPHER_VERSION)); if let Some(data_str) = &first_cipher.data { let data: serde_json::Value = serde_json::from_str(data_str).unwrap(); + // Version should be updated inside the JSON + assert_eq!( + data.get("version").and_then(|v| v.as_u64()), + Some(CURRENT_CIPHER_VERSION as u64) + ); assert!(data.get("SecurityQuestions").is_some()); assert_eq!(data["SecurityQuestions"], serde_json::Value::Array(vec![])); } // Test second cipher (v2 should remain unchanged) let second_cipher = &migrated[1]; - assert_eq!(second_cipher.version, Some(CURRENT_CIPHER_VERSION)); if let Some(data_str) = &second_cipher.data { let data: serde_json::Value = serde_json::from_str(data_str).unwrap(); + assert_eq!( + data.get("version").and_then(|v| v.as_u64()), + Some(CURRENT_CIPHER_VERSION as u64) + ); assert!(data.get("SecurityQuestions").is_some()); } } diff --git a/crates/bitwarden-vault/src/cipher/secure_note.rs b/crates/bitwarden-vault/src/cipher/secure_note.rs index 3d034ac25..f2a1c7e74 100644 --- a/crates/bitwarden-vault/src/cipher/secure_note.rs +++ b/crates/bitwarden-vault/src/cipher/secure_note.rs @@ -139,7 +139,7 @@ mod tests { creation_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), - version: None, + // version: None, data: None, } } From c3623a87db3856ee71f36a40725c992d608e3966 Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Mon, 8 Sep 2025 16:55:40 -0700 Subject: [PATCH 06/17] Add data field to Cipher, and basic json deserialization in CiphersClient::migrate --- .../bitwarden-vault/src/cipher/attachment.rs | 1 - crates/bitwarden-vault/src/cipher/cipher.rs | 7 ++++++- .../src/cipher/cipher_client.rs | 20 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index 357666ab3..680c24885 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -342,7 +342,6 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), - // version: None, data: None, }; diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index db8bcdc47..22266deff 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -115,7 +115,6 @@ pub struct Cipher { pub organization_id: Option, pub folder_id: Option, pub collection_ids: Vec, - /// More recent ciphers uses individual encryption keys to encrypt the other fields of the /// Cipher. pub key: Option, @@ -800,6 +799,12 @@ impl From for CipherRepromptType } } +// impl From<&Cipher> for Option { +// fn from(value: &Cipher) -> Self { + +// } +// } + #[cfg(test)] mod tests { diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 411bee198..3242f0ad9 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -153,6 +153,26 @@ impl CiphersClient { Ok(cipher_view) } + #[allow(missing_docs)] + pub fn migrate(&self, mut cipher: Cipher) -> Cipher { + let Ok(data) = serde_json::to_value(&cipher.data) else { + // If we can't deserialize the data, then we'll return the cipher as-is. + return cipher; + }; + let version = data.get("version").and_then(|v| v.as_u64()); + + // TODO: Matching on version here - for now, just matching some types. + match cipher.r#type { + crate::CipherType::Login => cipher.login = serde_json::from_value(data).ok(), + crate::CipherType::SecureNote => cipher.secure_note = serde_json::from_value(data).ok(), + crate::CipherType::Card => cipher.card = serde_json::from_value(data).ok(), + crate::CipherType::Identity => cipher.identity = serde_json::from_value(data).ok(), + crate::CipherType::SshKey => cipher.ssh_key = serde_json::from_value(data).ok(), + } + + cipher + } + #[allow(missing_docs)] pub fn move_to_organization( &self, From f75a9cb00981c25771b1d92c70bef91bd18edaea Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Tue, 9 Sep 2025 16:58:58 -0700 Subject: [PATCH 07/17] Consume exisiting migrate function, with ciphertype extractions --- .../src/cipher/cipher_client.rs | 113 ++++++++++-------- 1 file changed, 63 insertions(+), 50 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 3242f0ad9..bfb1d58cd 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -153,25 +153,6 @@ impl CiphersClient { Ok(cipher_view) } - #[allow(missing_docs)] - pub fn migrate(&self, mut cipher: Cipher) -> Cipher { - let Ok(data) = serde_json::to_value(&cipher.data) else { - // If we can't deserialize the data, then we'll return the cipher as-is. - return cipher; - }; - let version = data.get("version").and_then(|v| v.as_u64()); - - // TODO: Matching on version here - for now, just matching some types. - match cipher.r#type { - crate::CipherType::Login => cipher.login = serde_json::from_value(data).ok(), - crate::CipherType::SecureNote => cipher.secure_note = serde_json::from_value(data).ok(), - crate::CipherType::Card => cipher.card = serde_json::from_value(data).ok(), - crate::CipherType::Identity => cipher.identity = serde_json::from_value(data).ok(), - crate::CipherType::SshKey => cipher.ssh_key = serde_json::from_value(data).ok(), - } - - cipher - } #[allow(missing_docs)] pub fn move_to_organization( @@ -195,42 +176,74 @@ impl CiphersClient { Ok(decrypted_key) } + #[allow(missing_docs)] + fn extract_cipher_types(&self, mut cipher: Cipher) -> Cipher { + let Ok(mut data) = serde_json::to_value(&cipher.data) else { + // If we can't deserialize the data, then we'll return the cipher as-is. + // Should maybe return a result instead? + return cipher; + }; + let _version = data.get("version").and_then(|v| v.as_u64()).unwrap_or(1); + if let Some(data) = data.as_object_mut() { + data.insert("version".to_string(), _version.into()); + } + + + // TODO: Matching on version here - for now, just matching some types. + match cipher.r#type { + crate::CipherType::Login => cipher.login = serde_json::from_value(data).ok(), + crate::CipherType::SecureNote => cipher.secure_note = serde_json::from_value(data).ok(), + crate::CipherType::Card => cipher.card = serde_json::from_value(data).ok(), + crate::CipherType::Identity => cipher.identity = serde_json::from_value(data).ok(), + crate::CipherType::SshKey => cipher.ssh_key = serde_json::from_value(data).ok(), + } + + + cipher + } + #[allow(missing_docs)] pub fn migrate(&self, ciphers: Vec) -> Result, CipherError> { - let registry = MigrationRegistry::new(); + // let registry = MigrationRegistry::new(); let mut migrated_responses = Vec::new(); for mut cipher in ciphers { - let key = cipher.key_identifier(); - let key_store = self.client.internal.get_key_store(); - let mut ctx = key_store.context(); - let cipher_key = Cipher::decrypt_cipher_key(&mut ctx, key, &cipher.key) - .map_err(CipherError::CryptoError)?; - - if let Some(data_str) = &mut cipher.data { - let mut data_json: serde_json::Value = serde_json::from_str(data_str) - .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; - - let response_version = data_json - .get("version") - .and_then(|v| v.as_u64()) - .unwrap_or(1) as u32; - - if response_version < CURRENT_CIPHER_VERSION { - registry.migrate( - &mut data_json, - response_version, - CURRENT_CIPHER_VERSION, - Some(&mut ctx), - Some(cipher_key), - )?; - - data_json["version"] = serde_json::json!(CURRENT_CIPHER_VERSION); - - *data_str = serde_json::to_string(&data_json) - .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; - } - } + + let cipher = self.extract_cipher_types(cipher); + // self.extract_cipher_types(&mut cipher); + // let key = cipher.key_identifier(); + // let key_store = self.client.internal.get_key_store(); + // let mut ctx = key_store.context(); + // let cipher_key = Cipher::decrypt_cipher_key(&mut ctx, key, &cipher.key) + // .map_err(CipherError::CryptoError)?; + + // if let Some(data_str) = &mut cipher.data { + // let mut data_json: serde_json::Value = serde_json::from_str(data_str) + // .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; + + // let response_version = data_json + // .get("version") + // .and_then(|v| v.as_u64()) + // .unwrap_or(1) as u32; + + + + + // if response_version < CURRENT_CIPHER_VERSION { + // registry.migrate( + // &mut data_json, + // response_version, + // CURRENT_CIPHER_VERSION, + // Some(&mut ctx), + // Some(cipher_key), + // )?; + + // data_json["version"] = serde_json::json!(CURRENT_CIPHER_VERSION); + + // *data_str = serde_json::to_string(&data_json) + // .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; + // } + // } migrated_responses.push(cipher); } From 6d54fec83e93044a420b19bff0123cd5df37c41f Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Wed, 10 Sep 2025 16:57:30 -0700 Subject: [PATCH 08/17] Move extract_cipher_types to be a function on Cipher --- crates/bitwarden-vault/src/cipher/cipher.rs | 29 +++++++++++++ .../src/cipher/cipher_client.rs | 43 ++----------------- 2 files changed, 33 insertions(+), 39 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index 22266deff..e69d2ccb4 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -454,6 +454,35 @@ impl Cipher { .map(|kind| kind.get_copyable_fields(Some(self))) .unwrap_or_default() } + + + /// Extracts and sets the CipherType-specific fields from the opaque `data` field. + pub(crate) fn populate_cipher_types(&mut self) { + let Ok(mut data) = serde_json::to_value(&self.data) else { + // If we can't deserialize the data, then we'll return the cipher as-is. + // Should maybe return a result instead? + return; + }; + let _version = data.get("version").and_then(|v| v.as_u64()).unwrap_or(1); + if let Some(data) = data.as_object_mut() { + data.insert("version".to_string(), _version.into()); + data.insert("username".to_string(), serde_json::json!("2.uXRs3AGTuyJc7DhIDjw1ig==|A8wYld5QW+TxBEDM/lvWdA==|/zcjqwTtPnbQ1Pyr0r1Y5u3JSHUc2fE3c5OdDrVbBXc=")); + } + + + // TODO: Matching on version here - for now, just matching some types. + match &self.r#type { + crate::CipherType::Login => self.login = { + let mut login = serde_json::from_value(data).ok(); + login.as_mut().map(|l:&mut Login|l.username="".parse().ok()); // HArdocidng for test + login + }, + crate::CipherType::SecureNote => self.secure_note = serde_json::from_value(data).ok(), + crate::CipherType::Card => self.card = serde_json::from_value(data).ok(), + crate::CipherType::Identity => self.identity = serde_json::from_value(data).ok(), + crate::CipherType::SshKey => self.ssh_key = serde_json::from_value(data).ok(), + } + } } impl CipherView { diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index bfb1d58cd..44254ed8e 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -177,40 +177,11 @@ impl CiphersClient { } #[allow(missing_docs)] - fn extract_cipher_types(&self, mut cipher: Cipher) -> Cipher { - let Ok(mut data) = serde_json::to_value(&cipher.data) else { - // If we can't deserialize the data, then we'll return the cipher as-is. - // Should maybe return a result instead? - return cipher; - }; - let _version = data.get("version").and_then(|v| v.as_u64()).unwrap_or(1); - if let Some(data) = data.as_object_mut() { - data.insert("version".to_string(), _version.into()); - } - - - // TODO: Matching on version here - for now, just matching some types. - match cipher.r#type { - crate::CipherType::Login => cipher.login = serde_json::from_value(data).ok(), - crate::CipherType::SecureNote => cipher.secure_note = serde_json::from_value(data).ok(), - crate::CipherType::Card => cipher.card = serde_json::from_value(data).ok(), - crate::CipherType::Identity => cipher.identity = serde_json::from_value(data).ok(), - crate::CipherType::SshKey => cipher.ssh_key = serde_json::from_value(data).ok(), - } - - - cipher - } - - #[allow(missing_docs)] - pub fn migrate(&self, ciphers: Vec) -> Result, CipherError> { + pub fn migrate(&self, mut ciphers: Vec) -> Result, CipherError> { // let registry = MigrationRegistry::new(); - let mut migrated_responses = Vec::new(); - - for mut cipher in ciphers { + for cipher in &mut ciphers { + cipher.populate_cipher_types(); - let cipher = self.extract_cipher_types(cipher); - // self.extract_cipher_types(&mut cipher); // let key = cipher.key_identifier(); // let key_store = self.client.internal.get_key_store(); // let mut ctx = key_store.context(); @@ -226,9 +197,6 @@ impl CiphersClient { // .and_then(|v| v.as_u64()) // .unwrap_or(1) as u32; - - - // if response_version < CURRENT_CIPHER_VERSION { // registry.migrate( // &mut data_json, @@ -244,11 +212,9 @@ impl CiphersClient { // .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; // } // } - - migrated_responses.push(cipher); } - Ok(migrated_responses) + Ok(ciphers) } } @@ -433,7 +399,6 @@ mod tests { creation_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), - // version: None, data: None, }]) From cd0a1908d57f9bdb485d2b178e63ca5892d7c1b5 Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Thu, 11 Sep 2025 17:43:42 -0700 Subject: [PATCH 09/17] Extract cipher types for cipher.rs --- crates/bitwarden-vault/src/cipher/card.rs | 2 +- crates/bitwarden-vault/src/cipher/cipher.rs | 24 ++++++------------- crates/bitwarden-vault/src/cipher/identity.rs | 2 +- crates/bitwarden-vault/src/cipher/login.rs | 2 +- .../bitwarden-vault/src/cipher/secure_note.rs | 2 +- crates/bitwarden-vault/src/cipher/ssh_key.rs | 2 +- 6 files changed, 12 insertions(+), 22 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/card.rs b/crates/bitwarden-vault/src/cipher/card.rs index 4b622a80f..5c70cb15a 100644 --- a/crates/bitwarden-vault/src/cipher/card.rs +++ b/crates/bitwarden-vault/src/cipher/card.rs @@ -12,7 +12,7 @@ use super::cipher::CipherKind; use crate::{cipher::cipher::CopyableCipherFields, Cipher, VaultParseError}; #[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] #[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct Card { diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index e69d2ccb4..be6b862f2 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -4,8 +4,8 @@ use bitwarden_core::{ require, MissingFieldError, VaultLockedError, }; use bitwarden_crypto::{ - CompositeEncryptable, CryptoError, Decryptable, EncString, IdentifyKey, KeyStoreContext, - PrimitiveEncryptable, + CompositeEncryptable, CryptoError, Decryptable, EncString, IdentifyKey, + KeyStoreContext, PrimitiveEncryptable, }; use bitwarden_error::bitwarden_error; use chrono::{DateTime, Utc}; @@ -455,28 +455,18 @@ impl Cipher { .unwrap_or_default() } - /// Extracts and sets the CipherType-specific fields from the opaque `data` field. - pub(crate) fn populate_cipher_types(&mut self) { - let Ok(mut data) = serde_json::to_value(&self.data) else { + pub(crate) fn populate_cipher_types(&mut self) { + let Ok(data) = + serde_json::from_str::(&self.data.as_deref().unwrap_or("{}")) + else { // If we can't deserialize the data, then we'll return the cipher as-is. // Should maybe return a result instead? return; }; - let _version = data.get("version").and_then(|v| v.as_u64()).unwrap_or(1); - if let Some(data) = data.as_object_mut() { - data.insert("version".to_string(), _version.into()); - data.insert("username".to_string(), serde_json::json!("2.uXRs3AGTuyJc7DhIDjw1ig==|A8wYld5QW+TxBEDM/lvWdA==|/zcjqwTtPnbQ1Pyr0r1Y5u3JSHUc2fE3c5OdDrVbBXc=")); - } - - // TODO: Matching on version here - for now, just matching some types. match &self.r#type { - crate::CipherType::Login => self.login = { - let mut login = serde_json::from_value(data).ok(); - login.as_mut().map(|l:&mut Login|l.username="".parse().ok()); // HArdocidng for test - login - }, + crate::CipherType::Login => self.login = serde_json::from_value(data).ok(), crate::CipherType::SecureNote => self.secure_note = serde_json::from_value(data).ok(), crate::CipherType::Card => self.card = serde_json::from_value(data).ok(), crate::CipherType::Identity => self.identity = serde_json::from_value(data).ok(), diff --git a/crates/bitwarden-vault/src/cipher/identity.rs b/crates/bitwarden-vault/src/cipher/identity.rs index 1484b3f44..7e93276c7 100644 --- a/crates/bitwarden-vault/src/cipher/identity.rs +++ b/crates/bitwarden-vault/src/cipher/identity.rs @@ -12,7 +12,7 @@ use super::cipher::CipherKind; use crate::{cipher::cipher::CopyableCipherFields, Cipher, VaultParseError}; #[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] #[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct Identity { diff --git a/crates/bitwarden-vault/src/cipher/login.rs b/crates/bitwarden-vault/src/cipher/login.rs index 5e6d952ea..6140b8a91 100644 --- a/crates/bitwarden-vault/src/cipher/login.rs +++ b/crates/bitwarden-vault/src/cipher/login.rs @@ -279,7 +279,7 @@ impl Decryptable for Fido2Crede #[allow(missing_docs)] #[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] #[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct Login { diff --git a/crates/bitwarden-vault/src/cipher/secure_note.rs b/crates/bitwarden-vault/src/cipher/secure_note.rs index f2a1c7e74..0439fd373 100644 --- a/crates/bitwarden-vault/src/cipher/secure_note.rs +++ b/crates/bitwarden-vault/src/cipher/secure_note.rs @@ -26,7 +26,7 @@ pub enum SecureNoteType { } #[derive(Clone, Serialize, Deserialize, Debug)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] #[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct SecureNote { diff --git a/crates/bitwarden-vault/src/cipher/ssh_key.rs b/crates/bitwarden-vault/src/cipher/ssh_key.rs index 137edca43..a4c5c61c5 100644 --- a/crates/bitwarden-vault/src/cipher/ssh_key.rs +++ b/crates/bitwarden-vault/src/cipher/ssh_key.rs @@ -11,7 +11,7 @@ use super::cipher::CipherKind; use crate::{cipher::cipher::CopyableCipherFields, Cipher}; #[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] #[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct SshKey { From 86425e8f43b1cd56db5867c6219abc635e4d02aa Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Fri, 12 Sep 2025 12:10:53 -0700 Subject: [PATCH 10/17] Add tests for populate_cipher_types --- crates/bitwarden-vault/src/cipher/cipher.rs | 305 +++++++++++++++++++- 1 file changed, 302 insertions(+), 3 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index be6b862f2..f8ed66f34 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -4,8 +4,8 @@ use bitwarden_core::{ require, MissingFieldError, VaultLockedError, }; use bitwarden_crypto::{ - CompositeEncryptable, CryptoError, Decryptable, EncString, IdentifyKey, - KeyStoreContext, PrimitiveEncryptable, + CompositeEncryptable, CryptoError, Decryptable, EncString, IdentifyKey, KeyStoreContext, + PrimitiveEncryptable, }; use bitwarden_error::bitwarden_error; use chrono::{DateTime, Utc}; @@ -906,7 +906,7 @@ mod tests { folder_id: None, collection_ids: vec![], key: None, - name: "2.d3rzo0P8rxV9Hs1m1BmAjw==|JOwna6i0zs+K7ZghwrZRuw==|SJqKreLag1ID+g6H1OdmQr0T5zTrVWKzD6hGy3fDqB0=".parse().unwrap(), + name: TEST_CIPHER_NAME.parse().unwrap(), notes: None, r#type: CipherType::Login, login: Some(Login { @@ -1363,4 +1363,303 @@ mod tests { let decrypted_key_value = cipher_view.decrypt_fido2_private_key(&mut ctx).unwrap(); assert_eq!(decrypted_key_value, "123"); } + + // Test constants for encrypted strings + const TEST_ENC_STRING_1: &str = "2.xzDCDWqRBpHm42EilUvyVw==|nIrWV3l/EeTbWTnAznrK0Q==|sUj8ol2OTgvvTvD86a9i9XUP58hmtCEBqhck7xT5YNk="; + const TEST_ENC_STRING_2: &str = "2.M7ZJ7EuFDXCq66gDTIyRIg==|B1V+jroo6+m/dpHx6g8DxA==|PIXPBCwyJ1ady36a7jbcLg346pm/7N/06W4UZxc1TUo="; + const TEST_ENC_STRING_3: &str = "2.d3rzo0P8rxV9Hs1m1BmAjw==|JOwna6i0zs+K7ZghwrZRuw==|SJqKreLag1ID+g6H1OdmQr0T5zTrVWKzD6hGy3fDqB0="; + const TEST_ENC_STRING_4: &str = "2.EBNGgnaMHeO/kYnI3A0jiA==|9YXlrgABP71ebZ5umurCJQ==|GDk5jxiqTYaU7e2AStCFGX+a1kgCIk8j0NEli7Jn0L4="; + const TEST_ENC_STRING_5: &str = "2.hqdioUAc81FsKQmO1XuLQg==|oDRdsJrQjoFu9NrFVy8tcJBAFKBx95gHaXZnWdXbKpsxWnOr2sKipIG43pKKUFuq|3gKZMiboceIB5SLVOULKg2iuyu6xzos22dfJbvx0EHk="; + const TEST_CIPHER_NAME: &str = "2.d3rzo0P8rxV9Hs1m1BmAjw==|JOwna6i0zs+K7ZghwrZRuw==|SJqKreLag1ID+g6H1OdmQr0T5zTrVWKzD6hGy3fDqB0="; + const TEST_UUID: &str = "fd411a1a-fec8-4070-985d-0e6560860e69"; + + #[test] + fn test_populate_cipher_types_login_with_valid_data() { + let mut cipher = Cipher { + id: Some(TEST_UUID.parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + key: None, + name: TEST_CIPHER_NAME.parse().unwrap(), + notes: None, + r#type: CipherType::Login, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: None, + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + permissions: None, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + data: Some(format!(r#"{{"version": 2, "username": "{}", "password": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2)), + }; + + cipher.populate_cipher_types(); + + assert!(cipher.login.is_some()); + let login = cipher.login.unwrap(); + assert_eq!(login.username.unwrap().to_string(), TEST_ENC_STRING_1); + assert_eq!(login.password.unwrap().to_string(), TEST_ENC_STRING_2); + } + + #[test] + fn test_populate_cipher_types_secure_note() { + let mut cipher = Cipher { + id: Some(TEST_UUID.parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + key: None, + name: TEST_CIPHER_NAME.parse().unwrap(), + notes: None, + r#type: CipherType::SecureNote, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: None, + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + permissions: None, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + data: Some(r#"{"type": 0, "organizationUseTotp": false, "favorite": false, "deletedDate": null}"#.to_string()), + }; + + cipher.populate_cipher_types(); + + assert!(cipher.secure_note.is_some()); + } + + #[test] + fn test_populate_cipher_types_card() { + let mut cipher = Cipher { + id: Some(TEST_UUID.parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + key: None, + name: TEST_CIPHER_NAME.parse().unwrap(), + notes: None, + r#type: CipherType::Card, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: None, + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + permissions: None, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + data: Some(format!(r#"{{"cardholderName": "{}", "number": "{}", "expMonth": "{}", "expYear": "{}", "code": "{}", "brand": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3, TEST_ENC_STRING_4, TEST_ENC_STRING_5, TEST_ENC_STRING_1)), + }; + + cipher.populate_cipher_types(); + + assert!(cipher.card.is_some()); + let card = cipher.card.unwrap(); + assert_eq!(card.cardholder_name.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); + assert_eq!(card.number.as_ref().unwrap().to_string(), TEST_ENC_STRING_2); + assert_eq!(card.exp_month.as_ref().unwrap().to_string(), TEST_ENC_STRING_3); + assert_eq!(card.exp_year.as_ref().unwrap().to_string(), TEST_ENC_STRING_4); + assert_eq!(card.code.as_ref().unwrap().to_string(), TEST_ENC_STRING_5); + assert_eq!(card.brand.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); + } + + #[test] + fn test_populate_cipher_types_identity() { + let mut cipher = Cipher { + id: Some(TEST_UUID.parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + key: None, + name: TEST_CIPHER_NAME.parse().unwrap(), + notes: None, + r#type: CipherType::Identity, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: None, + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + permissions: None, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + data: Some(format!(r#"{{"firstName": "{}", "lastName": "{}", "email": "{}", "phone": "{}", "company": "{}", "address1": "{}", "city": "{}", "state": "{}", "postalCode": "{}", "country": "{}", "organizationUseTotp": false, "favorite": true, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3, TEST_ENC_STRING_4, TEST_ENC_STRING_5, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3, TEST_ENC_STRING_4, TEST_ENC_STRING_5)), + }; + + cipher.populate_cipher_types(); + + assert!(cipher.identity.is_some()); + let identity = cipher.identity.unwrap(); + assert_eq!(identity.first_name.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); + assert_eq!(identity.last_name.as_ref().unwrap().to_string(), TEST_ENC_STRING_2); + assert_eq!(identity.email.as_ref().unwrap().to_string(), TEST_ENC_STRING_3); + assert_eq!(identity.phone.as_ref().unwrap().to_string(), TEST_ENC_STRING_4); + assert_eq!(identity.company.as_ref().unwrap().to_string(), TEST_ENC_STRING_5); + assert_eq!(identity.address1.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); + assert_eq!(identity.city.as_ref().unwrap().to_string(), TEST_ENC_STRING_2); + assert_eq!(identity.state.as_ref().unwrap().to_string(), TEST_ENC_STRING_3); + assert_eq!(identity.postal_code.as_ref().unwrap().to_string(), TEST_ENC_STRING_4); + assert_eq!(identity.country.as_ref().unwrap().to_string(), TEST_ENC_STRING_5); + } + + #[test] + fn test_populate_cipher_types_ssh_key() { + let mut cipher = Cipher { + id: Some(TEST_UUID.parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + key: None, + name: TEST_CIPHER_NAME.parse().unwrap(), + notes: None, + r#type: CipherType::SshKey, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: None, + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + permissions: None, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + data: Some(format!(r#"{{"privateKey": "{}", "publicKey": "{}", "fingerprint": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3)), + }; + + cipher.populate_cipher_types(); + + assert!(cipher.ssh_key.is_some()); + let ssh_key = cipher.ssh_key.unwrap(); + assert_eq!(ssh_key.private_key.to_string(), TEST_ENC_STRING_1); + assert_eq!(ssh_key.public_key.to_string(), TEST_ENC_STRING_2); + assert_eq!(ssh_key.fingerprint.to_string(), TEST_ENC_STRING_3); + } + + #[test] + fn test_populate_cipher_types_with_null_data() { + let mut cipher = Cipher { + id: Some(TEST_UUID.parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + key: None, + name: TEST_CIPHER_NAME.parse().unwrap(), + notes: None, + r#type: CipherType::Login, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: None, + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + permissions: None, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + data: None, + }; + + cipher.populate_cipher_types(); + + // Should not crash and login should be created (empty Login with None fields) + assert!(cipher.login.is_some()); + let login = cipher.login.unwrap(); + assert!(login.username.is_none()); + assert!(login.password.is_none()); + } + + #[test] + fn test_populate_cipher_types_with_invalid_json() { + let mut cipher = Cipher { + id: Some(TEST_UUID.parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + key: None, + name: TEST_CIPHER_NAME.parse().unwrap(), + notes: None, + r#type: CipherType::Login, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: None, + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + permissions: None, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + data: Some("invalid json".to_string()), + }; + + cipher.populate_cipher_types(); + + // Should not crash and login should remain None + assert!(cipher.login.is_none()); + } + } From 5e6387c6e6a739880c7753e8b40c548f7ec283da Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Fri, 12 Sep 2025 12:12:28 -0700 Subject: [PATCH 11/17] Uncomment migration logic --- .../src/cipher/cipher_client.rs | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 44254ed8e..e9adc117f 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -178,40 +178,40 @@ impl CiphersClient { #[allow(missing_docs)] pub fn migrate(&self, mut ciphers: Vec) -> Result, CipherError> { - // let registry = MigrationRegistry::new(); + let registry = MigrationRegistry::new(); for cipher in &mut ciphers { - cipher.populate_cipher_types(); - - // let key = cipher.key_identifier(); - // let key_store = self.client.internal.get_key_store(); - // let mut ctx = key_store.context(); - // let cipher_key = Cipher::decrypt_cipher_key(&mut ctx, key, &cipher.key) - // .map_err(CipherError::CryptoError)?; - - // if let Some(data_str) = &mut cipher.data { - // let mut data_json: serde_json::Value = serde_json::from_str(data_str) - // .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; - - // let response_version = data_json - // .get("version") - // .and_then(|v| v.as_u64()) - // .unwrap_or(1) as u32; - - // if response_version < CURRENT_CIPHER_VERSION { - // registry.migrate( - // &mut data_json, - // response_version, - // CURRENT_CIPHER_VERSION, - // Some(&mut ctx), - // Some(cipher_key), - // )?; - - // data_json["version"] = serde_json::json!(CURRENT_CIPHER_VERSION); - - // *data_str = serde_json::to_string(&data_json) - // .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; - // } - // } + + let key = cipher.key_identifier(); + let key_store = self.client.internal.get_key_store(); + let mut ctx = key_store.context(); + let cipher_key = Cipher::decrypt_cipher_key(&mut ctx, key, &cipher.key) + .map_err(CipherError::CryptoError)?; + + if let Some(data_str) = &mut cipher.data { + let mut data_json: serde_json::Value = serde_json::from_str(data_str) + .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; + + let response_version = data_json + .get("version") + .and_then(|v| v.as_u64()) + .unwrap_or(1) as u32; + + if response_version < CURRENT_CIPHER_VERSION { + registry.migrate( + &mut data_json, + response_version, + CURRENT_CIPHER_VERSION, + Some(&mut ctx), + Some(cipher_key), + )?; + + data_json["version"] = serde_json::json!(CURRENT_CIPHER_VERSION); + + *data_str = serde_json::to_string(&data_json) + .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; + } + cipher.populate_cipher_types(); + } } Ok(ciphers) From 46408ea3cd218d7a24eeed10cd6c6d54ec75000a Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Fri, 12 Sep 2025 12:14:43 -0700 Subject: [PATCH 12/17] Remove comments --- crates/bitwarden-vault/src/cipher/cipher.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index f8ed66f34..66c32eb6f 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -461,7 +461,6 @@ impl Cipher { serde_json::from_str::(&self.data.as_deref().unwrap_or("{}")) else { // If we can't deserialize the data, then we'll return the cipher as-is. - // Should maybe return a result instead? return; }; @@ -818,12 +817,6 @@ impl From for CipherRepromptType } } -// impl From<&Cipher> for Option { -// fn from(value: &Cipher) -> Self { - -// } -// } - #[cfg(test)] mod tests { From 0618af9d7e796ebee917e6a1780f24b9d2595a98 Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Fri, 12 Sep 2025 12:18:17 -0700 Subject: [PATCH 13/17] Run cargo fmt --- crates/bitwarden-vault/src/cipher/cipher.rs | 100 ++++++++++++++++---- 1 file changed, 82 insertions(+), 18 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index 66c32eb6f..ee6a3e541 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -1395,7 +1395,10 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - data: Some(format!(r#"{{"version": 2, "username": "{}", "password": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2)), + data: Some(format!( + r#"{{"version": 2, "username": "{}", "password": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, + TEST_ENC_STRING_1, TEST_ENC_STRING_2 + )), }; cipher.populate_cipher_types(); @@ -1472,17 +1475,34 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - data: Some(format!(r#"{{"cardholderName": "{}", "number": "{}", "expMonth": "{}", "expYear": "{}", "code": "{}", "brand": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3, TEST_ENC_STRING_4, TEST_ENC_STRING_5, TEST_ENC_STRING_1)), + data: Some(format!( + r#"{{"cardholderName": "{}", "number": "{}", "expMonth": "{}", "expYear": "{}", "code": "{}", "brand": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, + TEST_ENC_STRING_1, + TEST_ENC_STRING_2, + TEST_ENC_STRING_3, + TEST_ENC_STRING_4, + TEST_ENC_STRING_5, + TEST_ENC_STRING_1 + )), }; cipher.populate_cipher_types(); assert!(cipher.card.is_some()); let card = cipher.card.unwrap(); - assert_eq!(card.cardholder_name.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); + assert_eq!( + card.cardholder_name.as_ref().unwrap().to_string(), + TEST_ENC_STRING_1 + ); assert_eq!(card.number.as_ref().unwrap().to_string(), TEST_ENC_STRING_2); - assert_eq!(card.exp_month.as_ref().unwrap().to_string(), TEST_ENC_STRING_3); - assert_eq!(card.exp_year.as_ref().unwrap().to_string(), TEST_ENC_STRING_4); + assert_eq!( + card.exp_month.as_ref().unwrap().to_string(), + TEST_ENC_STRING_3 + ); + assert_eq!( + card.exp_year.as_ref().unwrap().to_string(), + TEST_ENC_STRING_4 + ); assert_eq!(card.code.as_ref().unwrap().to_string(), TEST_ENC_STRING_5); assert_eq!(card.brand.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); } @@ -1516,23 +1536,65 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - data: Some(format!(r#"{{"firstName": "{}", "lastName": "{}", "email": "{}", "phone": "{}", "company": "{}", "address1": "{}", "city": "{}", "state": "{}", "postalCode": "{}", "country": "{}", "organizationUseTotp": false, "favorite": true, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3, TEST_ENC_STRING_4, TEST_ENC_STRING_5, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3, TEST_ENC_STRING_4, TEST_ENC_STRING_5)), + data: Some(format!( + r#"{{"firstName": "{}", "lastName": "{}", "email": "{}", "phone": "{}", "company": "{}", "address1": "{}", "city": "{}", "state": "{}", "postalCode": "{}", "country": "{}", "organizationUseTotp": false, "favorite": true, "deletedDate": null}}"#, + TEST_ENC_STRING_1, + TEST_ENC_STRING_2, + TEST_ENC_STRING_3, + TEST_ENC_STRING_4, + TEST_ENC_STRING_5, + TEST_ENC_STRING_1, + TEST_ENC_STRING_2, + TEST_ENC_STRING_3, + TEST_ENC_STRING_4, + TEST_ENC_STRING_5 + )), }; cipher.populate_cipher_types(); assert!(cipher.identity.is_some()); let identity = cipher.identity.unwrap(); - assert_eq!(identity.first_name.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); - assert_eq!(identity.last_name.as_ref().unwrap().to_string(), TEST_ENC_STRING_2); - assert_eq!(identity.email.as_ref().unwrap().to_string(), TEST_ENC_STRING_3); - assert_eq!(identity.phone.as_ref().unwrap().to_string(), TEST_ENC_STRING_4); - assert_eq!(identity.company.as_ref().unwrap().to_string(), TEST_ENC_STRING_5); - assert_eq!(identity.address1.as_ref().unwrap().to_string(), TEST_ENC_STRING_1); - assert_eq!(identity.city.as_ref().unwrap().to_string(), TEST_ENC_STRING_2); - assert_eq!(identity.state.as_ref().unwrap().to_string(), TEST_ENC_STRING_3); - assert_eq!(identity.postal_code.as_ref().unwrap().to_string(), TEST_ENC_STRING_4); - assert_eq!(identity.country.as_ref().unwrap().to_string(), TEST_ENC_STRING_5); + assert_eq!( + identity.first_name.as_ref().unwrap().to_string(), + TEST_ENC_STRING_1 + ); + assert_eq!( + identity.last_name.as_ref().unwrap().to_string(), + TEST_ENC_STRING_2 + ); + assert_eq!( + identity.email.as_ref().unwrap().to_string(), + TEST_ENC_STRING_3 + ); + assert_eq!( + identity.phone.as_ref().unwrap().to_string(), + TEST_ENC_STRING_4 + ); + assert_eq!( + identity.company.as_ref().unwrap().to_string(), + TEST_ENC_STRING_5 + ); + assert_eq!( + identity.address1.as_ref().unwrap().to_string(), + TEST_ENC_STRING_1 + ); + assert_eq!( + identity.city.as_ref().unwrap().to_string(), + TEST_ENC_STRING_2 + ); + assert_eq!( + identity.state.as_ref().unwrap().to_string(), + TEST_ENC_STRING_3 + ); + assert_eq!( + identity.postal_code.as_ref().unwrap().to_string(), + TEST_ENC_STRING_4 + ); + assert_eq!( + identity.country.as_ref().unwrap().to_string(), + TEST_ENC_STRING_5 + ); } #[test] @@ -1564,7 +1626,10 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), - data: Some(format!(r#"{{"privateKey": "{}", "publicKey": "{}", "fingerprint": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3)), + data: Some(format!( + r#"{{"privateKey": "{}", "publicKey": "{}", "fingerprint": "{}", "organizationUseTotp": true, "favorite": false, "deletedDate": null}}"#, + TEST_ENC_STRING_1, TEST_ENC_STRING_2, TEST_ENC_STRING_3 + )), }; cipher.populate_cipher_types(); @@ -1654,5 +1719,4 @@ mod tests { // Should not crash and login should remain None assert!(cipher.login.is_none()); } - } From f6913d946fd1415b8ca074776335a8619fcf19cc Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Fri, 12 Sep 2025 12:22:15 -0700 Subject: [PATCH 14/17] Run cargo fmt --- crates/bitwarden-vault/src/cipher/cipher_client.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index e9adc117f..86210aa3c 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -153,7 +153,6 @@ impl CiphersClient { Ok(cipher_view) } - #[allow(missing_docs)] pub fn move_to_organization( &self, @@ -180,7 +179,6 @@ impl CiphersClient { pub fn migrate(&self, mut ciphers: Vec) -> Result, CipherError> { let registry = MigrationRegistry::new(); for cipher in &mut ciphers { - let key = cipher.key_identifier(); let key_store = self.client.internal.get_key_store(); let mut ctx = key_store.context(); From 4f53908add5c1012da315162daf8285a57810c7c Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Fri, 12 Sep 2025 12:42:23 -0700 Subject: [PATCH 15/17] Fix clippy errors --- crates/bitwarden-vault/src/cipher/cipher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index ee6a3e541..924af6cd1 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -458,7 +458,7 @@ impl Cipher { /// Extracts and sets the CipherType-specific fields from the opaque `data` field. pub(crate) fn populate_cipher_types(&mut self) { let Ok(data) = - serde_json::from_str::(&self.data.as_deref().unwrap_or("{}")) + serde_json::from_str::(self.data.as_deref().unwrap_or("{}")) else { // If we can't deserialize the data, then we'll return the cipher as-is. return; From 1f992bbae8d4652024d1eec2b76b67bdaf351251 Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Wed, 17 Sep 2025 16:20:59 -0700 Subject: [PATCH 16/17] Update Cipher::populate_cipher_types with better error handling. --- crates/bitwarden-vault/src/cipher/cipher.rs | 73 ++++++++++++------- .../src/cipher/cipher_client.rs | 2 +- crates/bitwarden-vault/src/error.rs | 15 ++++ 3 files changed, 61 insertions(+), 29 deletions(-) diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index 924af6cd1..d95303c8a 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -49,12 +49,15 @@ pub enum CipherError { EncryptError(#[from] EncryptError), #[error("This cipher contains attachments without keys. Those attachments will need to be reuploaded to complete the operation")] AttachmentsWithoutKeys, - // POC - Cipher versioning #[error("Unsupported cipher version {0}")] UnsupportedCipherVersion(u32), #[error("Migration failed: {0}")] MigrationFailed(String), + #[error(transparent)] + Chrono(#[from] chrono::ParseError), + #[error(transparent)] + SerdeJson(#[from] serde_json::Error), } /// Helper trait for operations on cipher types. @@ -456,21 +459,26 @@ impl Cipher { } /// Extracts and sets the CipherType-specific fields from the opaque `data` field. - pub(crate) fn populate_cipher_types(&mut self) { - let Ok(data) = - serde_json::from_str::(self.data.as_deref().unwrap_or("{}")) - else { - // If we can't deserialize the data, then we'll return the cipher as-is. - return; - }; + /// + /// This replaces the values provided by the API in the `login`, `secure_note`, `card`, + /// `identity`, and `ssh_key` fields, relying instead on client-side parsing of the + /// `data` field. + pub(crate) fn populate_cipher_types(&mut self) -> Result<(), VaultParseError> { + let data = self + .data + .as_ref() + .ok_or(VaultParseError::MissingFieldError(MissingFieldError( + "data", + )))?; match &self.r#type { - crate::CipherType::Login => self.login = serde_json::from_value(data).ok(), - crate::CipherType::SecureNote => self.secure_note = serde_json::from_value(data).ok(), - crate::CipherType::Card => self.card = serde_json::from_value(data).ok(), - crate::CipherType::Identity => self.identity = serde_json::from_value(data).ok(), - crate::CipherType::SshKey => self.ssh_key = serde_json::from_value(data).ok(), + crate::CipherType::Login => self.login = serde_json::from_str(data)?, + crate::CipherType::SecureNote => self.secure_note = serde_json::from_str(data)?, + crate::CipherType::Card => self.card = serde_json::from_str(data)?, + crate::CipherType::Identity => self.identity = serde_json::from_str(data)?, + crate::CipherType::SshKey => self.ssh_key = serde_json::from_str(data)?, } + Ok(()) } } @@ -1401,7 +1409,9 @@ mod tests { )), }; - cipher.populate_cipher_types(); + cipher + .populate_cipher_types() + .expect("populate_cipher_types failed"); assert!(cipher.login.is_some()); let login = cipher.login.unwrap(); @@ -1441,7 +1451,9 @@ mod tests { data: Some(r#"{"type": 0, "organizationUseTotp": false, "favorite": false, "deletedDate": null}"#.to_string()), }; - cipher.populate_cipher_types(); + cipher + .populate_cipher_types() + .expect("populate_cipher_types failed"); assert!(cipher.secure_note.is_some()); } @@ -1486,7 +1498,9 @@ mod tests { )), }; - cipher.populate_cipher_types(); + cipher + .populate_cipher_types() + .expect("populate_cipher_types failed"); assert!(cipher.card.is_some()); let card = cipher.card.unwrap(); @@ -1551,7 +1565,9 @@ mod tests { )), }; - cipher.populate_cipher_types(); + cipher + .populate_cipher_types() + .expect("populate_cipher_types failed"); assert!(cipher.identity.is_some()); let identity = cipher.identity.unwrap(); @@ -1632,7 +1648,9 @@ mod tests { )), }; - cipher.populate_cipher_types(); + cipher + .populate_cipher_types() + .expect("populate_cipher_types failed"); assert!(cipher.ssh_key.is_some()); let ssh_key = cipher.ssh_key.unwrap(); @@ -1673,13 +1691,13 @@ mod tests { data: None, }; - cipher.populate_cipher_types(); - - // Should not crash and login should be created (empty Login with None fields) - assert!(cipher.login.is_some()); - let login = cipher.login.unwrap(); - assert!(login.username.is_none()); - assert!(login.password.is_none()); + let result = cipher.populate_cipher_types(); + assert!(matches!( + result, + Err(VaultParseError::MissingFieldError(MissingFieldError( + "data" + ))) + )); } #[test] @@ -1714,9 +1732,8 @@ mod tests { data: Some("invalid json".to_string()), }; - cipher.populate_cipher_types(); + let result = cipher.populate_cipher_types(); - // Should not crash and login should remain None - assert!(cipher.login.is_none()); + assert!(matches!(result, Err(VaultParseError::SerdeJson(_)))); } } diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 86210aa3c..5b22edbda 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -208,7 +208,7 @@ impl CiphersClient { *data_str = serde_json::to_string(&data_json) .map_err(|e| CipherError::MigrationFailed(e.to_string()))?; } - cipher.populate_cipher_types(); + cipher.populate_cipher_types()?; } } diff --git a/crates/bitwarden-vault/src/error.rs b/crates/bitwarden-vault/src/error.rs index e014da04a..a11154155 100644 --- a/crates/bitwarden-vault/src/error.rs +++ b/crates/bitwarden-vault/src/error.rs @@ -1,6 +1,8 @@ use bitwarden_error::bitwarden_error; use thiserror::Error; +use crate::CipherError; + /// Generic error type for vault encryption errors. #[allow(missing_docs)] #[bitwarden_error(flat)] @@ -34,4 +36,17 @@ pub enum VaultParseError { Crypto(#[from] bitwarden_crypto::CryptoError), #[error(transparent)] MissingFieldError(#[from] bitwarden_core::MissingFieldError), + #[error(transparent)] + SerdeJson(#[from] serde_json::Error), +} + +impl From for CipherError { + fn from(e: VaultParseError) -> Self { + match e { + VaultParseError::Crypto(e) => Self::CryptoError(e), + VaultParseError::MissingFieldError(e) => Self::MissingFieldError(e), + VaultParseError::Chrono(e) => Self::Chrono(e), + VaultParseError::SerdeJson(e) => Self::SerdeJson(e), + } + } } From f1afa1190329e11a38bb2a7e269755c957b70622 Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Mon, 22 Sep 2025 12:19:16 -0700 Subject: [PATCH 17/17] Empty commit to update GH PR