diff --git a/Cargo.toml b/Cargo.toml index 32c2ac9ee..00d90641d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,9 +8,9 @@ exclude = ["support/lints"] # Update using `cargo set-version -p bitwarden-core ` version = "1.0.0" authors = ["Bitwarden Inc"] -edition = "2021" +edition = "2024" # Important: Changing rust-version should be considered a breaking change -rust-version = "1.82" +rust-version = "1.85" homepage = "https://bitwarden.com" repository = "https://github.com/bitwarden/sdk-internal" license-file = "LICENSE" diff --git a/bitwarden_license/bitwarden-sm/src/client_projects.rs b/bitwarden_license/bitwarden-sm/src/client_projects.rs index 1efacb988..d63e2ab39 100644 --- a/bitwarden_license/bitwarden-sm/src/client_projects.rs +++ b/bitwarden_license/bitwarden-sm/src/client_projects.rs @@ -3,9 +3,9 @@ use bitwarden_core::Client; use crate::{ error::SecretsManagerError, projects::{ - create_project, delete_projects, get_project, list_projects, update_project, ProjectCreateRequest, ProjectGetRequest, ProjectPutRequest, ProjectResponse, ProjectsDeleteRequest, ProjectsDeleteResponse, ProjectsListRequest, ProjectsResponse, + create_project, delete_projects, get_project, list_projects, update_project, }, }; diff --git a/bitwarden_license/bitwarden-sm/src/client_secrets.rs b/bitwarden_license/bitwarden-sm/src/client_secrets.rs index 92d7350b2..f7b8642b2 100644 --- a/bitwarden_license/bitwarden-sm/src/client_secrets.rs +++ b/bitwarden_license/bitwarden-sm/src/client_secrets.rs @@ -3,12 +3,11 @@ use bitwarden_core::Client; use crate::{ error::SecretsManagerError, secrets::{ - create_secret, delete_secrets, get_secret, get_secrets_by_ids, list_secrets, - list_secrets_by_project, sync_secrets, update_secret, SecretCreateRequest, - SecretGetRequest, SecretIdentifiersByProjectRequest, SecretIdentifiersRequest, - SecretIdentifiersResponse, SecretPutRequest, SecretResponse, SecretsDeleteRequest, - SecretsDeleteResponse, SecretsGetRequest, SecretsResponse, SecretsSyncRequest, - SecretsSyncResponse, + SecretCreateRequest, SecretGetRequest, SecretIdentifiersByProjectRequest, + SecretIdentifiersRequest, SecretIdentifiersResponse, SecretPutRequest, SecretResponse, + SecretsDeleteRequest, SecretsDeleteResponse, SecretsGetRequest, SecretsResponse, + SecretsSyncRequest, SecretsSyncResponse, create_secret, delete_secrets, get_secret, + get_secrets_by_ids, list_secrets, list_secrets_by_project, sync_secrets, update_secret, }, }; @@ -118,12 +117,12 @@ impl SecretsClientExt for Client { #[cfg(test)] mod tests { use bitwarden_core::{ - auth::login::AccessTokenLoginRequest, Client, ClientSettings, DeviceType, + Client, ClientSettings, DeviceType, auth::login::AccessTokenLoginRequest, }; use crate::{ - secrets::{SecretGetRequest, SecretIdentifiersRequest}, ClientSecretsExt, + secrets::{SecretGetRequest, SecretIdentifiersRequest}, }; async fn start_mock(mocks: Vec) -> (wiremock::MockServer, Client) { @@ -145,7 +144,7 @@ mod tests { #[tokio::test] async fn test_access_token_login() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; // Create the mock server with the necessary routes for this test let (_server, client) = start_mock(vec![ diff --git a/bitwarden_license/bitwarden-sm/src/projects/create.rs b/bitwarden_license/bitwarden-sm/src/projects/create.rs index 176dc7970..d5f14ea8f 100644 --- a/bitwarden_license/bitwarden-sm/src/projects/create.rs +++ b/bitwarden_license/bitwarden-sm/src/projects/create.rs @@ -1,5 +1,5 @@ use bitwarden_api_api::models::ProjectCreateRequestModel; -use bitwarden_core::{key_management::SymmetricKeyId, Client, OrganizationId}; +use bitwarden_core::{Client, OrganizationId, key_management::SymmetricKeyId}; use bitwarden_crypto::PrimitiveEncryptable; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -7,7 +7,7 @@ use uuid::Uuid; use validator::Validate; use crate::{ - error::{validate_only_whitespaces, SecretsManagerError}, + error::{SecretsManagerError, validate_only_whitespaces}, projects::ProjectResponse, }; diff --git a/bitwarden_license/bitwarden-sm/src/projects/mod.rs b/bitwarden_license/bitwarden-sm/src/projects/mod.rs index 20ae5d95b..37d58685e 100644 --- a/bitwarden_license/bitwarden-sm/src/projects/mod.rs +++ b/bitwarden_license/bitwarden-sm/src/projects/mod.rs @@ -5,14 +5,14 @@ mod list; mod project_response; mod update; -pub(crate) use create::create_project; pub use create::ProjectCreateRequest; +pub(crate) use create::create_project; pub(crate) use delete::delete_projects; pub use delete::{ProjectsDeleteRequest, ProjectsDeleteResponse}; -pub(crate) use get::get_project; pub use get::ProjectGetRequest; +pub(crate) use get::get_project; pub(crate) use list::list_projects; pub use list::{ProjectsListRequest, ProjectsResponse}; pub use project_response::ProjectResponse; -pub(crate) use update::update_project; pub use update::ProjectPutRequest; +pub(crate) use update::update_project; diff --git a/bitwarden_license/bitwarden-sm/src/projects/project_response.rs b/bitwarden_license/bitwarden-sm/src/projects/project_response.rs index 4d37c963f..e7676ff56 100644 --- a/bitwarden_license/bitwarden-sm/src/projects/project_response.rs +++ b/bitwarden_license/bitwarden-sm/src/projects/project_response.rs @@ -1,7 +1,8 @@ use bitwarden_api_api::models::ProjectResponseModel; use bitwarden_core::{ + OrganizationId, key_management::{KeyIds, SymmetricKeyId}, - require, OrganizationId, + require, }; use bitwarden_crypto::{Decryptable, EncString, KeyStoreContext}; use chrono::{DateTime, Utc}; diff --git a/bitwarden_license/bitwarden-sm/src/projects/update.rs b/bitwarden_license/bitwarden-sm/src/projects/update.rs index 438e2bf9f..c5eed0eb5 100644 --- a/bitwarden_license/bitwarden-sm/src/projects/update.rs +++ b/bitwarden_license/bitwarden-sm/src/projects/update.rs @@ -1,5 +1,5 @@ use bitwarden_api_api::models::ProjectUpdateRequestModel; -use bitwarden_core::{key_management::SymmetricKeyId, Client, OrganizationId}; +use bitwarden_core::{Client, OrganizationId, key_management::SymmetricKeyId}; use bitwarden_crypto::PrimitiveEncryptable; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -7,7 +7,7 @@ use uuid::Uuid; use validator::Validate; use crate::{ - error::{validate_only_whitespaces, SecretsManagerError}, + error::{SecretsManagerError, validate_only_whitespaces}, projects::ProjectResponse, }; diff --git a/bitwarden_license/bitwarden-sm/src/secrets/create.rs b/bitwarden_license/bitwarden-sm/src/secrets/create.rs index e952216aa..c1a6fb801 100644 --- a/bitwarden_license/bitwarden-sm/src/secrets/create.rs +++ b/bitwarden_license/bitwarden-sm/src/secrets/create.rs @@ -1,5 +1,5 @@ use bitwarden_api_api::models::SecretCreateRequestModel; -use bitwarden_core::{key_management::SymmetricKeyId, Client, OrganizationId}; +use bitwarden_core::{Client, OrganizationId, key_management::SymmetricKeyId}; use bitwarden_crypto::PrimitiveEncryptable; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -7,7 +7,7 @@ use uuid::Uuid; use validator::Validate; use crate::{ - error::{validate_only_whitespaces, SecretsManagerError}, + error::{SecretsManagerError, validate_only_whitespaces}, secrets::SecretResponse, }; diff --git a/bitwarden_license/bitwarden-sm/src/secrets/list.rs b/bitwarden_license/bitwarden-sm/src/secrets/list.rs index 2ee649e91..908787542 100644 --- a/bitwarden_license/bitwarden-sm/src/secrets/list.rs +++ b/bitwarden_license/bitwarden-sm/src/secrets/list.rs @@ -2,9 +2,10 @@ use bitwarden_api_api::models::{ SecretWithProjectsListResponseModel, SecretsWithProjectsInnerSecret, }; use bitwarden_core::{ + OrganizationId, client::Client, key_management::{KeyIds, SymmetricKeyId}, - require, OrganizationId, + require, }; use bitwarden_crypto::{Decryptable, EncString, KeyStoreContext}; use schemars::JsonSchema; diff --git a/bitwarden_license/bitwarden-sm/src/secrets/mod.rs b/bitwarden_license/bitwarden-sm/src/secrets/mod.rs index 74a7a9c47..64999e414 100644 --- a/bitwarden_license/bitwarden-sm/src/secrets/mod.rs +++ b/bitwarden_license/bitwarden-sm/src/secrets/mod.rs @@ -7,20 +7,20 @@ mod secret_response; mod sync; mod update; -pub(crate) use create::create_secret; pub use create::SecretCreateRequest; +pub(crate) use create::create_secret; pub(crate) use delete::delete_secrets; pub use delete::{SecretsDeleteRequest, SecretsDeleteResponse}; -pub(crate) use get::get_secret; pub use get::SecretGetRequest; -pub(crate) use get_by_ids::get_secrets_by_ids; +pub(crate) use get::get_secret; pub use get_by_ids::SecretsGetRequest; -pub(crate) use list::{list_secrets, list_secrets_by_project}; +pub(crate) use get_by_ids::get_secrets_by_ids; pub use list::{ SecretIdentifiersByProjectRequest, SecretIdentifiersRequest, SecretIdentifiersResponse, }; +pub(crate) use list::{list_secrets, list_secrets_by_project}; pub use secret_response::{SecretResponse, SecretsResponse}; pub(crate) use sync::sync_secrets; pub use sync::{SecretsSyncRequest, SecretsSyncResponse}; -pub(crate) use update::update_secret; pub use update::SecretPutRequest; +pub(crate) use update::update_secret; diff --git a/bitwarden_license/bitwarden-sm/src/secrets/secret_response.rs b/bitwarden_license/bitwarden-sm/src/secrets/secret_response.rs index 040b8c6dc..ff1bb2689 100644 --- a/bitwarden_license/bitwarden-sm/src/secrets/secret_response.rs +++ b/bitwarden_license/bitwarden-sm/src/secrets/secret_response.rs @@ -2,8 +2,9 @@ use bitwarden_api_api::models::{ BaseSecretResponseModel, BaseSecretResponseModelListResponseModel, SecretResponseModel, }; use bitwarden_core::{ + OrganizationId, key_management::{KeyIds, SymmetricKeyId}, - require, OrganizationId, + require, }; use bitwarden_crypto::{Decryptable, EncString, KeyStoreContext}; use chrono::{DateTime, Utc}; diff --git a/bitwarden_license/bitwarden-sm/src/secrets/sync.rs b/bitwarden_license/bitwarden-sm/src/secrets/sync.rs index 6c76bcde6..7329014a4 100644 --- a/bitwarden_license/bitwarden-sm/src/secrets/sync.rs +++ b/bitwarden_license/bitwarden-sm/src/secrets/sync.rs @@ -1,5 +1,5 @@ use bitwarden_api_api::models::SecretsSyncResponseModel; -use bitwarden_core::{key_management::KeyIds, require, Client}; +use bitwarden_core::{Client, key_management::KeyIds, require}; use bitwarden_crypto::KeyStoreContext; use chrono::{DateTime, Utc}; use schemars::JsonSchema; diff --git a/bitwarden_license/bitwarden-sm/src/secrets/update.rs b/bitwarden_license/bitwarden-sm/src/secrets/update.rs index 39d6892f6..055507390 100644 --- a/bitwarden_license/bitwarden-sm/src/secrets/update.rs +++ b/bitwarden_license/bitwarden-sm/src/secrets/update.rs @@ -1,5 +1,5 @@ use bitwarden_api_api::models::SecretUpdateRequestModel; -use bitwarden_core::{key_management::SymmetricKeyId, Client, OrganizationId}; +use bitwarden_core::{Client, OrganizationId, key_management::SymmetricKeyId}; use bitwarden_crypto::PrimitiveEncryptable; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -7,7 +7,7 @@ use uuid::Uuid; use validator::Validate; use crate::{ - error::{validate_only_whitespaces, SecretsManagerError}, + error::{SecretsManagerError, validate_only_whitespaces}, secrets::SecretResponse, }; 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 f90d9c6db..15439c18d 100644 --- a/crates/bitwarden-api-api/src/apis/access_policies_api.rs +++ b/crates/bitwarden-api-api/src/apis/access_policies_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -193,8 +193,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -250,8 +258,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -307,8 +323,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -364,8 +388,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -419,8 +451,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretAccessPoliciesResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretAccessPoliciesResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretAccessPoliciesResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretAccessPoliciesResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -476,8 +516,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -533,8 +581,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -590,8 +646,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PotentialGranteeResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -649,8 +713,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectPeopleAccessPoliciesResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -711,8 +783,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectServiceAccountsAccessPoliciesResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -773,8 +853,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountGrantedPoliciesPermissionDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -832,8 +920,16 @@ impl AccessPoliciesApi for AccessPoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountPeopleAccessPoliciesResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 d5352cda6..926f9e9f2 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/accounts_api.rs b/crates/bitwarden-api-api/src/apis/accounts_api.rs index abd4550b0..61f967100 100644 --- a/crates/bitwarden-api-api/src/apis/accounts_api.rs +++ b/crates/bitwarden-api-api/src/apis/accounts_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -296,8 +296,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -431,8 +439,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `i64`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `i64`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `i64`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `i64`" + )))); + } } } else { let local_var_entity: Option = @@ -478,8 +494,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeysResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::KeysResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::KeysResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::KeysResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -533,8 +557,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -580,8 +612,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -631,7 +671,11 @@ impl AccountsApi for AccountsApiClient { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Ok(local_var_content), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `String`")))), + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`" + )))); + } } } else { let local_var_entity: Option = @@ -682,8 +726,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SubscriptionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SubscriptionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SubscriptionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SubscriptionResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -729,8 +781,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TaxInfoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TaxInfoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TaxInfoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TaxInfoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1036,8 +1096,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeysResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::KeysResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::KeysResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::KeysResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1281,8 +1349,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1498,8 +1574,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1636,8 +1720,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MasterPasswordPolicyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::MasterPasswordPolicyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::MasterPasswordPolicyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::MasterPasswordPolicyResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1687,8 +1779,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1738,8 +1838,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1971,8 +2079,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`" + )))); + } } } else { let local_var_entity: 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 8ac26ce4e..3d2f1e499 100644 --- a/crates/bitwarden-api-api/src/apis/accounts_billing_api.rs +++ b/crates/bitwarden-api-api/src/apis/accounts_billing_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -106,8 +106,16 @@ impl AccountsBillingApi for AccountsBillingApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BillingHistoryResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BillingHistoryResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::BillingHistoryResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BillingHistoryResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -210,8 +218,16 @@ impl AccountsBillingApi for AccountsBillingApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BillingPaymentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BillingPaymentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::BillingPaymentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BillingPaymentResponseModel`" + )))); + } } } else { let local_var_entity: 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 6c4baf085..403ddeba2 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 6cccf83b8..6e3153c2c 100644 --- a/crates/bitwarden-api-api/src/apis/auth_requests_api.rs +++ b/crates/bitwarden-api-api/src/apis/auth_requests_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -122,8 +122,16 @@ impl AuthRequestsApi for AuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -170,8 +178,16 @@ impl AuthRequestsApi for AuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -225,8 +241,16 @@ impl AuthRequestsApi for AuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PendingAuthRequestResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PendingAuthRequestResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PendingAuthRequestResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PendingAuthRequestResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -284,8 +308,16 @@ impl AuthRequestsApi for AuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -335,8 +367,16 @@ impl AuthRequestsApi for AuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -388,8 +428,16 @@ impl AuthRequestsApi for AuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -444,8 +492,16 @@ impl AuthRequestsApi for AuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AuthRequestResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AuthRequestResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-api/src/apis/ciphers_api.rs b/crates/bitwarden-api-api/src/apis/ciphers_api.rs index 011b9f875..d580f8fd5 100644 --- a/crates/bitwarden-api-api/src/apis/ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/ciphers_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -62,7 +62,7 @@ pub trait CiphersApi: Send + Sync { /// GET /ciphers/{id} async fn get<'a>(&self, id: uuid::Uuid) - -> Result>; + -> Result>; /// GET /ciphers/{id}/admin async fn get_admin<'a>( @@ -484,8 +484,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteAttachmentResponseData`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeleteAttachmentResponseData`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeleteAttachmentResponseData`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeleteAttachmentResponseData`" + )))); + } } } else { let local_var_entity: Option = @@ -540,8 +548,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteAttachmentResponseData`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeleteAttachmentResponseData`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeleteAttachmentResponseData`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeleteAttachmentResponseData`" + )))); + } } } else { let local_var_entity: Option = @@ -676,8 +692,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -729,8 +753,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -778,8 +810,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -838,8 +878,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -894,8 +942,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -950,8 +1006,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1004,8 +1068,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1064,8 +1136,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1156,8 +1236,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -1206,8 +1294,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1262,8 +1358,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1316,8 +1420,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1465,8 +1577,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1613,8 +1733,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -1668,8 +1796,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1722,8 +1858,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1773,8 +1917,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1829,8 +1981,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1885,8 +2045,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1941,8 +2109,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OptionalCipherDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OptionalCipherDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OptionalCipherDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OptionalCipherDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2162,8 +2338,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2216,8 +2400,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2270,8 +2462,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2321,8 +2521,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2376,8 +2584,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2432,8 +2648,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2483,8 +2707,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2537,8 +2769,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2589,8 +2829,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -2645,8 +2893,16 @@ impl CiphersApi for CiphersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/collections_api.rs b/crates/bitwarden-api-api/src/apis/collections_api.rs index e31d082c0..9479125f7 100644 --- a/crates/bitwarden-api-api/src/apis/collections_api.rs +++ b/crates/bitwarden-api-api/src/apis/collections_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -248,8 +248,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -301,8 +309,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -357,8 +373,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -414,8 +438,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionAccessDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -463,8 +495,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollectionDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CollectionDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -519,8 +559,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::SelectionReadOnlyResponseModel>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::SelectionReadOnlyResponseModel>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<models::SelectionReadOnlyResponseModel>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::SelectionReadOnlyResponseModel>`" + )))); + } } } else { let local_var_entity: Option = @@ -575,8 +623,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -678,8 +734,16 @@ impl CollectionsApi for CollectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::CollectionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CollectionResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-api/src/apis/config_api.rs b/crates/bitwarden-api-api/src/apis/config_api.rs index cc24c6d07..b51c00d5b 100644 --- a/crates/bitwarden-api-api/src/apis/config_api.rs +++ b/crates/bitwarden-api-api/src/apis/config_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -73,8 +73,16 @@ impl ConfigApi for ConfigApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ConfigResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ConfigResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ConfigResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/counts_api.rs b/crates/bitwarden-api-api/src/apis/counts_api.rs index 2c1f39dbd..71abc7418 100644 --- a/crates/bitwarden-api-api/src/apis/counts_api.rs +++ b/crates/bitwarden-api-api/src/apis/counts_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -95,8 +95,16 @@ impl CountsApi for CountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationCountsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationCountsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationCountsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationCountsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -149,8 +157,16 @@ impl CountsApi for CountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectCountsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectCountsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectCountsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectCountsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -203,8 +219,16 @@ impl CountsApi for CountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountCountsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountCountsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountCountsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountCountsResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/devices_api.rs b/crates/bitwarden-api-api/src/apis/devices_api.rs index a4e75c53a..d6b2aa71c 100644 --- a/crates/bitwarden-api-api/src/apis/devices_api.rs +++ b/crates/bitwarden-api-api/src/apis/devices_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -194,8 +194,16 @@ impl DevicesApi for DevicesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -242,8 +250,16 @@ impl DevicesApi for DevicesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceAuthRequestResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceAuthRequestResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeviceAuthRequestResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceAuthRequestResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -296,8 +312,16 @@ impl DevicesApi for DevicesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -352,8 +376,16 @@ impl DevicesApi for DevicesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `bool`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `bool`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `bool`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `bool`" + )))); + } } } else { let local_var_entity: Option = @@ -403,8 +435,16 @@ impl DevicesApi for DevicesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -578,8 +618,16 @@ impl DevicesApi for DevicesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -677,8 +725,16 @@ impl DevicesApi for DevicesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DeviceResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeviceResponseModel`" + )))); + } } } else { let local_var_entity: 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 651d6c4b0..6089f75d4 100644 --- a/crates/bitwarden-api-api/src/apis/emergency_access_api.rs +++ b/crates/bitwarden-api-api/src/apis/emergency_access_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -355,8 +355,16 @@ impl EmergencyAccessApi for EmergencyAccessApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -412,8 +420,16 @@ impl EmergencyAccessApi for EmergencyAccessApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -467,8 +483,16 @@ impl EmergencyAccessApi for EmergencyAccessApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessGranteeDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -522,8 +546,16 @@ impl EmergencyAccessApi for EmergencyAccessApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessGrantorDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessGrantorDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessGrantorDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessGrantorDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -710,8 +742,16 @@ impl EmergencyAccessApi for EmergencyAccessApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -891,8 +931,16 @@ impl EmergencyAccessApi for EmergencyAccessApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessTakeoverResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessTakeoverResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessTakeoverResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessTakeoverResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -945,8 +993,16 @@ impl EmergencyAccessApi for EmergencyAccessApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessViewResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessViewResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::EmergencyAccessViewResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EmergencyAccessViewResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/events_api.rs b/crates/bitwarden-api-api/src/apis/events_api.rs index 9af8a4899..df75678ca 100644 --- a/crates/bitwarden-api-api/src/apis/events_api.rs +++ b/crates/bitwarden-api-api/src/apis/events_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -167,8 +167,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -236,8 +244,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -307,8 +323,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -378,8 +402,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -447,8 +479,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -518,8 +558,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -589,8 +637,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -653,8 +709,16 @@ impl EventsApi for EventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/folders_api.rs b/crates/bitwarden-api-api/src/apis/folders_api.rs index c3a8e5789..df24f0a98 100644 --- a/crates/bitwarden-api-api/src/apis/folders_api.rs +++ b/crates/bitwarden-api-api/src/apis/folders_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -179,8 +179,16 @@ impl FoldersApi for FoldersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FolderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::FolderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -227,8 +235,16 @@ impl FoldersApi for FoldersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FolderResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::FolderResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -278,8 +294,16 @@ impl FoldersApi for FoldersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FolderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::FolderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -333,8 +357,16 @@ impl FoldersApi for FoldersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FolderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::FolderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::FolderResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-api/src/apis/groups_api.rs b/crates/bitwarden-api-api/src/apis/groups_api.rs index 5ef348a95..d9295b7e9 100644 --- a/crates/bitwarden-api-api/src/apis/groups_api.rs +++ b/crates/bitwarden-api-api/src/apis/groups_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -284,8 +284,16 @@ impl GroupsApi for GroupsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::GroupResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -339,8 +347,16 @@ impl GroupsApi for GroupsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::GroupDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -396,8 +412,16 @@ impl GroupsApi for GroupsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::GroupDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -451,8 +475,16 @@ impl GroupsApi for GroupsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::GroupResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -507,8 +539,16 @@ impl GroupsApi for GroupsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<uuid::Uuid>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<uuid::Uuid>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<uuid::Uuid>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<uuid::Uuid>`" + )))); + } } } else { let local_var_entity: Option = @@ -563,8 +603,16 @@ impl GroupsApi for GroupsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::GroupResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -620,8 +668,16 @@ impl GroupsApi for GroupsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::GroupResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::GroupResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-api/src/apis/hibp_api.rs b/crates/bitwarden-api-api/src/apis/hibp_api.rs index 7fddf6bfd..1973938f7 100644 --- a/crates/bitwarden-api-api/src/apis/hibp_api.rs +++ b/crates/bitwarden-api-api/src/apis/hibp_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 e28c9d462..4381f5a12 100644 --- a/crates/bitwarden-api-api/src/apis/import_ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/import_ciphers_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/info_api.rs b/crates/bitwarden-api-api/src/apis/info_api.rs index f36b75c77..60335d1b3 100644 --- a/crates/bitwarden-api-api/src/apis/info_api.rs +++ b/crates/bitwarden-api-api/src/apis/info_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -77,7 +77,11 @@ impl InfoApi for InfoApiClient { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Ok(local_var_content), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `String`")))), + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/installations_api.rs b/crates/bitwarden-api-api/src/apis/installations_api.rs index 22645a5b8..31416893a 100644 --- a/crates/bitwarden-api-api/src/apis/installations_api.rs +++ b/crates/bitwarden-api-api/src/apis/installations_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -89,8 +89,16 @@ impl InstallationsApi for InstallationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::InstallationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::InstallationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::InstallationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::InstallationResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -139,8 +147,16 @@ impl InstallationsApi for InstallationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::InstallationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::InstallationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::InstallationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::InstallationResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-api/src/apis/invoices_api.rs b/crates/bitwarden-api-api/src/apis/invoices_api.rs index 2faef791f..2fee3f0e6 100644 --- a/crates/bitwarden-api-api/src/apis/invoices_api.rs +++ b/crates/bitwarden-api-api/src/apis/invoices_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/licenses_api.rs b/crates/bitwarden-api-api/src/apis/licenses_api.rs index f831fdc39..ec4ab2cb1 100644 --- a/crates/bitwarden-api-api/src/apis/licenses_api.rs +++ b/crates/bitwarden-api-api/src/apis/licenses_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -98,8 +98,16 @@ impl LicensesApi for LicensesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLicense`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::UserLicense`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::UserLicense`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::UserLicense`" + )))); + } } } else { let local_var_entity: Option = @@ -157,8 +165,16 @@ impl LicensesApi for LicensesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationLicense`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationLicense`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationLicense`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationLicense`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/misc_api.rs b/crates/bitwarden-api-api/src/apis/misc_api.rs index 4c1e3760b..d8d3c659d 100644 --- a/crates/bitwarden-api-api/src/apis/misc_api.rs +++ b/crates/bitwarden-api-api/src/apis/misc_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -84,7 +84,11 @@ impl MiscApi for MiscApiClient { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Ok(local_var_content), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `String`")))), + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`" + )))); + } } } else { let local_var_entity: Option = @@ -131,7 +135,11 @@ impl MiscApi for MiscApiClient { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Ok(local_var_content), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `String`")))), + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/notifications_api.rs b/crates/bitwarden-api-api/src/apis/notifications_api.rs index 7ed689cc3..45f80e08a 100644 --- a/crates/bitwarden-api-api/src/apis/notifications_api.rs +++ b/crates/bitwarden-api-api/src/apis/notifications_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -107,8 +107,16 @@ impl NotificationsApi for NotificationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::NotificationResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::NotificationResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::NotificationResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); 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 877d61c74..0eb90450c 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -164,8 +164,16 @@ impl OrganizationAuthRequestsApi for OrganizationAuthRequestsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PendingOrganizationAuthRequestResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PendingOrganizationAuthRequestResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PendingOrganizationAuthRequestResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PendingOrganizationAuthRequestResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 2c0080de0..22211727e 100644 --- a/crates/bitwarden-api-api/src/apis/organization_billing_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_billing_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 62782f369..c7ecbbbc0 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 461cba8ee..ee5283b06 100644 --- a/crates/bitwarden-api-api/src/apis/organization_connections_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_connections_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -102,8 +102,16 @@ impl OrganizationConnectionsApi for OrganizationConnectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `bool`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `bool`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `bool`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `bool`" + )))); + } } } else { let local_var_entity: Option = @@ -156,8 +164,16 @@ impl OrganizationConnectionsApi for OrganizationConnectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -251,8 +267,16 @@ impl OrganizationConnectionsApi for OrganizationConnectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -307,8 +331,16 @@ impl OrganizationConnectionsApi for OrganizationConnectionsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationConnectionResponseModel`" + )))); + } } } else { let local_var_entity: 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 87e7b27ec..bb084395b 100644 --- a/crates/bitwarden-api-api/src/apis/organization_domain_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_domain_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -132,8 +132,16 @@ impl OrganizationDomainApi for OrganizationDomainApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -185,8 +193,16 @@ impl OrganizationDomainApi for OrganizationDomainApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -243,8 +259,16 @@ impl OrganizationDomainApi for OrganizationDomainApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainSsoDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainSsoDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainSsoDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainSsoDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -303,8 +327,16 @@ impl OrganizationDomainApi for OrganizationDomainApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifiedOrganizationDomainSsoDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::VerifiedOrganizationDomainSsoDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::VerifiedOrganizationDomainSsoDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::VerifiedOrganizationDomainSsoDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -359,8 +391,16 @@ impl OrganizationDomainApi for OrganizationDomainApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -460,8 +500,16 @@ impl OrganizationDomainApi for OrganizationDomainApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationDomainResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationDomainResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 e0c4b2c74..92899be1f 100644 --- a/crates/bitwarden-api-api/src/apis/organization_export_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_export_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 d07f7b87c..1e25802a6 100644 --- a/crates/bitwarden-api-api/src/apis/organization_integration_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_integration_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -107,8 +107,16 @@ impl OrganizationIntegrationApi for OrganizationIntegrationApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -207,8 +215,16 @@ impl OrganizationIntegrationApi for OrganizationIntegrationApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::OrganizationIntegrationResponseModel>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::OrganizationIntegrationResponseModel>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<models::OrganizationIntegrationResponseModel>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::OrganizationIntegrationResponseModel>`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -264,8 +280,16 @@ impl OrganizationIntegrationApi for OrganizationIntegrationApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 c13d5af00..ea6a5c26c 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -122,8 +122,16 @@ impl OrganizationIntegrationConfigurationApi for OrganizationIntegrationConfigur if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -147,7 +155,13 @@ impl OrganizationIntegrationConfigurationApi for OrganizationIntegrationConfigur let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/organizations/{organizationId}/integrations/{integrationId}/configurations/{configurationId}", local_var_configuration.base_path, organizationId=organization_id, integrationId=integration_id, configurationId=configuration_id); + let local_var_uri_str = format!( + "{}/organizations/{organizationId}/integrations/{integrationId}/configurations/{configurationId}", + local_var_configuration.base_path, + organizationId = organization_id, + integrationId = integration_id, + configurationId = configuration_id + ); let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); @@ -221,8 +235,16 @@ impl OrganizationIntegrationConfigurationApi for OrganizationIntegrationConfigur if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::OrganizationIntegrationConfigurationResponseModel>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::OrganizationIntegrationConfigurationResponseModel>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<models::OrganizationIntegrationConfigurationResponseModel>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::OrganizationIntegrationConfigurationResponseModel>`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -248,7 +270,13 @@ impl OrganizationIntegrationConfigurationApi for OrganizationIntegrationConfigur let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/organizations/{organizationId}/integrations/{integrationId}/configurations/{configurationId}", local_var_configuration.base_path, organizationId=organization_id, integrationId=integration_id, configurationId=configuration_id); + let local_var_uri_str = format!( + "{}/organizations/{organizationId}/integrations/{integrationId}/configurations/{configurationId}", + local_var_configuration.base_path, + organizationId = organization_id, + integrationId = integration_id, + configurationId = configuration_id + ); let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); @@ -277,8 +305,16 @@ impl OrganizationIntegrationConfigurationApi for OrganizationIntegrationConfigur if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationIntegrationConfigurationResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/organization_reports_api.rs b/crates/bitwarden-api-api/src/apis/organization_reports_api.rs index e62d2fda0..886558698 100644 --- a/crates/bitwarden-api-api/src/apis/organization_reports_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_reports_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 ace3f7a34..b0b8dabb3 100644 --- a/crates/bitwarden-api-api/src/apis/organization_sponsorships_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_sponsorships_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -248,8 +248,16 @@ impl OrganizationSponsorshipsApi for OrganizationSponsorshipsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -350,8 +358,16 @@ impl OrganizationSponsorshipsApi for OrganizationSponsorshipsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreValidateSponsorshipResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PreValidateSponsorshipResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PreValidateSponsorshipResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PreValidateSponsorshipResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -596,8 +612,16 @@ impl OrganizationSponsorshipsApi for OrganizationSponsorshipsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSponsorshipSyncResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSponsorshipSyncResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationSponsorshipSyncResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSponsorshipSyncResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); 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 979ed09bb..877bdcea6 100644 --- a/crates/bitwarden-api-api/src/apis/organization_users_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_users_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -389,8 +389,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -448,8 +456,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -551,8 +567,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -608,8 +632,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -665,8 +697,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -722,8 +762,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -880,8 +928,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -938,8 +994,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1003,8 +1067,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserUserDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserUserDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserUserDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserUserDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1060,8 +1132,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserUserMiniDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserUserMiniDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserUserMiniDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserUserMiniDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1119,8 +1199,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1557,8 +1645,16 @@ impl OrganizationUsersApi for OrganizationUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserPublicKeyResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserPublicKeyResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationUserPublicKeyResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationUserPublicKeyResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/organizations_api.rs b/crates/bitwarden-api-api/src/apis/organizations_api.rs index 4ace3f847..ba2c5b80a 100644 --- a/crates/bitwarden-api-api/src/apis/organizations_api.rs +++ b/crates/bitwarden-api-api/src/apis/organizations_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -289,8 +289,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -341,8 +349,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationApiKeyInformationListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationApiKeyInformationListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationApiKeyInformationListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationApiKeyInformationListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -395,8 +411,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -495,8 +519,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -549,8 +581,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationAutoEnrollStatusResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationAutoEnrollStatusResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationAutoEnrollStatusResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationAutoEnrollStatusResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -608,8 +648,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationLicense`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationLicense`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationLicense`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationLicense`" + )))); + } } } else { let local_var_entity: Option = @@ -662,8 +710,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlanType`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PlanType`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PlanType`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PlanType`" + )))); + } } } else { let local_var_entity: Option = @@ -716,8 +772,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -770,8 +834,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSsoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSsoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationSsoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSsoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -824,8 +896,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSubscriptionResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSubscriptionResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationSubscriptionResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSubscriptionResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -878,8 +958,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TaxInfoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TaxInfoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TaxInfoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TaxInfoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -928,8 +1016,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1020,8 +1116,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -1173,8 +1277,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationKeysResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationKeysResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationKeysResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationKeysResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1270,8 +1382,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1329,8 +1449,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1385,8 +1513,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSsoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSsoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationSsoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSsoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1441,8 +1577,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1501,8 +1645,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1560,8 +1712,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1616,8 +1776,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1718,8 +1886,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -1776,8 +1952,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1878,8 +2062,16 @@ impl OrganizationsApi for OrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`" + )))); + } } } else { let local_var_entity: 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 272644b87..9d1b89bf0 100644 --- a/crates/bitwarden-api-api/src/apis/phishing_domains_api.rs +++ b/crates/bitwarden-api-api/src/apis/phishing_domains_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -80,7 +80,11 @@ impl PhishingDomainsApi for PhishingDomainsApiClient { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Ok(local_var_content), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `String`")))), + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`" + )))); + } } } else { let local_var_entity: Option = @@ -126,8 +130,16 @@ impl PhishingDomainsApi for PhishingDomainsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<String>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<String>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<String>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<String>`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/plans_api.rs b/crates/bitwarden-api-api/src/apis/plans_api.rs index ce8327ca8..e3290c499 100644 --- a/crates/bitwarden-api-api/src/apis/plans_api.rs +++ b/crates/bitwarden-api-api/src/apis/plans_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -73,8 +73,16 @@ impl PlansApi for PlansApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlanResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PlanResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PlanResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PlanResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-api/src/apis/policies_api.rs b/crates/bitwarden-api-api/src/apis/policies_api.rs index 39eaa5eaa..60b623b76 100644 --- a/crates/bitwarden-api-api/src/apis/policies_api.rs +++ b/crates/bitwarden-api-api/src/apis/policies_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -118,8 +118,16 @@ impl PoliciesApi for PoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PolicyDetailResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyDetailResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PolicyDetailResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyDetailResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -171,8 +179,16 @@ impl PoliciesApi for PoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -240,8 +256,16 @@ impl PoliciesApi for PoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -294,8 +318,16 @@ impl PoliciesApi for PoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -347,8 +379,16 @@ impl PoliciesApi for PoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -399,8 +439,16 @@ impl PoliciesApi for PoliciesApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PolicyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PolicyResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/projects_api.rs b/crates/bitwarden-api-api/src/apis/projects_api.rs index e17c351a0..3ecdf080c 100644 --- a/crates/bitwarden-api-api/src/apis/projects_api.rs +++ b/crates/bitwarden-api-api/src/apis/projects_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -106,8 +106,16 @@ impl ProjectsApi for ProjectsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -162,8 +170,16 @@ impl ProjectsApi for ProjectsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -216,8 +232,16 @@ impl ProjectsApi for ProjectsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -269,8 +293,16 @@ impl ProjectsApi for ProjectsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -325,8 +357,16 @@ impl ProjectsApi for ProjectsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProjectResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProjectResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 089fe3013..d75501d35 100644 --- a/crates/bitwarden-api-api/src/apis/provider_billing_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_billing_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 f3922b859..adaf25883 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 06d33e2ea..d30447942 100644 --- a/crates/bitwarden-api-api/src/apis/provider_clients_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_clients_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 211d0103e..93a686801 100644 --- a/crates/bitwarden-api-api/src/apis/provider_organizations_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_organizations_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -208,8 +208,16 @@ impl ProviderOrganizationsApi for ProviderOrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderOrganizationOrganizationDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderOrganizationOrganizationDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderOrganizationOrganizationDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderOrganizationOrganizationDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -266,8 +274,16 @@ impl ProviderOrganizationsApi for ProviderOrganizationsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderOrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderOrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderOrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderOrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); 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 8b83af532..10084ecf0 100644 --- a/crates/bitwarden-api-api/src/apis/provider_users_api.rs +++ b/crates/bitwarden-api-api/src/apis/provider_users_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -222,8 +222,16 @@ impl ProviderUsersApi for ProviderUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -279,8 +287,16 @@ impl ProviderUsersApi for ProviderUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -336,8 +352,16 @@ impl ProviderUsersApi for ProviderUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserBulkResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -486,8 +510,16 @@ impl ProviderUsersApi for ProviderUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderUserResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderUserResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -540,8 +572,16 @@ impl ProviderUsersApi for ProviderUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderUserUserDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserUserDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderUserUserDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserUserDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -738,8 +778,16 @@ impl ProviderUsersApi for ProviderUsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderUserPublicKeyResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserPublicKeyResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderUserPublicKeyResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderUserPublicKeyResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/providers_api.rs b/crates/bitwarden-api-api/src/apis/providers_api.rs index f57780451..d80ce8653 100644 --- a/crates/bitwarden-api-api/src/apis/providers_api.rs +++ b/crates/bitwarden-api-api/src/apis/providers_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -150,8 +150,16 @@ impl ProvidersApi for ProvidersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -254,8 +262,16 @@ impl ProvidersApi for ProvidersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -309,8 +325,16 @@ impl ProvidersApi for ProvidersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProviderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ProviderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ProviderResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/push_api.rs b/crates/bitwarden-api-api/src/apis/push_api.rs index 0b19c6847..64307615e 100644 --- a/crates/bitwarden-api-api/src/apis/push_api.rs +++ b/crates/bitwarden-api-api/src/apis/push_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/reports_api.rs b/crates/bitwarden-api-api/src/apis/reports_api.rs index fa1d6b0c7..4ff9e54ef 100644 --- a/crates/bitwarden-api-api/src/apis/reports_api.rs +++ b/crates/bitwarden-api-api/src/apis/reports_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -134,8 +134,16 @@ impl ReportsApi for ReportsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordHealthReportApplication`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PasswordHealthReportApplication`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PasswordHealthReportApplication`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PasswordHealthReportApplication`" + )))); + } } } else { let local_var_entity: Option = @@ -194,8 +202,16 @@ impl ReportsApi for ReportsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`" + )))); + } } } else { let local_var_entity: Option = @@ -296,8 +312,16 @@ impl ReportsApi for ReportsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::MemberAccessDetailReportResponseModel>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::MemberAccessDetailReportResponseModel>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<models::MemberAccessDetailReportResponseModel>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::MemberAccessDetailReportResponseModel>`" + )))); + } } } else { let local_var_entity: Option = @@ -351,8 +375,16 @@ impl ReportsApi for ReportsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::MemberCipherDetailsResponseModel>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::MemberCipherDetailsResponseModel>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<models::MemberCipherDetailsResponseModel>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::MemberCipherDetailsResponseModel>`" + )))); + } } } else { let local_var_entity: Option = @@ -408,8 +440,16 @@ impl ReportsApi for ReportsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec<models::PasswordHealthReportApplication>`" + )))); + } } } else { let local_var_entity: 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 05a72d4cb..d558eef8a 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/secrets_api.rs b/crates/bitwarden-api-api/src/apis/secrets_api.rs index f9aa7e65d..55410d708 100644 --- a/crates/bitwarden-api-api/src/apis/secrets_api.rs +++ b/crates/bitwarden-api-api/src/apis/secrets_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -40,7 +40,7 @@ pub trait SecretsApi: Send + Sync { /// GET /secrets/{id} async fn get<'a>(&self, id: uuid::Uuid) - -> Result>; + -> Result>; /// POST /secrets/get-by-ids async fn get_secrets_by_ids<'a>( @@ -123,8 +123,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -179,8 +187,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -233,8 +249,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -283,8 +307,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BaseSecretResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BaseSecretResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::BaseSecretResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BaseSecretResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -337,8 +369,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -396,8 +436,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretsSyncResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretsSyncResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretsSyncResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretsSyncResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -450,8 +498,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -506,8 +562,16 @@ impl SecretsApi for SecretsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 0b975a617..f92ae3001 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -102,8 +102,16 @@ impl SecretsManagerEventsApi for SecretsManagerEventsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EventResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 e793223b0..bdb368d63 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -90,8 +90,16 @@ impl SecretsManagerPortingApi for SecretsManagerPortingApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SmExportResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SmExportResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SmExportResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SmExportResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 9fc8ffce5..7cbc81834 100644 --- a/crates/bitwarden-api-api/src/apis/security_task_api.rs +++ b/crates/bitwarden-api-api/src/apis/security_task_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -114,8 +114,16 @@ impl SecurityTaskApi for SecurityTaskApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -209,8 +217,16 @@ impl SecurityTaskApi for SecurityTaskApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -263,8 +279,16 @@ impl SecurityTaskApi for SecurityTaskApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(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(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTaskMetricsResponseModel`")))), + 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(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTaskMetricsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -323,8 +347,16 @@ impl SecurityTaskApi for SecurityTaskApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecurityTasksResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/self_hosted_account_billing_api.rs b/crates/bitwarden-api-api/src/apis/self_hosted_account_billing_api.rs index 13e74fb50..084c736cb 100644 --- a/crates/bitwarden-api-api/src/apis/self_hosted_account_billing_api.rs +++ b/crates/bitwarden-api-api/src/apis/self_hosted_account_billing_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, 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 76db92363..21a209ce3 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -114,8 +114,16 @@ impl SelfHostedOrganizationLicensesApi for SelfHostedOrganizationLicensesApiClie if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 5ae9128f4..c101c51f1 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 @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -79,7 +79,12 @@ impl SelfHostedOrganizationSponsorshipsApi for SelfHostedOrganizationSponsorship let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/organization/sponsorship/self-hosted/{sponsoringOrgId}/{sponsoredFriendlyName}/revoke", local_var_configuration.base_path, sponsoringOrgId=sponsoring_org_id, sponsoredFriendlyName=crate::apis::urlencode(sponsored_friendly_name)); + let local_var_uri_str = format!( + "{}/organization/sponsorship/self-hosted/{sponsoringOrgId}/{sponsoredFriendlyName}/revoke", + local_var_configuration.base_path, + sponsoringOrgId = sponsoring_org_id, + sponsoredFriendlyName = crate::apis::urlencode(sponsored_friendly_name) + ); let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); @@ -202,8 +207,16 @@ impl SelfHostedOrganizationSponsorshipsApi for SelfHostedOrganizationSponsorship if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OrganizationSponsorshipInvitesResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/sends_api.rs b/crates/bitwarden-api-api/src/apis/sends_api.rs index 7686945a1..68ae84d04 100644 --- a/crates/bitwarden-api-api/src/apis/sends_api.rs +++ b/crates/bitwarden-api-api/src/apis/sends_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -269,8 +269,16 @@ impl SendsApi for SendsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -317,8 +325,16 @@ impl SendsApi for SendsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SendResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -416,8 +432,16 @@ impl SendsApi for SendsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -466,8 +490,16 @@ impl SendsApi for SendsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -568,8 +600,16 @@ impl SendsApi for SendsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -621,8 +661,16 @@ impl SendsApi for SendsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SendResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -677,8 +725,16 @@ impl SendsApi for SendsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SendFileUploadDataResponseModel`" + )))); + } } } else { let local_var_entity: 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 45a53b0b2..c91d9899b 100644 --- a/crates/bitwarden-api-api/src/apis/service_accounts_api.rs +++ b/crates/bitwarden-api-api/src/apis/service_accounts_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -133,8 +133,16 @@ impl ServiceAccountsApi for ServiceAccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::BulkDeleteResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -189,8 +197,16 @@ impl ServiceAccountsApi for ServiceAccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -245,8 +261,16 @@ impl ServiceAccountsApi for ServiceAccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AccessTokenCreationResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AccessTokenCreationResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AccessTokenCreationResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AccessTokenCreationResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -300,8 +324,16 @@ impl ServiceAccountsApi for ServiceAccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AccessTokenResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AccessTokenResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::AccessTokenResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AccessTokenResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -354,8 +386,16 @@ impl ServiceAccountsApi for ServiceAccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -416,8 +456,16 @@ impl ServiceAccountsApi for ServiceAccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountSecretsDetailsResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountSecretsDetailsResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountSecretsDetailsResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountSecretsDetailsResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -518,8 +566,16 @@ impl ServiceAccountsApi for ServiceAccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::ServiceAccountResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::ServiceAccountResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/settings_api.rs b/crates/bitwarden-api-api/src/apis/settings_api.rs index 731f79251..b3860fb8f 100644 --- a/crates/bitwarden-api-api/src/apis/settings_api.rs +++ b/crates/bitwarden-api-api/src/apis/settings_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -89,8 +89,16 @@ impl SettingsApi for SettingsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DomainsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DomainsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DomainsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DomainsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -140,8 +148,16 @@ impl SettingsApi for SettingsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DomainsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DomainsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::DomainsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DomainsResponseModel`" + )))); + } } } else { let local_var_entity: 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 073198c7c..68941bea1 100644 --- a/crates/bitwarden-api-api/src/apis/slack_integration_api.rs +++ b/crates/bitwarden-api-api/src/apis/slack_integration_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/stripe_api.rs b/crates/bitwarden-api-api/src/apis/stripe_api.rs index 11aeadcb9..73f30dc7a 100644 --- a/crates/bitwarden-api-api/src/apis/stripe_api.rs +++ b/crates/bitwarden-api-api/src/apis/stripe_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/sync_api.rs b/crates/bitwarden-api-api/src/apis/sync_api.rs index 48ae91218..c50210bc0 100644 --- a/crates/bitwarden-api-api/src/apis/sync_api.rs +++ b/crates/bitwarden-api-api/src/apis/sync_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -83,8 +83,16 @@ impl SyncApi for SyncApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SyncResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SyncResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SyncResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-api/src/apis/tax_api.rs b/crates/bitwarden-api-api/src/apis/tax_api.rs index 5038cd166..aef66e425 100644 --- a/crates/bitwarden-api-api/src/apis/tax_api.rs +++ b/crates/bitwarden-api-api/src/apis/tax_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-api-api/src/apis/trash_api.rs b/crates/bitwarden-api-api/src/apis/trash_api.rs index 1c591fd5a..b9c476ae5 100644 --- a/crates/bitwarden-api-api/src/apis/trash_api.rs +++ b/crates/bitwarden-api-api/src/apis/trash_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -143,8 +143,16 @@ impl TrashApi for TrashApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::SecretWithProjectsListResponseModel`" + )))); + } } } else { let local_var_entity: Option = 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 746abacac..f532cb0ed 100644 --- a/crates/bitwarden-api-api/src/apis/two_factor_api.rs +++ b/crates/bitwarden-api-api/src/apis/two_factor_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -214,8 +214,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -271,8 +279,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -320,8 +336,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); @@ -373,8 +397,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -424,8 +456,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -476,8 +516,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -531,8 +579,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -587,8 +643,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -641,8 +705,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoverResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorRecoverResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoverResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorRecoverResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -695,8 +767,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -749,8 +829,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -806,8 +894,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorAuthenticatorResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -857,8 +953,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -908,8 +1012,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -959,8 +1071,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorEmailResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1015,8 +1135,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorProviderResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1071,8 +1199,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorDuoResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1123,8 +1259,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorWebAuthnResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -1177,8 +1321,16 @@ impl TwoFactorApi for TwoFactorApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TwoFactorYubiKeyResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-api/src/apis/users_api.rs b/crates/bitwarden-api-api/src/apis/users_api.rs index 1b0686a67..aa66a7d5b 100644 --- a/crates/bitwarden-api-api/src/apis/users_api.rs +++ b/crates/bitwarden-api-api/src/apis/users_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -77,8 +77,16 @@ impl UsersApi for UsersApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKeyResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::UserKeyResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::UserKeyResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::UserKeyResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); 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 44495a293..1c3d958b9 100644 --- a/crates/bitwarden-api-api/src/apis/web_authn_api.rs +++ b/crates/bitwarden-api-api/src/apis/web_authn_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -118,8 +118,16 @@ impl WebAuthnApi for WebAuthnApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -173,8 +181,16 @@ impl WebAuthnApi for WebAuthnApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialCreateOptionsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnCredentialCreateOptionsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialCreateOptionsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnCredentialCreateOptionsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -268,8 +284,16 @@ impl WebAuthnApi for WebAuthnApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponseModelListResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnCredentialResponseModelListResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponseModelListResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnCredentialResponseModelListResponseModel`" + )))); + } } } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); diff --git a/crates/bitwarden-api-identity/src/apis/accounts_api.rs b/crates/bitwarden-api-identity/src/apis/accounts_api.rs index cbfe499ba..2574cbb9f 100644 --- a/crates/bitwarden-api-identity/src/apis/accounts_api.rs +++ b/crates/bitwarden-api-identity/src/apis/accounts_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -119,8 +119,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::WebAuthnLoginAssertionOptionsResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -167,8 +175,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreloginResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PreloginResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::PreloginResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::PreloginResponseModel`" + )))); + } } } else { let local_var_entity: Option = @@ -218,8 +234,16 @@ impl AccountsApi for AccountsApiClient { if !local_var_status.is_client_error() && !local_var_status.is_server_error() { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterFinishResponseModel`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::RegisterFinishResponseModel`")))), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to `models::RegisterFinishResponseModel`", + ))); + } + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::RegisterFinishResponseModel`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-identity/src/apis/info_api.rs b/crates/bitwarden-api-identity/src/apis/info_api.rs index ab4d4919e..c11229fe9 100644 --- a/crates/bitwarden-api-identity/src/apis/info_api.rs +++ b/crates/bitwarden-api-identity/src/apis/info_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, @@ -74,7 +74,11 @@ impl InfoApi for InfoApiClient { match local_var_content_type { ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), ContentType::Text => return Ok(local_var_content), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `String`")))), + ContentType::Unsupported(local_var_unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`" + )))); + } } } else { let local_var_entity: Option = diff --git a/crates/bitwarden-api-identity/src/apis/sso_api.rs b/crates/bitwarden-api-identity/src/apis/sso_api.rs index 34bed743b..70d1c4088 100644 --- a/crates/bitwarden-api-identity/src/apis/sso_api.rs +++ b/crates/bitwarden-api-identity/src/apis/sso_api.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; #[cfg(feature = "mockall")] use mockall::automock; use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Error as _}; -use super::{configuration, Error}; +use super::{Error, configuration}; use crate::{ apis::{ContentType, ResponseContent}, models, diff --git a/crates/bitwarden-auth/src/send_access/api/token_api_error_response.rs b/crates/bitwarden-auth/src/send_access/api/token_api_error_response.rs index 16d693f27..1c17cca0c 100644 --- a/crates/bitwarden-auth/src/send_access/api/token_api_error_response.rs +++ b/crates/bitwarden-auth/src/send_access/api/token_api_error_response.rs @@ -133,7 +133,7 @@ mod tests { use super::*; mod send_access_token_invalid_request_error_tests { - use serde_json::{from_str, json, to_string, to_value, Value}; + use serde_json::{Value, from_str, json, to_string, to_value}; use super::*; @@ -307,7 +307,7 @@ mod tests { } mod send_access_token_invalid_grant_error_tests { - use serde_json::{from_str, json, to_string, to_value, Value}; + use serde_json::{Value, from_str, json, to_string, to_value}; use super::*; diff --git a/crates/bitwarden-auth/src/send_access/client.rs b/crates/bitwarden-auth/src/send_access/client.rs index cfebb7847..f79a9014f 100644 --- a/crates/bitwarden-auth/src/send_access/client.rs +++ b/crates/bitwarden-auth/src/send_access/client.rs @@ -3,12 +3,12 @@ use bitwarden_core::Client; use wasm_bindgen::prelude::*; use crate::send_access::{ + SendAccessTokenError, SendAccessTokenRequest, SendAccessTokenResponse, access_token_response::UnexpectedIdentityError, api::{ SendAccessTokenApiErrorResponse, SendAccessTokenApiSuccessResponse, SendAccessTokenRequestPayload, }, - SendAccessTokenError, SendAccessTokenRequest, SendAccessTokenResponse, }; /// The `SendAccessClient` is used to interact with the Bitwarden API to get send access tokens. @@ -100,22 +100,22 @@ mod tests { use bitwarden_core::{Client as CoreClient, ClientSettings, DeviceType}; use bitwarden_test::start_api_mock; use wiremock::{ - matchers::{self, body_string_contains}, Mock, MockServer, ResponseTemplate, + matchers::{self, body_string_contains}, }; use crate::{ + AuthClientExt, api::enums::{GrantType, Scope}, send_access::{ + SendAccessClient, SendAccessCredentials, SendAccessTokenError, SendAccessTokenRequest, + SendAccessTokenResponse, SendEmailCredentials, SendEmailOtpCredentials, + SendPasswordCredentials, UnexpectedIdentityError, api::{ SendAccessTokenApiErrorResponse, SendAccessTokenInvalidGrantError, SendAccessTokenInvalidRequestError, }, - SendAccessClient, SendAccessCredentials, SendAccessTokenError, SendAccessTokenRequest, - SendAccessTokenResponse, SendEmailCredentials, SendEmailOtpCredentials, - SendPasswordCredentials, UnexpectedIdentityError, }, - AuthClientExt, }; fn make_send_client(mock_server: &MockServer) -> SendAccessClient { diff --git a/crates/bitwarden-cli/src/lib.rs b/crates/bitwarden-cli/src/lib.rs index 5a2b310af..8658a254a 100644 --- a/crates/bitwarden-cli/src/lib.rs +++ b/crates/bitwarden-cli/src/lib.rs @@ -2,8 +2,8 @@ mod color; -pub use color::{install_color_eyre, Color}; -use inquire::{error::InquireResult, Text}; +pub use color::{Color, install_color_eyre}; +use inquire::{Text, error::InquireResult}; /// Prompt the user for input if the value is None /// diff --git a/crates/bitwarden-collections/src/collection.rs b/crates/bitwarden-collections/src/collection.rs index 17e062741..7a13a1ea0 100644 --- a/crates/bitwarden-collections/src/collection.rs +++ b/crates/bitwarden-collections/src/collection.rs @@ -1,7 +1,8 @@ use bitwarden_api_api::models::CollectionDetailsResponseModel; use bitwarden_core::{ + OrganizationId, key_management::{KeyIds, SymmetricKeyId}, - require, OrganizationId, + require, }; use bitwarden_crypto::{CryptoError, Decryptable, EncString, IdentifyKey, KeyStoreContext}; use bitwarden_uuid::uuid_newtype; diff --git a/crates/bitwarden-collections/src/tree.rs b/crates/bitwarden-collections/src/tree.rs index 6195e1dc8..0589ad1f6 100644 --- a/crates/bitwarden-collections/src/tree.rs +++ b/crates/bitwarden-collections/src/tree.rs @@ -222,8 +222,8 @@ mod tests { } #[test] - fn given_collection_with_one_parent_and_two_children_when_getting_parent_then_parent_is_returned_with_children_and_no_parent( - ) { + fn given_collection_with_one_parent_and_two_children_when_getting_parent_then_parent_is_returned_with_children_and_no_parent() + { let parent_id = Uuid::new_v4(); let items = vec![ TestItem { @@ -258,8 +258,8 @@ mod tests { } #[test] - fn given_collection_with_one_parent_and_two_children_when_getting_child1_then_child1_is_returned_with_no_children_and_a_parent( - ) { + fn given_collection_with_one_parent_and_two_children_when_getting_child1_then_child1_is_returned_with_no_children_and_a_parent() + { let child_1_id = Uuid::new_v4(); let parent_id = Uuid::new_v4(); let items = vec![ diff --git a/crates/bitwarden-core/src/admin_console/policy.rs b/crates/bitwarden-core/src/admin_console/policy.rs index 718ed14af..5db183d28 100644 --- a/crates/bitwarden-core/src/admin_console/policy.rs +++ b/crates/bitwarden-core/src/admin_console/policy.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; use uuid::Uuid; -use crate::{require, MissingFieldError}; +use crate::{MissingFieldError, require}; /// Represents a policy that can be applied to an organization. #[derive(Serialize, Deserialize, Debug)] diff --git a/crates/bitwarden-core/src/auth/access_token.rs b/crates/bitwarden-core/src/auth/access_token.rs index d2b2f59a7..6c17dc4d7 100644 --- a/crates/bitwarden-core/src/auth/access_token.rs +++ b/crates/bitwarden-core/src/auth/access_token.rs @@ -1,7 +1,7 @@ use std::{fmt::Debug, str::FromStr}; -use bitwarden_crypto::{derive_shareable_key, SymmetricCryptoKey}; -use bitwarden_encoding::{NotB64EncodedError, B64}; +use bitwarden_crypto::{SymmetricCryptoKey, derive_shareable_key}; +use bitwarden_encoding::{B64, NotB64EncodedError}; use thiserror::Error; use uuid::Uuid; use zeroize::Zeroizing; @@ -101,7 +101,10 @@ mod tests { "ec2c1d46-6a4b-4751-a310-af9601317f2d" ); assert_eq!(token.client_secret, "C2IgxjjLF7qSshsbwe8JGcbM075YXw"); - assert_eq!(token.encryption_key.to_base64().to_string(), "H9/oIRLtL9nGCQOVDjSMoEbJsjWXSOCb3qeyDt6ckzS3FhyboEDWyTP/CQfbIszNmAVg2ExFganG1FVFGXO/Jg=="); + assert_eq!( + token.encryption_key.to_base64().to_string(), + "H9/oIRLtL9nGCQOVDjSMoEbJsjWXSOCb3qeyDt6ckzS3FhyboEDWyTP/CQfbIszNmAVg2ExFganG1FVFGXO/Jg==" + ); } #[test] diff --git a/crates/bitwarden-core/src/auth/api/request/auth_request_token_request.rs b/crates/bitwarden-core/src/auth/api/request/auth_request_token_request.rs index ffce20d27..9d210519b 100644 --- a/crates/bitwarden-core/src/auth/api/request/auth_request_token_request.rs +++ b/crates/bitwarden-core/src/auth/api/request/auth_request_token_request.rs @@ -3,9 +3,9 @@ use serde::{Deserialize, Serialize}; use uuid::Uuid; use crate::{ + DeviceType, auth::{api::response::IdentityTokenResponse, login::LoginError}, client::ApiConfigurations, - DeviceType, }; #[derive(Serialize, Deserialize, Debug)] diff --git a/crates/bitwarden-core/src/auth/api/request/mod.rs b/crates/bitwarden-core/src/auth/api/request/mod.rs index 03be54dd2..dd5472dd9 100644 --- a/crates/bitwarden-core/src/auth/api/request/mod.rs +++ b/crates/bitwarden-core/src/auth/api/request/mod.rs @@ -19,12 +19,12 @@ mod auth_request_token_request; pub(crate) use auth_request_token_request::*; use crate::{ + ApiError, auth::{ - api::response::{parse_identity_response, IdentityTokenResponse}, + api::response::{IdentityTokenResponse, parse_identity_response}, login::LoginError, }, client::ApiConfigurations, - ApiError, }; pub(crate) async fn send_identity_connect_request( diff --git a/crates/bitwarden-core/src/auth/api/request/password_token_request.rs b/crates/bitwarden-core/src/auth/api/request/password_token_request.rs index 2edce0f7a..abec26ee2 100644 --- a/crates/bitwarden-core/src/auth/api/request/password_token_request.rs +++ b/crates/bitwarden-core/src/auth/api/request/password_token_request.rs @@ -2,12 +2,12 @@ use log::debug; use serde::{Deserialize, Serialize}; use crate::{ + DeviceType, auth::{ api::response::IdentityTokenResponse, login::{LoginError, TwoFactorProvider, TwoFactorRequest}, }, client::ApiConfigurations, - DeviceType, }; #[derive(Serialize, Deserialize, Debug)] diff --git a/crates/bitwarden-core/src/auth/api/response/identity_token_response.rs b/crates/bitwarden-core/src/auth/api/response/identity_token_response.rs index 4b438cff2..4e620c160 100644 --- a/crates/bitwarden-core/src/auth/api/response/identity_token_response.rs +++ b/crates/bitwarden-core/src/auth/api/response/identity_token_response.rs @@ -2,6 +2,7 @@ use reqwest::StatusCode; use serde::{Deserialize, Serialize}; use crate::{ + ApiError, auth::{ api::response::{ IdentityTokenFailResponse, IdentityTokenPayloadResponse, IdentityTokenRefreshResponse, @@ -9,7 +10,6 @@ use crate::{ }, login::LoginError, }, - ApiError, }; #[derive(Debug, Serialize, Deserialize, PartialEq)] diff --git a/crates/bitwarden-core/src/auth/auth_client.rs b/crates/bitwarden-core/src/auth/auth_client.rs index a033b1536..b1d4909fa 100644 --- a/crates/bitwarden-core/src/auth/auth_client.rs +++ b/crates/bitwarden-core/src/auth/auth_client.rs @@ -6,32 +6,32 @@ use bitwarden_crypto::{ use bitwarden_encoding::B64; #[cfg(feature = "secrets")] -use crate::auth::login::{login_access_token, AccessTokenLoginRequest, AccessTokenLoginResponse}; +use crate::auth::login::{AccessTokenLoginRequest, AccessTokenLoginResponse, login_access_token}; +use crate::{ + Client, + auth::{login::LoginError, renew::renew_token}, +}; #[cfg(feature = "internal")] use crate::{ auth::{ - auth_request::{approve_auth_request, new_auth_request, ApproveAuthRequestError}, - key_connector::{make_key_connector_keys, KeyConnectorResponse}, + AuthRequestResponse, AuthValidateError, RegisterKeyResponse, + auth_request::{ApproveAuthRequestError, approve_auth_request, new_auth_request}, + key_connector::{KeyConnectorResponse, make_key_connector_keys}, login::{ - login_api_key, login_password, send_two_factor_email, ApiKeyLoginRequest, - ApiKeyLoginResponse, NewAuthRequestResponse, PasswordLoginRequest, + ApiKeyLoginRequest, ApiKeyLoginResponse, NewAuthRequestResponse, PasswordLoginRequest, PasswordLoginResponse, PreloginError, TwoFactorEmailError, TwoFactorEmailRequest, + login_api_key, login_password, send_two_factor_email, }, password::{ - password_strength, satisfies_policy, validate_password, validate_password_user_key, - MasterPasswordPolicyOptions, + MasterPasswordPolicyOptions, password_strength, satisfies_policy, validate_password, + validate_password_user_key, }, pin::validate_pin, register::make_register_keys, - tde::{make_register_tde_keys, RegisterTdeKeyResponse}, - AuthRequestResponse, AuthValidateError, RegisterKeyResponse, + tde::{RegisterTdeKeyResponse, make_register_tde_keys}, }, client::encryption_settings::EncryptionSettingsError, }; -use crate::{ - auth::{login::LoginError, renew::renew_token}, - Client, -}; #[allow(missing_docs)] pub struct AuthClient { diff --git a/crates/bitwarden-core/src/auth/auth_request.rs b/crates/bitwarden-core/src/auth/auth_request.rs index 098b9d10c..7382e3b80 100644 --- a/crates/bitwarden-core/src/auth/auth_request.rs +++ b/crates/bitwarden-core/src/auth/auth_request.rs @@ -1,6 +1,6 @@ use bitwarden_crypto::{ - fingerprint, generate_random_alphanumeric, AsymmetricCryptoKey, AsymmetricPublicCryptoKey, - CryptoError, PublicKeyEncryptionAlgorithm, SpkiPublicKeyBytes, UnsignedSharedKey, + AsymmetricCryptoKey, AsymmetricPublicCryptoKey, CryptoError, PublicKeyEncryptionAlgorithm, + SpkiPublicKeyBytes, UnsignedSharedKey, fingerprint, generate_random_alphanumeric, }; #[cfg(feature = "internal")] use bitwarden_crypto::{EncString, SymmetricCryptoKey}; @@ -10,7 +10,7 @@ use thiserror::Error; #[cfg(feature = "internal")] use crate::client::encryption_settings::EncryptionSettingsError; -use crate::{key_management::SymmetricKeyId, Client}; +use crate::{Client, key_management::SymmetricKeyId}; /// Response for `new_auth_request`. #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] @@ -111,12 +111,12 @@ mod tests { use super::*; use crate::{ + UserId, client::internal::UserKeyState, key_management::{ - crypto::{AuthRequestMethod, InitUserCryptoMethod, InitUserCryptoRequest}, SymmetricKeyId, + crypto::{AuthRequestMethod, InitUserCryptoMethod, InitUserCryptoRequest}, }, - UserId, }; #[test] diff --git a/crates/bitwarden-core/src/auth/login/access_token.rs b/crates/bitwarden-core/src/auth/login/access_token.rs index 917f020e6..b3ef0ee3d 100644 --- a/crates/bitwarden-core/src/auth/login/access_token.rs +++ b/crates/bitwarden-core/src/auth/login/access_token.rs @@ -8,15 +8,15 @@ use serde::{Deserialize, Serialize}; use super::LoginError; use crate::{ + Client, OrganizationId, auth::{ - api::{request::AccessTokenRequest, response::IdentityTokenResponse}, - login::{response::two_factor::TwoFactorProviders, PasswordLoginResponse}, AccessToken, JwtToken, + api::{request::AccessTokenRequest, response::IdentityTokenResponse}, + login::{PasswordLoginResponse, response::two_factor::TwoFactorProviders}, }, client::{LoginMethod, ServiceAccountLoginMethod}, require, secrets_manager::state::{self, ClientState}, - Client, OrganizationId, }; pub(crate) async fn login_access_token( diff --git a/crates/bitwarden-core/src/auth/login/api_key.rs b/crates/bitwarden-core/src/auth/login/api_key.rs index 408347485..9573637e0 100644 --- a/crates/bitwarden-core/src/auth/login/api_key.rs +++ b/crates/bitwarden-core/src/auth/login/api_key.rs @@ -3,13 +3,14 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ + Client, auth::{ - api::{request::ApiTokenRequest, response::IdentityTokenResponse}, - login::{response::two_factor::TwoFactorProviders, LoginError, PasswordLoginResponse}, JwtToken, + api::{request::ApiTokenRequest, response::IdentityTokenResponse}, + login::{LoginError, PasswordLoginResponse, response::two_factor::TwoFactorProviders}, }, - client::{internal::UserKeyState, LoginMethod, UserLoginMethod}, - require, Client, + client::{LoginMethod, UserLoginMethod, internal::UserKeyState}, + require, }; pub(crate) async fn login_api_key( diff --git a/crates/bitwarden-core/src/auth/login/auth_request.rs b/crates/bitwarden-core/src/auth/login/auth_request.rs index 2739e48bc..71f1abf5a 100644 --- a/crates/bitwarden-core/src/auth/login/auth_request.rs +++ b/crates/bitwarden-core/src/auth/login/auth_request.rs @@ -5,13 +5,14 @@ use uuid::Uuid; use super::LoginError; use crate::{ + ApiError, Client, auth::{ api::{request::AuthRequestTokenRequest, response::IdentityTokenResponse}, auth_request::new_auth_request, }, client::{LoginMethod, UserLoginMethod}, key_management::crypto::{AuthRequestMethod, InitUserCryptoMethod, InitUserCryptoRequest}, - require, ApiError, Client, + require, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-core/src/auth/login/password.rs b/crates/bitwarden-core/src/auth/login/password.rs index 704bca2c8..950c68f7b 100644 --- a/crates/bitwarden-core/src/auth/login/password.rs +++ b/crates/bitwarden-core/src/auth/login/password.rs @@ -10,9 +10,9 @@ use crate::auth::{ }; #[cfg(feature = "internal")] use crate::{ + Client, auth::{api::request::PasswordTokenRequest, login::LoginError, login::TwoFactorRequest}, client::LoginMethod, - Client, }; #[cfg(feature = "internal")] @@ -23,7 +23,7 @@ pub(crate) async fn login_password( use bitwarden_crypto::{EncString, HashPurpose, MasterKey}; use crate::{ - client::{internal::UserKeyState, UserLoginMethod}, + client::{UserLoginMethod, internal::UserKeyState}, require, }; diff --git a/crates/bitwarden-core/src/auth/login/prelogin.rs b/crates/bitwarden-core/src/auth/login/prelogin.rs index a3efe4b5c..6c1539759 100644 --- a/crates/bitwarden-core/src/auth/login/prelogin.rs +++ b/crates/bitwarden-core/src/auth/login/prelogin.rs @@ -2,7 +2,7 @@ use bitwarden_api_identity::models::{PreloginRequestModel, PreloginResponseModel use bitwarden_crypto::Kdf; use thiserror::Error; -use crate::{require, ApiError, Client, MissingFieldError}; +use crate::{ApiError, Client, MissingFieldError, require}; #[allow(missing_docs)] #[derive(Debug, Error)] diff --git a/crates/bitwarden-core/src/auth/login/two_factor.rs b/crates/bitwarden-core/src/auth/login/two_factor.rs index 9c08c65a0..ad7dd3b97 100644 --- a/crates/bitwarden-core/src/auth/login/two_factor.rs +++ b/crates/bitwarden-core/src/auth/login/two_factor.rs @@ -6,8 +6,8 @@ use serde_repr::{Deserialize_repr, Serialize_repr}; use thiserror::Error; use crate::{ - auth::{login::PreloginError, password::determine_password_hash}, ApiError, Client, + auth::{login::PreloginError, password::determine_password_hash}, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-core/src/auth/mod.rs b/crates/bitwarden-core/src/auth/mod.rs index 4c9f7ef0a..b2542b1c5 100644 --- a/crates/bitwarden-core/src/auth/mod.rs +++ b/crates/bitwarden-core/src/auth/mod.rs @@ -30,9 +30,9 @@ pub use jwt_token::*; #[cfg(feature = "internal")] mod auth_request; #[cfg(feature = "internal")] -pub(crate) use auth_request::{auth_request_decrypt_master_key, auth_request_decrypt_user_key}; -#[cfg(feature = "internal")] pub use auth_request::{ApproveAuthRequestError, AuthRequestResponse}; +#[cfg(feature = "internal")] +pub(crate) use auth_request::{auth_request_decrypt_master_key, auth_request_decrypt_user_key}; #[cfg(feature = "internal")] mod register; diff --git a/crates/bitwarden-core/src/auth/password/mod.rs b/crates/bitwarden-core/src/auth/password/mod.rs index b6bd01f8b..753abefa5 100644 --- a/crates/bitwarden-core/src/auth/password/mod.rs +++ b/crates/bitwarden-core/src/auth/password/mod.rs @@ -2,8 +2,8 @@ use bitwarden_crypto::{CryptoError, HashPurpose, Kdf, MasterKey}; mod policy; use bitwarden_encoding::B64; -pub(crate) use policy::satisfies_policy; pub use policy::MasterPasswordPolicyOptions; +pub(crate) use policy::satisfies_policy; mod validate; pub(crate) use validate::{validate_password, validate_password_user_key}; mod strength; diff --git a/crates/bitwarden-core/src/auth/password/policy.rs b/crates/bitwarden-core/src/auth/password/policy.rs index 2c54d4439..ddcbc8a03 100644 --- a/crates/bitwarden-core/src/auth/password/policy.rs +++ b/crates/bitwarden-core/src/auth/password/policy.rs @@ -52,7 +52,7 @@ pub struct MasterPasswordPolicyOptions { #[cfg(test)] mod tests { - use super::{satisfies_policy, MasterPasswordPolicyOptions}; + use super::{MasterPasswordPolicyOptions, satisfies_policy}; #[test] fn satisfies_policy_gives_success() { diff --git a/crates/bitwarden-core/src/auth/password/validate.rs b/crates/bitwarden-core/src/auth/password/validate.rs index 1a8544188..272592a1d 100644 --- a/crates/bitwarden-core/src/auth/password/validate.rs +++ b/crates/bitwarden-core/src/auth/password/validate.rs @@ -2,9 +2,9 @@ use bitwarden_crypto::{HashPurpose, MasterKey}; use bitwarden_encoding::B64; use crate::{ - auth::{password::determine_password_hash, AuthValidateError}, - client::{LoginMethod, UserLoginMethod}, Client, NotAuthenticatedError, WrongPasswordError, + auth::{AuthValidateError, password::determine_password_hash}, + client::{LoginMethod, UserLoginMethod}, }; /// Validate if the provided password matches the password hash stored in the client. diff --git a/crates/bitwarden-core/src/auth/pin.rs b/crates/bitwarden-core/src/auth/pin.rs index 63e490d59..75cf3bda1 100644 --- a/crates/bitwarden-core/src/auth/pin.rs +++ b/crates/bitwarden-core/src/auth/pin.rs @@ -1,10 +1,10 @@ use bitwarden_crypto::{EncString, PinKey}; use crate::{ + Client, NotAuthenticatedError, auth::AuthValidateError, client::{LoginMethod, UserLoginMethod}, key_management::SymmetricKeyId, - Client, NotAuthenticatedError, }; pub(crate) fn validate_pin( @@ -49,7 +49,7 @@ mod tests { use bitwarden_crypto::{Kdf, MasterKey}; use super::*; - use crate::client::{internal::UserKeyState, Client, LoginMethod, UserLoginMethod}; + use crate::client::{Client, LoginMethod, UserLoginMethod, internal::UserKeyState}; fn init_client() -> Client { let client = Client::new(None); diff --git a/crates/bitwarden-core/src/auth/renew.rs b/crates/bitwarden-core/src/auth/renew.rs index 959977f32..a62cd604a 100644 --- a/crates/bitwarden-core/src/auth/renew.rs +++ b/crates/bitwarden-core/src/auth/renew.rs @@ -3,6 +3,14 @@ use std::sync::Arc; use chrono::Utc; use super::login::LoginError; +use crate::{ + NotAuthenticatedError, + auth::api::{request::ApiTokenRequest, response::IdentityTokenResponse}, + client::{ + LoginMethod, UserLoginMethod, + internal::{ClientManagedTokens, InternalClient, SdkManagedTokens, Tokens}, + }, +}; #[cfg(feature = "secrets")] use crate::{ auth::api::request::AccessTokenRequest, @@ -10,14 +18,6 @@ use crate::{ key_management::SymmetricKeyId, secrets_manager::state::{self, ClientState}, }; -use crate::{ - auth::api::{request::ApiTokenRequest, response::IdentityTokenResponse}, - client::{ - internal::{ClientManagedTokens, InternalClient, SdkManagedTokens, Tokens}, - LoginMethod, UserLoginMethod, - }, - NotAuthenticatedError, -}; pub(crate) async fn renew_token(client: &InternalClient) -> Result<(), LoginError> { let tokens_guard = client diff --git a/crates/bitwarden-core/src/auth/tde.rs b/crates/bitwarden-core/src/auth/tde.rs index 3bedb2b53..a9ae6c0f2 100644 --- a/crates/bitwarden-core/src/auth/tde.rs +++ b/crates/bitwarden-core/src/auth/tde.rs @@ -5,8 +5,8 @@ use bitwarden_crypto::{ use bitwarden_encoding::B64; use crate::{ - client::{encryption_settings::EncryptionSettingsError, internal::UserKeyState}, Client, + client::{encryption_settings::EncryptionSettingsError, internal::UserKeyState}, }; /// This function generates a new user key and key pair, initializes the client's crypto with the diff --git a/crates/bitwarden-core/src/client/encryption_settings.rs b/crates/bitwarden-core/src/client/encryption_settings.rs index dddfb20ce..d7411bc86 100644 --- a/crates/bitwarden-core/src/client/encryption_settings.rs +++ b/crates/bitwarden-core/src/client/encryption_settings.rs @@ -13,13 +13,13 @@ use bitwarden_error::bitwarden_error; use log::warn; use thiserror::Error; +#[cfg(any(feature = "secrets", feature = "internal"))] +use crate::OrganizationId; #[cfg(feature = "internal")] use crate::key_management::{AsymmetricKeyId, SecurityState, SignedSecurityState, SigningKeyId}; #[cfg(any(feature = "internal", feature = "secrets"))] use crate::key_management::{KeyIds, SymmetricKeyId}; -#[cfg(any(feature = "secrets", feature = "internal"))] -use crate::OrganizationId; -use crate::{error::UserIdAlreadySetError, MissingPrivateKeyError}; +use crate::{MissingPrivateKeyError, error::UserIdAlreadySetError}; #[allow(missing_docs)] #[bitwarden_error(flat)] diff --git a/crates/bitwarden-core/src/client/internal.rs b/crates/bitwarden-core/src/client/internal.rs index f9e821234..591041177 100644 --- a/crates/bitwarden-core/src/client/internal.rs +++ b/crates/bitwarden-core/src/client/internal.rs @@ -14,8 +14,8 @@ use crate::client::encryption_settings::EncryptionSettings; #[cfg(feature = "secrets")] use crate::client::login_method::ServiceAccountLoginMethod; use crate::{ - auth::renew::renew_token, client::login_method::LoginMethod, error::UserIdAlreadySetError, - key_management::KeyIds, DeviceType, OrganizationId, UserId, + DeviceType, OrganizationId, UserId, auth::renew::renew_token, + client::login_method::LoginMethod, error::UserIdAlreadySetError, key_management::KeyIds, }; #[cfg(feature = "internal")] use crate::{ @@ -26,8 +26,8 @@ use crate::{ }, error::NotAuthenticatedError, key_management::{ - crypto::InitUserCryptoRequest, PasswordProtectedKeyEnvelope, SecurityState, - SignedSecurityState, + PasswordProtectedKeyEnvelope, SecurityState, SignedSecurityState, + crypto::InitUserCryptoRequest, }, }; diff --git a/crates/bitwarden-core/src/client/login_method.rs b/crates/bitwarden-core/src/client/login_method.rs index f412976fa..fe4c77549 100644 --- a/crates/bitwarden-core/src/client/login_method.rs +++ b/crates/bitwarden-core/src/client/login_method.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; use bitwarden_crypto::Kdf; #[cfg(feature = "secrets")] -use crate::{auth::AccessToken, OrganizationId}; +use crate::{OrganizationId, auth::AccessToken}; #[derive(Debug)] pub(crate) enum LoginMethod { diff --git a/crates/bitwarden-core/src/client/test_accounts.rs b/crates/bitwarden-core/src/client/test_accounts.rs index 0e27577b7..59be107ea 100644 --- a/crates/bitwarden-core/src/client/test_accounts.rs +++ b/crates/bitwarden-core/src/client/test_accounts.rs @@ -4,8 +4,8 @@ use std::collections::HashMap; use bitwarden_crypto::{EncString, Kdf}; use crate::{ - key_management::crypto::{InitOrgCryptoRequest, InitUserCryptoMethod, InitUserCryptoRequest}, Client, UserId, + key_management::crypto::{InitOrgCryptoRequest, InitUserCryptoMethod, InitUserCryptoRequest}, }; impl Client { diff --git a/crates/bitwarden-core/src/key_management/crypto.rs b/crates/bitwarden-core/src/key_management/crypto.rs index 5f69122ec..aa53b9245 100644 --- a/crates/bitwarden-core/src/key_management/crypto.rs +++ b/crates/bitwarden-core/src/key_management/crypto.rs @@ -7,11 +7,10 @@ use std::collections::HashMap; use bitwarden_crypto::{ - dangerous_get_v2_rotated_account_keys, safe::PasswordProtectedKeyEnvelopeError, AsymmetricCryptoKey, CoseSerializable, CryptoError, EncString, Kdf, KeyDecryptable, KeyEncryptable, MasterKey, Pkcs8PrivateKeyBytes, PrimitiveEncryptable, SignatureAlgorithm, SignedPublicKey, SigningKey, SpkiPublicKeyBytes, SymmetricCryptoKey, UnsignedSharedKey, - UserKey, + UserKey, dangerous_get_v2_rotated_account_keys, safe::PasswordProtectedKeyEnvelopeError, }; use bitwarden_encoding::B64; use bitwarden_error::bitwarden_error; @@ -21,14 +20,14 @@ use serde::{Deserialize, Serialize}; use {tsify::Tsify, wasm_bindgen::prelude::*}; use crate::{ - client::{encryption_settings::EncryptionSettingsError, LoginMethod, UserLoginMethod}, + Client, NotAuthenticatedError, OrganizationId, UserId, WrongPasswordError, + client::{LoginMethod, UserLoginMethod, encryption_settings::EncryptionSettingsError}, error::StatefulCryptoError, key_management::{ + AsymmetricKeyId, SecurityState, SignedSecurityState, SigningKeyId, SymmetricKeyId, master_password::{MasterPasswordAuthenticationData, MasterPasswordUnlockData}, non_generic_wrappers::PasswordProtectedKeyEnvelope, - AsymmetricKeyId, SecurityState, SignedSecurityState, SigningKeyId, SymmetricKeyId, }, - Client, NotAuthenticatedError, OrganizationId, UserId, WrongPasswordError, }; /// Catch all error for mobile crypto operations. @@ -828,7 +827,7 @@ mod tests { use bitwarden_crypto::RsaKeyPair; use super::*; - use crate::{client::internal::UserKeyState, Client}; + use crate::{Client, client::internal::UserKeyState}; const TEST_VECTOR_USER_KEY_V2_B64: &str = "pQEEAlACHUUoybNAuJoZzqNMxz2bAzoAARFvBIQDBAUGIFggAvGl4ifaUAomQdCdUPpXLHtypiQxHjZwRHeI83caZM4B"; const TEST_VECTOR_PRIVATE_KEY_V2: &str = "7.g1gdowE6AAERbwMZARwEUAIdRSjJs0C4mhnOo0zHPZuhBVgYthGLGqVLPeidY8mNMxpLJn3fyeSxyaWsWQTR6pxmRV2DyGZXly/0l9KK+Rsfetl9wvYIz0O4/RW3R6wf7eGxo5XmicV3WnFsoAmIQObxkKWShxFyjzg+ocKItQDzG7Gp6+MW4biTrAlfK51ML/ZS+PCjLmgI1QQr4eMHjiwA2TBKtKkxfjoTJkMXECpRVLEXOo8/mbIGYkuabbSA7oU+TJ0yXlfKDtD25gnyO7tjW/0JMFUaoEKRJOuKoXTN4n/ks4Hbxk0X5/DzfG05rxWad2UNBjNg7ehW99WrQ+33ckdQFKMQOri/rt8JzzrF1k11/jMJ+Y2TADKNHr91NalnUX+yqZAAe3sRt5Pv5ZhLIwRMKQi/1NrLcsQPRuUnogVSPOoMnE/eD6F70iU60Z6pvm1iBw2IvELZcrs/oxpO2SeCue08fIZW/jNZokbLnm90tQ7QeZTUpiPALhUgfGOa3J9VOJ7jQGCqDjd9CzV2DCVfhKCapeTbldm+RwEWBz5VvorH5vMx1AzbPRJxdIQuxcg3NqRrXrYC7fyZljWaPB9qP1tztiPtd1PpGEgxLByIfR6fqyZMCvOBsWbd0H6NhF8mNVdDw60+skFRdbRBTSCjCtKZeLVuVFb8ioH45PR5oXjtx4atIDzu6DKm6TTMCbR6DjZuZZ8GbwHxuUD2mDD3pAFhaof9kR3lQdjy7Zb4EzUUYskQxzcLPcqzp9ZgB3Rg91SStBCCMhdQ6AnhTy+VTGt/mY5AbBXNRSL6fI0r+P9K8CcEI4bNZCDkwwQr5v4O4ykSUzIvmVU0zKzDngy9bteIZuhkvGUoZlQ9UATNGPhoLfqq2eSvqEXkCbxTVZ5D+Ww9pHmWeVcvoBhcl5MvicfeQt++dY3tPjIfZq87nlugG4HiNbcv9nbVpgwe3v8cFetWXQgnO4uhx8JHSwGoSuxHFZtl2sdahjTHavRHnYjSABEFrViUKgb12UDD5ow1GAL62wVdSJKRf9HlLbJhN3PBxuh5L/E0wy1wGA9ecXtw/R1ktvXZ7RklGAt1TmNzZv6vI2J/CMXvndOX9rEpjKMbwbIDAjQ9PxiWdcnmc5SowT9f6yfIjbjXnRMWWidPAua7sgrtej4HP4Qjz1fpgLMLCRyF97tbMTmsAI5Cuj98Buh9PwcdyXj5SbVuHdJS1ehv9b5SWPsD4pwOm3+otVNK6FTazhoUl47AZoAoQzXfsXxrzqYzvF0yJkCnk9S1dcij1L569gQ43CJO6o6jIZFJvA4EmZDl95ELu+BC+x37Ip8dq4JLPsANDVSqvXO9tfDUIXEx25AaOYhW2KAUoDve/fbsU8d0UZR1o/w+ZrOQwawCIPeVPtbh7KFRVQi/rPI+Abl6XR6qMJbKPegliYGUuGF2oEMEc6QLTsMRCEPuw0S3kxbNfVPqml8nGhB2r8zUHBY1diJEmipVghnwH74gIKnyJ2C9nKjV8noUfKzqyV8vxUX2G5yXgodx8Jn0cWs3XhWuApFla9z4R28W/4jA1jK2WQMlx+b6xKUWgRk8+fYsc0HSt2fDrQ9pLpnjb8ME59RCxSPV++PThpnR2JtastZBZur2hBIJsGILCAmufUU4VC4gBKPhNfu/OK4Ktgz+uQlUa9fEC/FnkpTRQPxHuQjSQSNrIIyW1bIRBtnwjvvvNoui9FZJ"; #[allow(unused)] diff --git a/crates/bitwarden-core/src/key_management/crypto_client.rs b/crates/bitwarden-core/src/key_management/crypto_client.rs index 148027d5f..08a18168f 100644 --- a/crates/bitwarden-core/src/key_management/crypto_client.rs +++ b/crates/bitwarden-core/src/key_management/crypto_client.rs @@ -6,30 +6,30 @@ use bitwarden_encoding::B64; use wasm_bindgen::prelude::*; use super::crypto::{ - derive_key_connector, make_key_pair, verify_asymmetric_keys, DeriveKeyConnectorError, - DeriveKeyConnectorRequest, EnrollAdminPasswordResetError, MakeKeyPairResponse, - VerifyAsymmetricKeysRequest, VerifyAsymmetricKeysResponse, + DeriveKeyConnectorError, DeriveKeyConnectorRequest, EnrollAdminPasswordResetError, + MakeKeyPairResponse, VerifyAsymmetricKeysRequest, VerifyAsymmetricKeysResponse, + derive_key_connector, make_key_pair, verify_asymmetric_keys, }; #[cfg(any(feature = "wasm", test))] use crate::key_management::PasswordProtectedKeyEnvelope; #[cfg(feature = "internal")] use crate::key_management::{ + SymmetricKeyId, crypto::{ + DerivePinKeyResponse, InitOrgCryptoRequest, InitUserCryptoRequest, UpdatePasswordResponse, derive_pin_key, derive_pin_user_key, enroll_admin_password_reset, get_user_encryption_key, - initialize_org_crypto, initialize_user_crypto, DerivePinKeyResponse, InitOrgCryptoRequest, - InitUserCryptoRequest, UpdatePasswordResponse, + initialize_org_crypto, initialize_user_crypto, }, - SymmetricKeyId, }; use crate::{ + Client, client::encryption_settings::EncryptionSettingsError, error::StatefulCryptoError, key_management::crypto::{ + CryptoClientError, EnrollPinResponse, UpdateKdfResponse, UserCryptoV2KeysResponse, enroll_pin, get_v2_rotated_account_keys, make_update_kdf, make_update_password, - make_v2_keys_for_v1_user, CryptoClientError, EnrollPinResponse, UpdateKdfResponse, - UserCryptoV2KeysResponse, + make_v2_keys_for_v1_user, }, - Client, }; /// A client for the crypto operations. diff --git a/crates/bitwarden-core/src/key_management/master_password.rs b/crates/bitwarden-core/src/key_management/master_password.rs index 1246174e1..20074e158 100644 --- a/crates/bitwarden-core/src/key_management/master_password.rs +++ b/crates/bitwarden-core/src/key_management/master_password.rs @@ -1,7 +1,7 @@ use std::num::NonZeroU32; use bitwarden_api_api::models::{ - master_password_unlock_response_model::MasterPasswordUnlockResponseModel, KdfType, + KdfType, master_password_unlock_response_model::MasterPasswordUnlockResponseModel, }; use bitwarden_crypto::{EncString, Kdf, MasterKey, SymmetricCryptoKey}; use bitwarden_encoding::B64; @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "wasm")] use wasm_bindgen::prelude::*; -use crate::{require, MissingFieldError}; +use crate::{MissingFieldError, require}; /// Error for master password related operations. #[allow(dead_code)] @@ -265,8 +265,8 @@ mod tests { } #[test] - fn test_try_from_master_password_unlock_response_model_invalid_user_key_encryption_kdf_malformed_error( - ) { + fn test_try_from_master_password_unlock_response_model_invalid_user_key_encryption_kdf_malformed_error() + { let response = create_pbkdf2_response( Some(TEST_INVALID_USER_KEY.to_string()), Some(TEST_SALT.to_string()), @@ -307,8 +307,8 @@ mod tests { } #[test] - fn test_try_from_master_password_unlock_response_model_argon2id_kdf_memory_none_missing_field_error( - ) { + fn test_try_from_master_password_unlock_response_model_argon2id_kdf_memory_none_missing_field_error() + { let response = MasterPasswordUnlockResponseModel { kdf: Box::new(MasterPasswordUnlockKdfResponseModel { kdf_type: KdfType::Argon2id, @@ -330,8 +330,8 @@ mod tests { } #[test] - fn test_try_from_master_password_unlock_response_model_argon2id_kdf_memory_zero_kdf_malformed_error( - ) { + fn test_try_from_master_password_unlock_response_model_argon2id_kdf_memory_zero_kdf_malformed_error() + { let response = MasterPasswordUnlockResponseModel { kdf: Box::new(MasterPasswordUnlockKdfResponseModel { kdf_type: KdfType::Argon2id, @@ -348,8 +348,8 @@ mod tests { } #[test] - fn test_try_from_master_password_unlock_response_model_argon2id_kdf_parallelism_none_missing_field_error( - ) { + fn test_try_from_master_password_unlock_response_model_argon2id_kdf_parallelism_none_missing_field_error() + { let response = MasterPasswordUnlockResponseModel { kdf: Box::new(MasterPasswordUnlockKdfResponseModel { kdf_type: KdfType::Argon2id, @@ -371,8 +371,8 @@ mod tests { } #[test] - fn test_try_from_master_password_unlock_response_model_argon2id_kdf_parallelism_zero_kdf_malformed_error( - ) { + fn test_try_from_master_password_unlock_response_model_argon2id_kdf_parallelism_zero_kdf_malformed_error() + { let response = MasterPasswordUnlockResponseModel { kdf: Box::new(MasterPasswordUnlockKdfResponseModel { kdf_type: KdfType::Argon2id, @@ -389,8 +389,8 @@ mod tests { } #[test] - fn test_try_from_master_password_unlock_response_model_pbkdf2_kdf_iterations_zero_kdf_malformed_error( - ) { + fn test_try_from_master_password_unlock_response_model_pbkdf2_kdf_iterations_zero_kdf_malformed_error() + { let response = create_pbkdf2_response( Some(TEST_USER_KEY.to_string()), Some(TEST_SALT.to_string()), @@ -402,8 +402,8 @@ mod tests { } #[test] - fn test_try_from_master_password_unlock_response_model_argon2id_kdf_iterations_zero_kdf_malformed_error( - ) { + fn test_try_from_master_password_unlock_response_model_argon2id_kdf_iterations_zero_kdf_malformed_error() + { let response = MasterPasswordUnlockResponseModel { kdf: Box::new(MasterPasswordUnlockKdfResponseModel { kdf_type: KdfType::Argon2id, diff --git a/crates/bitwarden-core/src/key_management/mod.rs b/crates/bitwarden-core/src/key_management/mod.rs index 2e5c39254..a7718cdfe 100644 --- a/crates/bitwarden-core/src/key_management/mod.rs +++ b/crates/bitwarden-core/src/key_management/mod.rs @@ -10,7 +10,7 @@ //! [CompositeEncryptable](bitwarden_crypto::CompositeEncryptable), and //! [Decryptable](bitwarden_crypto::Decryptable). -use bitwarden_crypto::{key_ids, KeyStore, SymmetricCryptoKey}; +use bitwarden_crypto::{KeyStore, SymmetricCryptoKey, key_ids}; #[cfg(feature = "internal")] pub mod crypto; diff --git a/crates/bitwarden-core/src/key_management/security_state.rs b/crates/bitwarden-core/src/key_management/security_state.rs index d724382c1..6f8690ed3 100644 --- a/crates/bitwarden-core/src/key_management/security_state.rs +++ b/crates/bitwarden-core/src/key_management/security_state.rs @@ -26,7 +26,7 @@ use bitwarden_crypto::{ CoseSerializable, CoseSign1Bytes, CryptoError, EncodingError, KeyIds, KeyStoreContext, SignedObject, SigningNamespace, VerifyingKey, }; -use bitwarden_encoding::{FromStrVisitor, B64}; +use bitwarden_encoding::{B64, FromStrVisitor}; use serde::{Deserialize, Serialize}; use crate::UserId; diff --git a/crates/bitwarden-core/src/mobile/client_kdf.rs b/crates/bitwarden-core/src/mobile/client_kdf.rs index ab1509425..bf31ccf07 100644 --- a/crates/bitwarden-core/src/mobile/client_kdf.rs +++ b/crates/bitwarden-core/src/mobile/client_kdf.rs @@ -1,7 +1,7 @@ use bitwarden_crypto::{CryptoError, HashPurpose, Kdf}; use bitwarden_encoding::B64; -use crate::{mobile::kdf::hash_password, Client}; +use crate::{Client, mobile::kdf::hash_password}; /// A client for the KDF operations. pub struct KdfClient { diff --git a/crates/bitwarden-core/src/platform/generate_fingerprint.rs b/crates/bitwarden-core/src/platform/generate_fingerprint.rs index 98764b207..eb8b26eeb 100644 --- a/crates/bitwarden-core/src/platform/generate_fingerprint.rs +++ b/crates/bitwarden-core/src/platform/generate_fingerprint.rs @@ -2,12 +2,12 @@ //! //! This module contains the logic for generating fingerprints. -use bitwarden_crypto::{fingerprint, SpkiPublicKeyBytes}; +use bitwarden_crypto::{SpkiPublicKeyBytes, fingerprint}; use bitwarden_encoding::B64; use serde::{Deserialize, Serialize}; use thiserror::Error; -use crate::{key_management::AsymmetricKeyId, MissingPrivateKeyError}; +use crate::{MissingPrivateKeyError, key_management::AsymmetricKeyId}; /// Request to generate a fingerprint. #[derive(Serialize, Deserialize, Debug)] @@ -81,7 +81,7 @@ mod tests { use bitwarden_crypto::{Kdf, MasterKey}; use super::*; - use crate::{client::internal::UserKeyState, Client}; + use crate::{Client, client::internal::UserKeyState}; #[test] fn test_generate_user_fingerprint() { diff --git a/crates/bitwarden-core/src/platform/get_user_api_key.rs b/crates/bitwarden-core/src/platform/get_user_api_key.rs index 4f4240060..ddd71720f 100644 --- a/crates/bitwarden-core/src/platform/get_user_api_key.rs +++ b/crates/bitwarden-core/src/platform/get_user_api_key.rs @@ -22,8 +22,9 @@ use thiserror::Error; use super::SecretVerificationRequest; use crate::{ + ApiError, Client, MissingFieldError, NotAuthenticatedError, client::{LoginMethod, UserLoginMethod}, - require, ApiError, Client, MissingFieldError, NotAuthenticatedError, + require, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-core/src/platform/platform_client.rs b/crates/bitwarden-core/src/platform/platform_client.rs index 140252c19..a16b5d1fb 100644 --- a/crates/bitwarden-core/src/platform/platform_client.rs +++ b/crates/bitwarden-core/src/platform/platform_client.rs @@ -1,10 +1,11 @@ use crate::{ + Client, platform::{ + FingerprintError, FingerprintRequest, SecretVerificationRequest, UserApiKeyError, + UserApiKeyResponse, UserFingerprintError, generate_fingerprint::{generate_fingerprint, generate_user_fingerprint}, - get_user_api_key, FingerprintError, FingerprintRequest, SecretVerificationRequest, - UserApiKeyError, UserApiKeyResponse, UserFingerprintError, + get_user_api_key, }, - Client, }; /// Wrapper for platform specific functionality. diff --git a/crates/bitwarden-core/src/platform/state_client.rs b/crates/bitwarden-core/src/platform/state_client.rs index 819a57e14..c208b1fc3 100644 --- a/crates/bitwarden-core/src/platform/state_client.rs +++ b/crates/bitwarden-core/src/platform/state_client.rs @@ -1,9 +1,9 @@ use std::sync::Arc; use bitwarden_state::{ + DatabaseConfiguration, registry::{RepositoryNotFoundError, StateRegistryError}, repository::{Repository, RepositoryItem, RepositoryMigrations}, - DatabaseConfiguration, }; use crate::Client; diff --git a/crates/bitwarden-core/tests/register.rs b/crates/bitwarden-core/tests/register.rs index 11a2ea872..dcb8e4097 100644 --- a/crates/bitwarden-core/tests/register.rs +++ b/crates/bitwarden-core/tests/register.rs @@ -7,8 +7,8 @@ async fn test_register_initialize_crypto() { use std::num::NonZeroU32; use bitwarden_core::{ - key_management::crypto::{InitUserCryptoMethod, InitUserCryptoRequest}, Client, UserId, + key_management::crypto::{InitUserCryptoMethod, InitUserCryptoRequest}, }; use bitwarden_crypto::Kdf; diff --git a/crates/bitwarden-crypto/benches/default_allocator.rs b/crates/bitwarden-crypto/benches/default_allocator.rs index 82ab1d209..b41adde86 100644 --- a/crates/bitwarden-crypto/benches/default_allocator.rs +++ b/crates/bitwarden-crypto/benches/default_allocator.rs @@ -2,7 +2,7 @@ use std::hint::black_box; -use criterion::{criterion_group, criterion_main, Criterion}; +use criterion::{Criterion, criterion_group, criterion_main}; fn allocate_string(s: &str) -> String { s.to_owned() diff --git a/crates/bitwarden-crypto/examples/protect_key_with_password.rs b/crates/bitwarden-crypto/examples/protect_key_with_password.rs index 3aa57fca0..5c80cfc33 100644 --- a/crates/bitwarden-crypto/examples/protect_key_with_password.rs +++ b/crates/bitwarden-crypto/examples/protect_key_with_password.rs @@ -2,9 +2,8 @@ //! [PasswordProtectedKeyEnvelope]. use bitwarden_crypto::{ - key_ids, + KeyStore, KeyStoreContext, key_ids, safe::{PasswordProtectedKeyEnvelope, PasswordProtectedKeyEnvelopeError}, - KeyStore, KeyStoreContext, }; fn main() { diff --git a/crates/bitwarden-crypto/src/aes.rs b/crates/bitwarden-crypto/src/aes.rs index 20151fece..309f7f946 100644 --- a/crates/bitwarden-crypto/src/aes.rs +++ b/crates/bitwarden-crypto/src/aes.rs @@ -5,7 +5,7 @@ //! In most cases you should use the [EncString][crate::EncString] with //! [KeyEncryptable][crate::KeyEncryptable] & [KeyDecryptable][crate::KeyDecryptable] instead. -use aes::cipher::{block_padding::Pkcs7, BlockDecryptMut, BlockEncryptMut, KeyIvInit}; +use aes::cipher::{BlockDecryptMut, BlockEncryptMut, KeyIvInit, block_padding::Pkcs7}; use generic_array::GenericArray; use hmac::Mac; use subtle::ConstantTimeEq; @@ -13,7 +13,7 @@ use typenum::U32; use crate::{ error::{CryptoError, Result}, - util::{PbkdfSha256Hmac, PBKDF_SHA256_HMAC_OUT_SIZE}, + util::{PBKDF_SHA256_HMAC_OUT_SIZE, PbkdfSha256Hmac}, }; /// Decrypt using AES-256 in CBC mode. @@ -106,7 +106,7 @@ fn generate_mac(mac_key: &[u8], iv: &[u8], data: &[u8]) -> Result<[u8; 32]> { #[cfg(test)] mod tests { use bitwarden_encoding::B64; - use generic_array::{sequence::GenericSequence, ArrayLength}; + use generic_array::{ArrayLength, sequence::GenericSequence}; use rand::SeedableRng; use super::*; @@ -135,8 +135,12 @@ mod tests { assert_eq!( result, ( - [62, 0, 239, 47, 137, 95, 64, 214, 127, 91, 184, 232, 31, 9, 165, 161], - vec![214, 76, 187, 97, 58, 146, 212, 140, 95, 164, 177, 204, 179, 133, 172, 148] + [ + 62, 0, 239, 47, 137, 95, 64, 214, 127, 91, 184, 232, 31, 9, 165, 161 + ], + vec![ + 214, 76, 187, 97, 58, 146, 212, 140, 95, 164, 177, 204, 179, 133, 172, 148 + ] ) ); } diff --git a/crates/bitwarden-crypto/src/content_format.rs b/crates/bitwarden-crypto/src/content_format.rs index e53033abe..dd96a2351 100644 --- a/crates/bitwarden-crypto/src/content_format.rs +++ b/crates/bitwarden-crypto/src/content_format.rs @@ -2,9 +2,8 @@ use bitwarden_encoding::B64; use serde::{Deserialize, Serialize}; use crate::{ - traits::PrimitiveEncryptableWithContentType, CryptoError, EncString, KeyEncryptable, - KeyEncryptableWithContentType, KeyIds, KeyStoreContext, PrimitiveEncryptable, - SymmetricCryptoKey, + CryptoError, EncString, KeyEncryptable, KeyEncryptableWithContentType, KeyIds, KeyStoreContext, + PrimitiveEncryptable, SymmetricCryptoKey, traits::PrimitiveEncryptableWithContentType, }; /// The content format describes the format of the contained bytes. Message encryption always diff --git a/crates/bitwarden-crypto/src/cose.rs b/crates/bitwarden-crypto/src/cose.rs index a253e091e..879053899 100644 --- a/crates/bitwarden-crypto/src/cose.rs +++ b/crates/bitwarden-crypto/src/cose.rs @@ -4,17 +4,18 @@ //! be documented publicly. use coset::{ - iana::{self, CoapContentFormat}, CborSerializable, ContentType, Header, Label, + iana::{self, CoapContentFormat}, }; use generic_array::GenericArray; use thiserror::Error; use typenum::U32; use crate::{ + ContentFormat, CryptoError, SymmetricCryptoKey, XChaCha20Poly1305Key, content_format::{Bytes, ConstContentFormat, CoseContentFormat}, error::{EncStringParseError, EncodingError}, - xchacha20, ContentFormat, CryptoError, SymmetricCryptoKey, XChaCha20Poly1305Key, + xchacha20, }; /// XChaCha20 is used over ChaCha20 diff --git a/crates/bitwarden-crypto/src/enc_string/asymmetric.rs b/crates/bitwarden-crypto/src/enc_string/asymmetric.rs index 846f90fd1..b748987fe 100644 --- a/crates/bitwarden-crypto/src/enc_string/asymmetric.rs +++ b/crates/bitwarden-crypto/src/enc_string/asymmetric.rs @@ -1,16 +1,16 @@ use std::{borrow::Cow, fmt::Display, str::FromStr}; -use bitwarden_encoding::{FromStrVisitor, B64}; +use bitwarden_encoding::{B64, FromStrVisitor}; pub use internal::UnsignedSharedKey; use rsa::Oaep; use serde::Deserialize; use super::{from_b64_vec, split_enc_string}; use crate::{ - error::{CryptoError, EncStringParseError, Result}, - rsa::encrypt_rsa2048_oaep_sha1, AsymmetricCryptoKey, AsymmetricPublicCryptoKey, BitwardenLegacyKeyBytes, RawPrivateKey, RawPublicKey, SymmetricCryptoKey, + error::{CryptoError, EncStringParseError, Result}, + rsa::encrypt_rsa2048_oaep_sha1, }; // This module is a workaround to avoid deprecated warnings that come from the ZeroizeOnDrop // macro expansion diff --git a/crates/bitwarden-crypto/src/enc_string/symmetric.rs b/crates/bitwarden-crypto/src/enc_string/symmetric.rs index 950c5d868..e739ec115 100644 --- a/crates/bitwarden-crypto/src/enc_string/symmetric.rs +++ b/crates/bitwarden-crypto/src/enc_string/symmetric.rs @@ -1,14 +1,14 @@ use std::{borrow::Cow, str::FromStr}; -use bitwarden_encoding::{FromStrVisitor, B64}; +use bitwarden_encoding::{B64, FromStrVisitor}; use coset::CborSerializable; use serde::Deserialize; use super::{check_length, from_b64, from_b64_vec, split_enc_string}; use crate::{ - error::{CryptoError, EncStringParseError, Result, UnsupportedOperationError}, Aes256CbcHmacKey, ContentFormat, KeyDecryptable, KeyEncryptable, KeyEncryptableWithContentType, SymmetricCryptoKey, Utf8Bytes, XChaCha20Poly1305Key, + error::{CryptoError, EncStringParseError, Result, UnsupportedOperationError}, }; #[cfg(feature = "wasm")] @@ -360,8 +360,8 @@ mod tests { use super::EncString; use crate::{ - derive_symmetric_key, CryptoError, KeyDecryptable, KeyEncryptable, SymmetricCryptoKey, - KEY_ID_SIZE, + CryptoError, KEY_ID_SIZE, KeyDecryptable, KeyEncryptable, SymmetricCryptoKey, + derive_symmetric_key, }; fn encrypt_with_xchacha20(plaintext: &str) -> EncString { @@ -512,11 +512,15 @@ mod tests { if let EncString::Aes256Cbc_B64 { iv, data } = &enc_string { assert_eq!( iv, - &[164, 196, 186, 254, 39, 19, 64, 0, 109, 186, 92, 57, 218, 154, 182, 150] + &[ + 164, 196, 186, 254, 39, 19, 64, 0, 109, 186, 92, 57, 218, 154, 182, 150 + ] ); assert_eq!( data, - &[93, 118, 241, 43, 16, 211, 135, 233, 150, 136, 221, 71, 140, 125, 141, 215] + &[ + 93, 118, 241, 43, 16, 211, 135, 233, 150, 136, 221, 71, 140, 125, 141, 215 + ] ); } else { panic!("Invalid variant") @@ -568,7 +572,7 @@ mod tests { #[test] fn test_debug_format() { - let enc_str = "2.pMS6/icTQABtulw52pq2lg==|XXbxKxDTh+mWiN1HjH2N1w==|Q6PkuT+KX/axrgN9ubD5Ajk2YNwxQkgs3WJM0S0wtG8="; + let enc_str = "2.pMS6/icTQABtulw52pq2lg==|XXbxKxDTh+mWiN1HjH2N1w==|Q6PkuT+KX/axrgN9ubD5Ajk2YNwxQkgs3WJM0S0wtG8="; let enc_string: EncString = enc_str.parse().unwrap(); let debug_string = format!("{enc_string:?}"); diff --git a/crates/bitwarden-crypto/src/fingerprint.rs b/crates/bitwarden-crypto/src/fingerprint.rs index 22307e977..c4d60c3fc 100644 --- a/crates/bitwarden-crypto/src/fingerprint.rs +++ b/crates/bitwarden-crypto/src/fingerprint.rs @@ -8,7 +8,7 @@ use num_bigint::BigUint; use num_traits::cast::ToPrimitive; use thiserror::Error; -use crate::{error::Result, wordlist::EFF_LONG_WORD_LIST, CryptoError, SpkiPublicKeyBytes}; +use crate::{CryptoError, SpkiPublicKeyBytes, error::Result, wordlist::EFF_LONG_WORD_LIST}; /// Computes a fingerprint of the given `fingerprint_material` using the given `public_key`. /// diff --git a/crates/bitwarden-crypto/src/keys/asymmetric_crypto_key.rs b/crates/bitwarden-crypto/src/keys/asymmetric_crypto_key.rs index 82c6e0392..75b1907c2 100644 --- a/crates/bitwarden-crypto/src/keys/asymmetric_crypto_key.rs +++ b/crates/bitwarden-crypto/src/keys/asymmetric_crypto_key.rs @@ -1,12 +1,12 @@ use std::pin::Pin; -use rsa::{pkcs8::DecodePublicKey, RsaPrivateKey, RsaPublicKey}; +use rsa::{RsaPrivateKey, RsaPublicKey, pkcs8::DecodePublicKey}; use serde_repr::{Deserialize_repr, Serialize_repr}; use super::key_encryptable::CryptoKey; use crate::{ - error::{CryptoError, Result}, Pkcs8PrivateKeyBytes, SpkiPublicKeyBytes, + error::{CryptoError, Result}, }; /// Algorithm / public key encryption scheme used for encryption/decryption. @@ -165,9 +165,9 @@ mod tests { use bitwarden_encoding::B64; use crate::{ - content_format::{Bytes, Pkcs8PrivateKeyDerContentFormat}, AsymmetricCryptoKey, AsymmetricPublicCryptoKey, Pkcs8PrivateKeyBytes, SpkiPublicKeyBytes, SymmetricCryptoKey, UnsignedSharedKey, + content_format::{Bytes, Pkcs8PrivateKeyDerContentFormat}, }; #[test] diff --git a/crates/bitwarden-crypto/src/keys/device_key.rs b/crates/bitwarden-crypto/src/keys/device_key.rs index 96c4f0a7d..a9b8be12d 100644 --- a/crates/bitwarden-crypto/src/keys/device_key.rs +++ b/crates/bitwarden-crypto/src/keys/device_key.rs @@ -2,8 +2,8 @@ use bitwarden_encoding::B64; use super::{AsymmetricCryptoKey, PublicKeyEncryptionAlgorithm}; use crate::{ - error::Result, CryptoError, EncString, KeyDecryptable, KeyEncryptable, Pkcs8PrivateKeyBytes, - SymmetricCryptoKey, UnsignedSharedKey, + CryptoError, EncString, KeyDecryptable, KeyEncryptable, Pkcs8PrivateKeyBytes, + SymmetricCryptoKey, UnsignedSharedKey, error::Result, }; /// Device Key @@ -91,7 +91,7 @@ impl TryFrom for DeviceKey { #[cfg(test)] mod tests { use super::*; - use crate::{derive_symmetric_key, BitwardenLegacyKeyBytes}; + use crate::{BitwardenLegacyKeyBytes, derive_symmetric_key}; #[test] fn test_trust_device() { diff --git a/crates/bitwarden-crypto/src/keys/key_encryptable.rs b/crates/bitwarden-crypto/src/keys/key_encryptable.rs index c3516f656..ff79b496d 100644 --- a/crates/bitwarden-crypto/src/keys/key_encryptable.rs +++ b/crates/bitwarden-crypto/src/keys/key_encryptable.rs @@ -3,7 +3,7 @@ use std::{collections::HashMap, hash::Hash, sync::Arc}; use rayon::prelude::*; use uuid::Uuid; -use crate::{error::Result, ContentFormat, CryptoError, SymmetricCryptoKey}; +use crate::{ContentFormat, CryptoError, SymmetricCryptoKey, error::Result}; #[allow(missing_docs)] pub trait KeyContainer: Send + Sync { @@ -77,10 +77,10 @@ impl, Key: CryptoKey, Output> KeyDecryptable + Send + Sync, - Key: CryptoKey + Send + Sync, - Output: Send + Sync, - > KeyEncryptable> for Vec + T: KeyEncryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, +> KeyEncryptable> for Vec { fn encrypt_with_key(self, key: &Key) -> Result> { self.into_par_iter() @@ -90,10 +90,10 @@ impl< } impl< - T: KeyDecryptable + Send + Sync, - Key: CryptoKey + Send + Sync, - Output: Send + Sync, - > KeyDecryptable> for Vec + T: KeyDecryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, +> KeyDecryptable> for Vec { fn decrypt_with_key(&self, key: &Key) -> Result> { self.into_par_iter() @@ -103,11 +103,11 @@ impl< } impl< - T: KeyEncryptable + Send + Sync, - Key: CryptoKey + Send + Sync, - Output: Send + Sync, - Id: Hash + Eq + Send + Sync, - > KeyEncryptable> for HashMap + T: KeyEncryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, + Id: Hash + Eq + Send + Sync, +> KeyEncryptable> for HashMap { fn encrypt_with_key(self, key: &Key) -> Result> { self.into_par_iter() @@ -117,11 +117,11 @@ impl< } impl< - T: KeyDecryptable + Send + Sync, - Key: CryptoKey + Send + Sync, - Output: Send + Sync, - Id: Hash + Eq + Copy + Send + Sync, - > KeyDecryptable> for HashMap + T: KeyDecryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, + Id: Hash + Eq + Copy + Send + Sync, +> KeyDecryptable> for HashMap { fn decrypt_with_key(&self, key: &Key) -> Result> { self.into_par_iter() diff --git a/crates/bitwarden-crypto/src/keys/master_key.rs b/crates/bitwarden-crypto/src/keys/master_key.rs index 74fc0d90d..fb2ab08f3 100644 --- a/crates/bitwarden-crypto/src/keys/master_key.rs +++ b/crates/bitwarden-crypto/src/keys/master_key.rs @@ -11,9 +11,9 @@ use super::{ utils::stretch_key, }; use crate::{ - util::{self}, BitwardenLegacyKeyBytes, CryptoError, EncString, KeyDecryptable, Result, SymmetricCryptoKey, UserKey, + util::{self}, }; #[allow(missing_docs)] @@ -184,10 +184,10 @@ mod tests { use rand::SeedableRng; - use super::{make_user_key, HashPurpose, Kdf, MasterKey}; + use super::{HashPurpose, Kdf, MasterKey, make_user_key}; use crate::{ - keys::{master_key::KdfDerivedKeyMaterial, symmetric_crypto_key::derive_symmetric_key}, EncString, SymmetricCryptoKey, + keys::{master_key::KdfDerivedKeyMaterial, symmetric_crypto_key::derive_symmetric_key}, }; #[test] diff --git a/crates/bitwarden-crypto/src/keys/mod.rs b/crates/bitwarden-crypto/src/keys/mod.rs index d6eb65f38..1e6cda4db 100644 --- a/crates/bitwarden-crypto/src/keys/mod.rs +++ b/crates/bitwarden-crypto/src/keys/mod.rs @@ -29,8 +29,8 @@ mod kdf; pub use kdf::dangerous_derive_kdf_material; mod key_id; pub use kdf::{ - default_argon2_iterations, default_argon2_memory, default_argon2_parallelism, - default_pbkdf2_iterations, Kdf, + Kdf, default_argon2_iterations, default_argon2_memory, default_argon2_parallelism, + default_pbkdf2_iterations, }; -pub(crate) use key_id::{KeyId, KEY_ID_SIZE}; +pub(crate) use key_id::{KEY_ID_SIZE, KeyId}; pub(crate) mod utils; diff --git a/crates/bitwarden-crypto/src/keys/pin_key.rs b/crates/bitwarden-crypto/src/keys/pin_key.rs index a1503a5ad..e4956adaf 100644 --- a/crates/bitwarden-crypto/src/keys/pin_key.rs +++ b/crates/bitwarden-crypto/src/keys/pin_key.rs @@ -4,7 +4,7 @@ use super::{ utils::stretch_key, }; use crate::{ - keys::key_encryptable::CryptoKey, EncString, KeyEncryptable, Result, SymmetricCryptoKey, + EncString, KeyEncryptable, Result, SymmetricCryptoKey, keys::key_encryptable::CryptoKey, }; /// Pin Key. @@ -25,7 +25,7 @@ impl PinKey { /// Decrypt the users user key pub fn decrypt_user_key(&self, user_key: EncString) -> Result { - decrypt_user_key(&self.0 .0, user_key) + decrypt_user_key(&self.0.0, user_key) } } @@ -33,7 +33,7 @@ impl CryptoKey for PinKey {} impl KeyEncryptable for &SymmetricCryptoKey { fn encrypt_with_key(self, key: &PinKey) -> Result { - let stretched_key = SymmetricCryptoKey::Aes256CbcHmacKey(stretch_key(&key.0 .0)?); + let stretched_key = SymmetricCryptoKey::Aes256CbcHmacKey(stretch_key(&key.0.0)?); // The (stretched) pin key is currently always an AES-256-CBC-HMAC key, and wraps a // bitwarden legacy encoded symmetric key self.to_encoded().encrypt_with_key(&stretched_key) @@ -43,7 +43,7 @@ impl KeyEncryptable for &SymmetricCryptoKey { impl KeyEncryptable for String { fn encrypt_with_key(self, key: &PinKey) -> Result { self.encrypt_with_key(&SymmetricCryptoKey::Aes256CbcHmacKey(stretch_key( - &key.0 .0, + &key.0.0, )?)) } } diff --git a/crates/bitwarden-crypto/src/keys/shareable_key.rs b/crates/bitwarden-crypto/src/keys/shareable_key.rs index 976332b0c..e3cc25035 100644 --- a/crates/bitwarden-crypto/src/keys/shareable_key.rs +++ b/crates/bitwarden-crypto/src/keys/shareable_key.rs @@ -6,7 +6,7 @@ use typenum::{U32, U64}; use zeroize::{Zeroize, Zeroizing}; use super::Aes256CbcHmacKey; -use crate::util::{hkdf_expand, PbkdfSha256Hmac}; +use crate::util::{PbkdfSha256Hmac, hkdf_expand}; /// Derive a shareable key using hkdf from secret and name. /// @@ -44,13 +44,23 @@ mod tests { #[test] fn test_derive_shareable_key() { let key = derive_shareable_key(Zeroizing::new(*b"&/$%F1a895g67HlX"), "test_key", None); - assert_eq!(SymmetricCryptoKey::Aes256CbcHmacKey(key).to_base64().to_string(), "4PV6+PcmF2w7YHRatvyMcVQtI7zvCyssv/wFWmzjiH6Iv9altjmDkuBD1aagLVaLezbthbSe+ktR+U6qswxNnQ=="); + assert_eq!( + SymmetricCryptoKey::Aes256CbcHmacKey(key) + .to_base64() + .to_string(), + "4PV6+PcmF2w7YHRatvyMcVQtI7zvCyssv/wFWmzjiH6Iv9altjmDkuBD1aagLVaLezbthbSe+ktR+U6qswxNnQ==" + ); let key = derive_shareable_key( Zeroizing::new(*b"67t9b5g67$%Dh89n"), "test_key", Some("test"), ); - assert_eq!(SymmetricCryptoKey::Aes256CbcHmacKey(key).to_base64().to_string(), "F9jVQmrACGx9VUPjuzfMYDjr726JtL300Y3Yg+VYUnVQtQ1s8oImJ5xtp1KALC9h2nav04++1LDW4iFD+infng=="); + assert_eq!( + SymmetricCryptoKey::Aes256CbcHmacKey(key) + .to_base64() + .to_string(), + "F9jVQmrACGx9VUPjuzfMYDjr726JtL300Y3Yg+VYUnVQtQ1s8oImJ5xtp1KALC9h2nav04++1LDW4iFD+infng==" + ); } } diff --git a/crates/bitwarden-crypto/src/keys/signed_public_key.rs b/crates/bitwarden-crypto/src/keys/signed_public_key.rs index 725ab04be..9a7e91adf 100644 --- a/crates/bitwarden-crypto/src/keys/signed_public_key.rs +++ b/crates/bitwarden-crypto/src/keys/signed_public_key.rs @@ -4,16 +4,16 @@ use std::{borrow::Cow, str::FromStr}; -use bitwarden_encoding::{FromStrVisitor, B64}; +use bitwarden_encoding::{B64, FromStrVisitor}; use serde::{Deserialize, Serialize}; use serde_bytes::ByteBuf; use serde_repr::{Deserialize_repr, Serialize_repr}; use super::AsymmetricPublicCryptoKey; use crate::{ - cose::CoseSerializable, error::EncodingError, CoseSign1Bytes, CryptoError, - PublicKeyEncryptionAlgorithm, RawPublicKey, SignedObject, SigningKey, SigningNamespace, - SpkiPublicKeyBytes, VerifyingKey, + CoseSign1Bytes, CryptoError, PublicKeyEncryptionAlgorithm, RawPublicKey, SignedObject, + SigningKey, SigningNamespace, SpkiPublicKeyBytes, VerifyingKey, cose::CoseSerializable, + error::EncodingError, }; #[cfg(feature = "wasm")] diff --git a/crates/bitwarden-crypto/src/keys/symmetric_crypto_key.rs b/crates/bitwarden-crypto/src/keys/symmetric_crypto_key.rs index a4265b38b..6c75c7d4b 100644 --- a/crates/bitwarden-crypto/src/keys/symmetric_crypto_key.rs +++ b/crates/bitwarden-crypto/src/keys/symmetric_crypto_key.rs @@ -1,7 +1,7 @@ use std::pin::Pin; use bitwarden_encoding::B64; -use coset::{iana::KeyOperation, CborSerializable, RegisteredLabelWithPrivate}; +use coset::{CborSerializable, RegisteredLabelWithPrivate, iana::KeyOperation}; use generic_array::GenericArray; use rand::Rng; #[cfg(test)] @@ -16,9 +16,9 @@ use zeroize::{Zeroize, ZeroizeOnDrop}; use super::{ key_encryptable::CryptoKey, - key_id::{KeyId, KEY_ID_SIZE}, + key_id::{KEY_ID_SIZE, KeyId}, }; -use crate::{cose, BitwardenLegacyKeyBytes, ContentFormat, CoseKeyBytes, CryptoError}; +use crate::{BitwardenLegacyKeyBytes, ContentFormat, CoseKeyBytes, CryptoError, cose}; /// [Aes256CbcKey] is a symmetric encryption key, consisting of one 256-bit key, /// used to decrypt legacy type 0 enc strings. The data is not authenticated @@ -284,18 +284,15 @@ impl TryFrom<&BitwardenLegacyKeyBytes> for SymmetricCryptoKey { // are the raw serializations of the AES256-CBC, and AES256-CBC-HMAC keys. If they // are longer, they are COSE keys. The COSE keys are padded to the minimum length of // 65 bytes, when serialized to raw byte arrays. - let result = if slice.len() == Self::AES256_CBC_HMAC_KEY_LEN - || slice.len() == Self::AES256_CBC_KEY_LEN - { + + if slice.len() == Self::AES256_CBC_HMAC_KEY_LEN || slice.len() == Self::AES256_CBC_KEY_LEN { Self::try_from(EncodedSymmetricKey::BitwardenLegacyKey(value.clone())) } else if slice.len() > Self::AES256_CBC_HMAC_KEY_LEN { let unpadded_value = unpad_key(slice)?; Ok(Self::try_from_cose(unpadded_value)?) } else { Err(CryptoError::InvalidKeyLen) - }; - - result + } } } @@ -441,10 +438,10 @@ mod tests { use generic_array::GenericArray; use typenum::U32; - use super::{derive_symmetric_key, SymmetricCryptoKey}; + use super::{SymmetricCryptoKey, derive_symmetric_key}; use crate::{ - keys::symmetric_crypto_key::{pad_key, unpad_key}, Aes256CbcHmacKey, Aes256CbcKey, BitwardenLegacyKeyBytes, XChaCha20Poly1305Key, + keys::symmetric_crypto_key::{pad_key, unpad_key}, }; #[test] diff --git a/crates/bitwarden-crypto/src/keys/user_key.rs b/crates/bitwarden-crypto/src/keys/user_key.rs index dbea9c27c..bb1837f74 100644 --- a/crates/bitwarden-crypto/src/keys/user_key.rs +++ b/crates/bitwarden-crypto/src/keys/user_key.rs @@ -1,6 +1,6 @@ use crate::{ - rsa::{make_key_pair, RsaKeyPair}, Result, SymmetricCryptoKey, + rsa::{RsaKeyPair, make_key_pair}, }; /// User Key diff --git a/crates/bitwarden-crypto/src/keys/utils.rs b/crates/bitwarden-crypto/src/keys/utils.rs index 46d78bc5b..96722aaf3 100644 --- a/crates/bitwarden-crypto/src/keys/utils.rs +++ b/crates/bitwarden-crypto/src/keys/utils.rs @@ -4,7 +4,7 @@ use generic_array::GenericArray; use typenum::U32; use super::Aes256CbcHmacKey; -use crate::{util::hkdf_expand, CryptoError, Result}; +use crate::{CryptoError, Result, util::hkdf_expand}; /// Stretch the given key using HKDF. /// This can be either a kdf-derived key (PIN/Master password) or diff --git a/crates/bitwarden-crypto/src/lib.rs b/crates/bitwarden-crypto/src/lib.rs index 88ade0d76..34de79131 100644 --- a/crates/bitwarden-crypto/src/lib.rs +++ b/crates/bitwarden-crypto/src/lib.rs @@ -32,7 +32,7 @@ mod wordlist; pub use wordlist::EFF_LONG_WORD_LIST; mod store; pub use store::{ - dangerous_get_v2_rotated_account_keys, KeyStore, KeyStoreContext, RotatedUserKeys, + KeyStore, KeyStoreContext, RotatedUserKeys, dangerous_get_v2_rotated_account_keys, }; mod cose; pub use cose::CoseSerializable; diff --git a/crates/bitwarden-crypto/src/rsa.rs b/crates/bitwarden-crypto/src/rsa.rs index e7a43f06d..9bad1a1c2 100644 --- a/crates/bitwarden-crypto/src/rsa.rs +++ b/crates/bitwarden-crypto/src/rsa.rs @@ -1,13 +1,13 @@ use bitwarden_encoding::B64; use rsa::{ - pkcs8::{EncodePrivateKey, EncodePublicKey}, Oaep, RsaPrivateKey, RsaPublicKey, + pkcs8::{EncodePrivateKey, EncodePublicKey}, }; use sha1::Sha1; use crate::{ - error::{Result, RsaError, UnsupportedOperationError}, CryptoError, EncString, SymmetricCryptoKey, + error::{Result, RsaError, UnsupportedOperationError}, }; /// RSA Key Pair diff --git a/crates/bitwarden-crypto/src/safe/password_protected_key_envelope.rs b/crates/bitwarden-crypto/src/safe/password_protected_key_envelope.rs index 1c21332cd..e3cf46f26 100644 --- a/crates/bitwarden-crypto/src/safe/password_protected_key_envelope.rs +++ b/crates/bitwarden-crypto/src/safe/password_protected_key_envelope.rs @@ -16,20 +16,21 @@ use std::{marker::PhantomData, num::TryFromIntError, str::FromStr}; use argon2::Params; -use bitwarden_encoding::{FromStrVisitor, B64}; -use ciborium::{value::Integer, Value}; +use bitwarden_encoding::{B64, FromStrVisitor}; +use ciborium::{Value, value::Integer}; use coset::{CborSerializable, CoseError, Header, HeaderBuilder}; use rand::RngCore; use serde::{Deserialize, Serialize}; use thiserror::Error; use crate::{ + BitwardenLegacyKeyBytes, ContentFormat, CoseKeyBytes, EncodedSymmetricKey, KeyIds, + KeyStoreContext, SymmetricCryptoKey, cose::{ - extract_bytes, extract_integer, CoseExtractError, ALG_ARGON2ID13, ARGON2_ITERATIONS, - ARGON2_MEMORY, ARGON2_PARALLELISM, ARGON2_SALT, + ALG_ARGON2ID13, ARGON2_ITERATIONS, ARGON2_MEMORY, ARGON2_PARALLELISM, ARGON2_SALT, + CoseExtractError, extract_bytes, extract_integer, }, - xchacha20, BitwardenLegacyKeyBytes, ContentFormat, CoseKeyBytes, EncodedSymmetricKey, KeyIds, - KeyStoreContext, SymmetricCryptoKey, + xchacha20, }; /// 16 is the RECOMMENDED salt size for all applications: @@ -450,8 +451,8 @@ impl From for PasswordProtectedKeyEnvelopeError { mod tests { use super::*; use crate::{ - traits::tests::{TestIds, TestSymmKey}, KeyStore, + traits::tests::{TestIds, TestSymmKey}, }; const TEST_UNSEALED_COSEKEY_ENCODED: &[u8] = &[ diff --git a/crates/bitwarden-crypto/src/signing/cose.rs b/crates/bitwarden-crypto/src/signing/cose.rs index d34d359d0..0227467aa 100644 --- a/crates/bitwarden-crypto/src/signing/cose.rs +++ b/crates/bitwarden-crypto/src/signing/cose.rs @@ -1,16 +1,16 @@ //! This file contains helper functions to aid in COSE deserialization use coset::{ - iana::{EllipticCurve, EnumI64, OkpKeyParameter}, CoseKey, Label, ProtectedHeader, RegisteredLabel, + iana::{EllipticCurve, EnumI64, OkpKeyParameter}, }; use super::SigningNamespace; use crate::{ + CryptoError, KEY_ID_SIZE, cose::SIGNING_NAMESPACE, error::{EncodingError, SignatureError}, keys::KeyId, - CryptoError, KEY_ID_SIZE, }; /// Helper function to extract the namespace from a `ProtectedHeader`. The namespace is a custom diff --git a/crates/bitwarden-crypto/src/signing/message.rs b/crates/bitwarden-crypto/src/signing/message.rs index 6556a7a67..5073685b9 100644 --- a/crates/bitwarden-crypto/src/signing/message.rs +++ b/crates/bitwarden-crypto/src/signing/message.rs @@ -15,7 +15,7 @@ //! what COSE already uses. use coset::iana::CoapContentFormat; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; use crate::error::EncodingError; diff --git a/crates/bitwarden-crypto/src/signing/namespace.rs b/crates/bitwarden-crypto/src/signing/namespace.rs index cd805b496..f2201a0ae 100644 --- a/crates/bitwarden-crypto/src/signing/namespace.rs +++ b/crates/bitwarden-crypto/src/signing/namespace.rs @@ -1,4 +1,4 @@ -use crate::{error::SignatureError, CryptoError}; +use crate::{CryptoError, error::SignatureError}; /// Signing is domain-separated within bitwarden, to prevent cross protocol attacks. /// diff --git a/crates/bitwarden-crypto/src/signing/signature.rs b/crates/bitwarden-crypto/src/signing/signature.rs index 1c2b95bc3..6c9611a11 100644 --- a/crates/bitwarden-crypto/src/signing/signature.rs +++ b/crates/bitwarden-crypto/src/signing/signature.rs @@ -1,16 +1,16 @@ use ciborium::value::Integer; -use coset::{iana::CoapContentFormat, CborSerializable, CoseSign1}; +use coset::{CborSerializable, CoseSign1, iana::CoapContentFormat}; use serde::Serialize; use super::{ - content_type, message::SerializedMessage, namespace, signing_key::SigningKey, SigningNamespace, - VerifyingKey, + SigningNamespace, VerifyingKey, content_type, message::SerializedMessage, namespace, + signing_key::SigningKey, }; use crate::{ + CoseSign1Bytes, CryptoError, content_format::CoseSign1ContentFormat, cose::{CoseSerializable, SIGNING_NAMESPACE}, error::{EncodingError, SignatureError}, - CoseSign1Bytes, CryptoError, }; /// A signature cryptographically attests to a (namespace, data) pair. The namespace is included in diff --git a/crates/bitwarden-crypto/src/signing/signed_object.rs b/crates/bitwarden-crypto/src/signing/signed_object.rs index 94134d290..12ae4794d 100644 --- a/crates/bitwarden-crypto/src/signing/signed_object.rs +++ b/crates/bitwarden-crypto/src/signing/signed_object.rs @@ -1,16 +1,16 @@ use ciborium::value::Integer; -use coset::{iana::CoapContentFormat, CborSerializable, CoseSign1}; -use serde::{de::DeserializeOwned, Serialize}; +use coset::{CborSerializable, CoseSign1, iana::CoapContentFormat}; +use serde::{Serialize, de::DeserializeOwned}; use super::{ - content_type, message::SerializedMessage, namespace, signing_key::SigningKey, - verifying_key::VerifyingKey, SigningNamespace, + SigningNamespace, content_type, message::SerializedMessage, namespace, signing_key::SigningKey, + verifying_key::VerifyingKey, }; use crate::{ + CoseSign1Bytes, CryptoError, content_format::CoseSign1ContentFormat, cose::{CoseSerializable, SIGNING_NAMESPACE}, error::{EncodingError, SignatureError}, - CoseSign1Bytes, CryptoError, }; /// A signed object is a message containing a payload and signature that attests the payload's diff --git a/crates/bitwarden-crypto/src/signing/signing_key.rs b/crates/bitwarden-crypto/src/signing/signing_key.rs index f68c60d18..5c3a273ce 100644 --- a/crates/bitwarden-crypto/src/signing/signing_key.rs +++ b/crates/bitwarden-crypto/src/signing/signing_key.rs @@ -1,23 +1,22 @@ use std::pin::Pin; -use ciborium::{value::Integer, Value}; +use ciborium::{Value, value::Integer}; use coset::{ - iana::{Algorithm, EllipticCurve, EnumI64, KeyOperation, KeyType, OkpKeyParameter}, CborSerializable, CoseKey, RegisteredLabel, RegisteredLabelWithPrivate, + iana::{Algorithm, EllipticCurve, EnumI64, KeyOperation, KeyType, OkpKeyParameter}, }; use ed25519_dalek::Signer; use super::{ - ed25519_signing_key, key_id, + SignatureAlgorithm, ed25519_signing_key, key_id, verifying_key::{RawVerifyingKey, VerifyingKey}, - SignatureAlgorithm, }; use crate::{ + CoseKeyBytes, CryptoKey, content_format::CoseKeyContentFormat, cose::CoseSerializable, error::{EncodingError, Result}, keys::KeyId, - CoseKeyBytes, CryptoKey, }; /// A `SigningKey` without the key id. This enum contains a variant for each supported signature @@ -149,8 +148,10 @@ mod tests { let signing_key = SigningKey::make(SignatureAlgorithm::Ed25519); let signature = signing_key.sign_raw("Test message".as_bytes()); let verifying_key = signing_key.to_verifying_key(); - assert!(verifying_key - .verify_raw(&signature, "Test message".as_bytes()) - .is_ok()); + assert!( + verifying_key + .verify_raw(&signature, "Test message".as_bytes()) + .is_ok() + ); } } diff --git a/crates/bitwarden-crypto/src/signing/verifying_key.rs b/crates/bitwarden-crypto/src/signing/verifying_key.rs index 12fa0eebf..8f5736a13 100644 --- a/crates/bitwarden-crypto/src/signing/verifying_key.rs +++ b/crates/bitwarden-crypto/src/signing/verifying_key.rs @@ -3,19 +3,19 @@ //! This implements the lowest layer of the signature module, verifying signatures on raw byte //! arrays. -use ciborium::{value::Integer, Value}; +use ciborium::{Value, value::Integer}; use coset::{ - iana::{Algorithm, EllipticCurve, EnumI64, KeyOperation, KeyType, OkpKeyParameter}, CborSerializable, RegisteredLabel, RegisteredLabelWithPrivate, + iana::{Algorithm, EllipticCurve, EnumI64, KeyOperation, KeyType, OkpKeyParameter}, }; -use super::{ed25519_verifying_key, key_id, SignatureAlgorithm}; +use super::{SignatureAlgorithm, ed25519_verifying_key, key_id}; use crate::{ + CoseKeyBytes, CryptoError, content_format::CoseKeyContentFormat, cose::CoseSerializable, error::{EncodingError, SignatureError}, keys::KeyId, - CoseKeyBytes, CryptoError, }; /// A `VerifyingKey` without the key id. This enum contains a variant for each supported signature @@ -152,8 +152,10 @@ mod tests { assert_eq!(verifying_key.algorithm(), SignatureAlgorithm::Ed25519); // This should fail, as the signed object is not valid for the given verifying key. - assert!(verifying_key - .verify_raw(SIGNED_DATA_RAW, b"Invalid message") - .is_err()); + assert!( + verifying_key + .verify_raw(SIGNED_DATA_RAW, b"Invalid message") + .is_err() + ); } } diff --git a/crates/bitwarden-crypto/src/store/backend/implementation/basic.rs b/crates/bitwarden-crypto/src/store/backend/implementation/basic.rs index 3db4b2db3..9df19ccba 100644 --- a/crates/bitwarden-crypto/src/store/backend/implementation/basic.rs +++ b/crates/bitwarden-crypto/src/store/backend/implementation/basic.rs @@ -1,6 +1,6 @@ use zeroize::ZeroizeOnDrop; -use crate::{store::backend::StoreBackend, KeyId}; +use crate::{KeyId, store::backend::StoreBackend}; /// This is a basic key store backend that stores keys in a HashMap memory. /// No protections are provided for the keys stored in this backend, beyond enforcing diff --git a/crates/bitwarden-crypto/src/store/backend/implementation/mod.rs b/crates/bitwarden-crypto/src/store/backend/implementation/mod.rs index 141d73c0b..cb8375cc1 100644 --- a/crates/bitwarden-crypto/src/store/backend/implementation/mod.rs +++ b/crates/bitwarden-crypto/src/store/backend/implementation/mod.rs @@ -11,7 +11,7 @@ pub fn create_store() -> Box> { #[cfg(test)] mod tests { use super::*; - use crate::{traits::tests::TestSymmKey, SymmetricCryptoKey}; + use crate::{SymmetricCryptoKey, traits::tests::TestSymmKey}; #[test] fn test_creates_a_valid_store() { diff --git a/crates/bitwarden-crypto/src/store/context.rs b/crates/bitwarden-crypto/src/store/context.rs index a40aa1059..66120272c 100644 --- a/crates/bitwarden-crypto/src/store/context.rs +++ b/crates/bitwarden-crypto/src/store/context.rs @@ -8,11 +8,11 @@ use zeroize::Zeroizing; use super::KeyStoreInner; use crate::{ - derive_shareable_key, error::UnsupportedOperationError, signing, store::backend::StoreBackend, AsymmetricCryptoKey, BitwardenLegacyKeyBytes, ContentFormat, CryptoError, EncString, KeyId, KeyIds, PublicKeyEncryptionAlgorithm, Result, RotatedUserKeys, Signature, SignatureAlgorithm, SignedObject, SignedPublicKey, SignedPublicKeyMessage, SigningKey, SymmetricCryptoKey, - UnsignedSharedKey, + UnsignedSharedKey, derive_shareable_key, error::UnsupportedOperationError, signing, + store::backend::StoreBackend, }; /// The context of a crypto operation using [super::KeyStore] @@ -557,15 +557,15 @@ mod tests { use serde::{Deserialize, Serialize}; use crate::{ - store::{ - tests::{Data, DataView}, - KeyStore, - }, - traits::tests::{TestAsymmKey, TestIds, TestSigningKey, TestSymmKey}, AsymmetricCryptoKey, AsymmetricPublicCryptoKey, CompositeEncryptable, CoseKeyBytes, CoseSerializable, CryptoError, Decryptable, KeyDecryptable, Pkcs8PrivateKeyBytes, PublicKeyEncryptionAlgorithm, SignatureAlgorithm, SigningKey, SigningNamespace, SymmetricCryptoKey, + store::{ + KeyStore, + tests::{Data, DataView}, + }, + traits::tests::{TestAsymmKey, TestIds, TestSigningKey, TestSymmKey}, }; #[test] diff --git a/crates/bitwarden-crypto/src/store/key_rotation.rs b/crates/bitwarden-crypto/src/store/key_rotation.rs index 60509c69b..0d97331c2 100644 --- a/crates/bitwarden-crypto/src/store/key_rotation.rs +++ b/crates/bitwarden-crypto/src/store/key_rotation.rs @@ -49,9 +49,9 @@ pub fn dangerous_get_v2_rotated_account_keys( mod tests { use super::*; use crate::{ - traits::tests::{TestAsymmKey, TestIds, TestSigningKey, TestSymmKey}, AsymmetricCryptoKey, KeyDecryptable, KeyStore, Pkcs8PrivateKeyBytes, PublicKeyEncryptionAlgorithm, SigningKey, + traits::tests::{TestAsymmKey, TestIds, TestSigningKey, TestSymmKey}, }; #[test] diff --git a/crates/bitwarden-crypto/src/store/mod.rs b/crates/bitwarden-crypto/src/store/mod.rs index bff22081d..5c3a5010e 100644 --- a/crates/bitwarden-crypto/src/store/mod.rs +++ b/crates/bitwarden-crypto/src/store/mod.rs @@ -31,7 +31,7 @@ use crate::{CompositeEncryptable, Decryptable, IdentifyKey, KeyId, KeyIds}; mod backend; mod context; -use backend::{create_store, StoreBackend}; +use backend::{StoreBackend, create_store}; use context::GlobalKeys; pub use context::KeyStoreContext; @@ -362,9 +362,9 @@ fn batch_chunk_size(len: usize) -> usize { #[cfg(test)] pub(crate) mod tests { use crate::{ + EncString, PrimitiveEncryptable, SymmetricCryptoKey, store::{KeyStore, KeyStoreContext}, traits::tests::{TestIds, TestSymmKey}, - EncString, PrimitiveEncryptable, SymmetricCryptoKey, }; pub struct DataView(pub String, pub TestSymmKey); diff --git a/crates/bitwarden-crypto/src/traits/decryptable.rs b/crates/bitwarden-crypto/src/traits/decryptable.rs index 8b95c4ac0..e517fdf61 100644 --- a/crates/bitwarden-crypto/src/traits/decryptable.rs +++ b/crates/bitwarden-crypto/src/traits/decryptable.rs @@ -1,4 +1,4 @@ -use crate::{store::KeyStoreContext, CryptoError, EncString, KeyId, KeyIds}; +use crate::{CryptoError, EncString, KeyId, KeyIds, store::KeyStoreContext}; /// A decryption operation that takes the input value and decrypts it into the output value. /// Implementations should generally consist of calling [Decryptable::decrypt] for all the fields of @@ -57,7 +57,7 @@ impl, Output> #[cfg(test)] mod tests { - use crate::{traits::tests::*, Decryptable, EncString, KeyStore, SymmetricCryptoKey}; + use crate::{Decryptable, EncString, KeyStore, SymmetricCryptoKey, traits::tests::*}; fn test_store() -> KeyStore { let store = KeyStore::::default(); diff --git a/crates/bitwarden-crypto/src/traits/encryptable.rs b/crates/bitwarden-crypto/src/traits/encryptable.rs index 654a1fa90..fdec0aeba 100644 --- a/crates/bitwarden-crypto/src/traits/encryptable.rs +++ b/crates/bitwarden-crypto/src/traits/encryptable.rs @@ -17,7 +17,7 @@ //! checking of the content format, and the risk of using the wrong content format is limited to //! converting untyped bytes into a `Bytes` -use crate::{store::KeyStoreContext, ContentFormat, CryptoError, EncString, KeyId, KeyIds}; +use crate::{ContentFormat, CryptoError, EncString, KeyId, KeyIds, store::KeyStoreContext}; /// An encryption operation that takes the input value and encrypts the fields on it recursively. /// Implementations should generally consist of calling [PrimitiveEncryptable::encrypt] for all the @@ -169,9 +169,9 @@ impl KeyStore { diff --git a/crates/bitwarden-crypto/src/traits/key_id.rs b/crates/bitwarden-crypto/src/traits/key_id.rs index b9f8082c4..6ca479861 100644 --- a/crates/bitwarden-crypto/src/traits/key_id.rs +++ b/crates/bitwarden-crypto/src/traits/key_id.rs @@ -119,8 +119,8 @@ macro_rules! key_ids { #[cfg(test)] pub(crate) mod tests { use crate::{ - traits::tests::{TestAsymmKey, TestSigningKey, TestSymmKey}, KeyId, + traits::tests::{TestAsymmKey, TestSigningKey, TestSymmKey}, }; #[test] diff --git a/crates/bitwarden-crypto/src/util.rs b/crates/bitwarden-crypto/src/util.rs index 48a899a8e..9e6089294 100644 --- a/crates/bitwarden-crypto/src/util.rs +++ b/crates/bitwarden-crypto/src/util.rs @@ -4,8 +4,8 @@ use ::aes::cipher::{ArrayLength, Unsigned}; use generic_array::GenericArray; use hmac::digest::OutputSizeUser; use rand::{ - distributions::{Alphanumeric, DistString, Distribution, Standard}, Rng, + distributions::{Alphanumeric, DistString, Distribution, Standard}, }; use zeroize::{Zeroize, Zeroizing}; diff --git a/crates/bitwarden-encoding/src/lib.rs b/crates/bitwarden-encoding/src/lib.rs index a589bbc50..896a2ad3f 100644 --- a/crates/bitwarden-encoding/src/lib.rs +++ b/crates/bitwarden-encoding/src/lib.rs @@ -4,7 +4,7 @@ mod b64; mod b64url; mod serde; -pub use b64::{NotB64EncodedError, B64}; +pub use b64::{B64, NotB64EncodedError}; pub use b64url::{B64Url, NotB64UrlEncodedError}; pub use serde::FromStrVisitor; diff --git a/crates/bitwarden-encoding/src/uniffi_support.rs b/crates/bitwarden-encoding/src/uniffi_support.rs index 777e90f3f..033910571 100644 --- a/crates/bitwarden-encoding/src/uniffi_support.rs +++ b/crates/bitwarden-encoding/src/uniffi_support.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use bitwarden_uniffi_error::convert_result; -use crate::{B64Url, B64}; +use crate::{B64, B64Url}; uniffi::custom_type!(B64, String, { try_lift: |val| { diff --git a/crates/bitwarden-error-macro/src/attribute.rs b/crates/bitwarden-error-macro/src/attribute.rs index a62593af7..c62b5a07f 100644 --- a/crates/bitwarden-error-macro/src/attribute.rs +++ b/crates/bitwarden-error-macro/src/attribute.rs @@ -1,4 +1,4 @@ -use darling::{ast::NestedMeta, FromMeta}; +use darling::{FromMeta, ast::NestedMeta}; use quote::format_ident; use crate::args::{BitwardenErrorArgs, BitwardenErrorType}; diff --git a/crates/bitwarden-exporters/src/cxf/api_key.rs b/crates/bitwarden-exporters/src/cxf/api_key.rs index 5b8cef86c..75bf8eb68 100644 --- a/crates/bitwarden-exporters/src/cxf/api_key.rs +++ b/crates/bitwarden-exporters/src/cxf/api_key.rs @@ -1,6 +1,6 @@ use credential_exchange_format::ApiKeyCredential; -use crate::{cxf::editable_field::create_field, Field}; +use crate::{Field, cxf::editable_field::create_field}; /// Convert API key credentials to custom fields pub(super) fn api_key_to_fields(api_key: &ApiKeyCredential) -> Vec { diff --git a/crates/bitwarden-exporters/src/cxf/card.rs b/crates/bitwarden-exporters/src/cxf/card.rs index c5a11c88d..c6af72560 100644 --- a/crates/bitwarden-exporters/src/cxf/card.rs +++ b/crates/bitwarden-exporters/src/cxf/card.rs @@ -7,7 +7,7 @@ use chrono::Month; use credential_exchange_format::{Credential, CreditCardCredential, EditableFieldYearMonth}; use num_traits::FromPrimitive; -use crate::{cxf::editable_field::create_field, Card, Field}; +use crate::{Card, Field, cxf::editable_field::create_field}; impl From for Vec { fn from(value: Card) -> Self { diff --git a/crates/bitwarden-exporters/src/cxf/export.rs b/crates/bitwarden-exporters/src/cxf/export.rs index edadf0b8d..ea066161a 100644 --- a/crates/bitwarden-exporters/src/cxf/export.rs +++ b/crates/bitwarden-exporters/src/cxf/export.rs @@ -8,8 +8,8 @@ use uuid::Uuid; use {tsify::Tsify, wasm_bindgen::prelude::*}; use crate::{ - cxf::{editable_field::field_to_editable_field_value, CxfError}, Cipher, CipherType, Login, + cxf::{CxfError, editable_field::field_to_editable_field_value}, }; /// Temporary struct to hold metadata related to current account diff --git a/crates/bitwarden-exporters/src/cxf/identity.rs b/crates/bitwarden-exporters/src/cxf/identity.rs index ff950f668..f2814cd75 100644 --- a/crates/bitwarden-exporters/src/cxf/identity.rs +++ b/crates/bitwarden-exporters/src/cxf/identity.rs @@ -5,8 +5,8 @@ use credential_exchange_format::{ }; use crate::{ - cxf::editable_field::{create_editable_field, create_field}, Field, Identity, + cxf::editable_field::{create_editable_field, create_field}, }; /// Convert address credentials to Identity (no custom fields needed for address) diff --git a/crates/bitwarden-exporters/src/cxf/import.rs b/crates/bitwarden-exporters/src/cxf/import.rs index 1c3c309d9..e2b2498c1 100644 --- a/crates/bitwarden-exporters/src/cxf/import.rs +++ b/crates/bitwarden-exporters/src/cxf/import.rs @@ -8,7 +8,9 @@ use credential_exchange_format::{ }; use crate::{ + CipherType, Field, ImportingCipher, SecureNote, SecureNoteType, cxf::{ + CxfError, api_key::api_key_to_fields, card::to_card, editable_field::create_field, @@ -20,9 +22,7 @@ use crate::{ note::extract_note_content, ssh::to_ssh, wifi::wifi_to_fields, - CxfError, }, - CipherType, Field, ImportingCipher, SecureNote, SecureNoteType, }; /** @@ -224,7 +224,7 @@ fn group_credentials_by_type(credentials: Vec) -> GroupedCredentials macro_rules! extract_credential { ($field:ident, $variant:path, $type:ty) => { filter_credentials(&credentials, |c| match c { - $variant(ref inner) => Some(inner.as_ref()), + &$variant(ref inner) => Some(inner.as_ref()), _ => None, }) }; diff --git a/crates/bitwarden-exporters/src/cxf/login.rs b/crates/bitwarden-exporters/src/cxf/login.rs index c41746713..d2eb81391 100644 --- a/crates/bitwarden-exporters/src/cxf/login.rs +++ b/crates/bitwarden-exporters/src/cxf/login.rs @@ -4,7 +4,7 @@ //! [PasskeyCredential]. use bitwarden_core::MissingFieldError; -use bitwarden_fido::{string_to_guid_bytes, InvalidGuidError}; +use bitwarden_fido::{InvalidGuidError, string_to_guid_bytes}; use bitwarden_vault::{FieldType, Totp, TotpAlgorithm}; use chrono::{DateTime, Utc}; use credential_exchange_format::{ @@ -25,7 +25,7 @@ fn convert_otp_algorithm(algorithm: &OTPHashAlgorithm) -> TotpAlgorithm { OTPHashAlgorithm::Sha1 => TotpAlgorithm::Sha1, OTPHashAlgorithm::Sha256 => TotpAlgorithm::Sha256, OTPHashAlgorithm::Sha512 => TotpAlgorithm::Sha512, - OTPHashAlgorithm::Unknown(ref algo) if algo == "steam" => TotpAlgorithm::Steam, + OTPHashAlgorithm::Unknown(algo) if algo == "steam" => TotpAlgorithm::Steam, OTPHashAlgorithm::Unknown(_) | _ => TotpAlgorithm::Sha1, /* Default to SHA1 for unknown * algorithms */ } diff --git a/crates/bitwarden-exporters/src/cxf/mod.rs b/crates/bitwarden-exporters/src/cxf/mod.rs index c5bf9c685..1b07bbe8d 100644 --- a/crates/bitwarden-exporters/src/cxf/mod.rs +++ b/crates/bitwarden-exporters/src/cxf/mod.rs @@ -8,8 +8,8 @@ mod error; pub use error::CxfError; mod export; -pub(crate) use export::build_cxf; pub use export::Account; +pub(crate) use export::build_cxf; mod import; pub(crate) use import::parse_cxf; mod api_key; diff --git a/crates/bitwarden-exporters/src/cxf/note.rs b/crates/bitwarden-exporters/src/cxf/note.rs index 55686afb2..1c84c9f25 100644 --- a/crates/bitwarden-exporters/src/cxf/note.rs +++ b/crates/bitwarden-exporters/src/cxf/note.rs @@ -79,7 +79,7 @@ mod tests { fn test_standalone_note_credential() { use credential_exchange_format::{Credential, Item}; - use crate::{cxf::import::parse_item, CipherType, ImportingCipher}; + use crate::{CipherType, ImportingCipher, cxf::import::parse_item}; let item = Item { id: [0, 1, 2, 3, 4, 5, 6].as_ref().into(), diff --git a/crates/bitwarden-exporters/src/cxf/ssh.rs b/crates/bitwarden-exporters/src/cxf/ssh.rs index 305c23948..32e4fa824 100644 --- a/crates/bitwarden-exporters/src/cxf/ssh.rs +++ b/crates/bitwarden-exporters/src/cxf/ssh.rs @@ -6,7 +6,7 @@ use bitwarden_ssh::{ use bitwarden_vault::FieldType; use credential_exchange_format::{B64Url, Credential, SshKeyCredential}; -use crate::{cxf::editable_field::create_field, Field, SshKey}; +use crate::{Field, SshKey, cxf::editable_field::create_field}; /// Convert SSH key credentials to SshKey and custom fields pub(super) fn to_ssh( @@ -111,7 +111,10 @@ mod tests { let (ssh, fields) = to_ssh(&credential).unwrap(); - assert_eq!(ssh.private_key, "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn\nNhAAAAAwEAAQAAAYEAp+PkIiaI2fZoHPSmCSLw1hms+KhYX9AgbrYOi/MxKBysLojfpqnB\nHIggjmvQTYiZpvDU03oWb664JRhufcyG6mLQwB41Z/r7W+PcT8yL/jOudWKo9PJSG0fbRC\nBygqu2h/BpQ5vDYBvRMyRo5S+6JEMpuEx9TB5frOJlMq/6m9rp5WQQ4sQELKYVPIgi37bp\nFgiJJkIOAko9Rod1mwZWfhF+XltBF7gMOF7EmwU1lfQh0aMFSKWKj7xGEqR7KAoxHHffPK\ndfYaYhpJwNCeM+yX1JTYMk/9XIW/Bgkw0/tgwgUQKW7CIOkzgVUvj0enpgEN3mc1FtPt/6\nETOIqdLo5bUMvLlOoL2CAKsecFxjE4VaWXFIGoSokrFaP7OG/OIjHuAxt1vI8+Koussjb9\nFXnRMz1GdZV3dRiRaMvbijbkk3vtZLInAHJbmTei7jbDx3D8RQsznJqDZ1VxCgFyJ7fsrP\n/+Qg1WrK6GUgB2Zw41A+KDbCyN1SDpxsYF65MEh9AAAFeFAMoMtQDKDLAAAAB3NzaC1yc2\nEAAAGBAKfj5CImiNn2aBz0pgki8NYZrPioWF/QIG62DovzMSgcrC6I36apwRyIII5r0E2I\nmabw1NN6Fm+uuCUYbn3Mhupi0MAeNWf6+1vj3E/Mi/4zrnViqPTyUhtH20QgcoKrtofwaU\nObw2Ab0TMkaOUvuiRDKbhMfUweX6ziZTKv+pva6eVkEOLEBCymFTyIIt+26RYIiSZCDgJK\nPUaHdZsGVn4Rfl5bQRe4DDhexJsFNZX0IdGjBUilio+8RhKkeygKMRx33zynX2GmIaScDQ\nnjPsl9SU2DJP/VyFvwYJMNP7YMIFECluwiDpM4FVL49Hp6YBDd5nNRbT7f+hEziKnS6OW1\nDLy5TqC9ggCrHnBcYxOFWllxSBqEqJKxWj+zhvziIx7gMbdbyPPiqLrLI2/RV50TM9RnWV\nd3UYkWjL24o25JN77WSyJwByW5k3ou42w8dw/EULM5yag2dVcQoBcie37Kz//kINVqyuhl\nIAdmcONQPig2wsjdUg6cbGBeuTBIfQAAAAMBAAEAAAGAANkgzH+zgR8NThjPTkGtWUuLvp\nLX0B4Z99fhcW64VhqfpQ7fIGAAVX+mOHSjeqzLZ+w/YFUgJWQgJ9x8fGlgL3Fx2rKcXvWF\n4mQ04finfBCF8QUJ/k4gwOSx9Ha8gAapjKdtL2CrUezkt5SCF3xQUqwTMHbpysy8JisGS1\nqtEln+r1W8KcUckfQsgcqHReg45mSt0AdqkN46pS9R1ly9FZ8gK2Oxy71L3yyyuLzD6p7E\nh/hXR74XBIcKjJVk+OIPn4alrQiTZ4w4CytxT2yPD8/UxfHVibzpqeUOokgbmtXvcdi4s1\nbjUqohXO2Uy3qBuJw4+09gbagdBNazVAxDdWgaPlGZhySuy6831vwfrLItlsCKX8WGtZTu\nhxaHef2EIl1dRrp8h9XIQrG7zhbV7wBwEjuB0ypSTW1oURdRl6pyqQGhwzwlbsKd3qumH9\nKC216y9yhWd48Folm6UF0Vb6as2icGZ9wjdckIGEvY9e2vcKz5MvgaCcV42f6CJlixAAAA\nwQCVYwwKCHNlZxl0/NMkDJ+hp7/InHF6mz/3VO58iCb19TLDVUC2dDGPXNYwWTT9Pclefw\nV5HNBHcAfTzgB4dpQyNiDyV914HL7DFEGduoPnwBYjeFre54v0YjjnskjJO7myircdbdX/\n/i+7LMUw5aZZXCC8a5BD/rdV6IKJWJG5QBXbe5fVf1XwOjBTzlhIPIqhNFfSu+mFikp5BR\nwHGBqsKMju6inYmW6YADeY/SvOQjDEB37RqGZxqyIx8V2ZYwUAAADBANJZC8Ih75k2BUwg\nuzzfd/AIJPfzULOT0NfDEZ/TiZsn0qWKn/4DafjHe8VILRfzE4n+7npadiew2H+n4/RGH/\nYOBLlvkkIBT+KX4iZ9fsxhXk0KtSEr8I7AOBPGUrfhiLpo2U4OmIi9fwO/buMJtuLMLe4q\np1VYjj7TxjjN+EtbQGpo2c6tnmQ5gBeqQH5rkzHYpwjEdRNZDSWG8Xqi4qkAl7sAQZxzjj\niaHzdwJL840VAQfbnb54qmMR9z0HMT8QAAAMEAzFPkrAGFmGcl51g3zsqRymXvF0ySlTxv\n5pd5mg3KQJ6gL7CAhB7GdJaYWTgc+QI3G8JaVuQ5PUwetMAoWdo7DDbc5v5WLoD2fSujOj\n2+2gmKDXXgYHSBSoSa18uE7U/kATzLOiAT4gsfKnQGpe3y8Yh/OkOcKQ34YqXyA44w+tHg\n0Bws75GyFzmcuzsEYHhISLXbpjqZJ+nzmbT77VCFYzP0fOokQcJYpVxlh0J0Q40/2OzTgR\nScrfcq2UkhbNlNAAAAAAEC\n-----END OPENSSH PRIVATE KEY-----\n"); + assert_eq!( + ssh.private_key, + "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn\nNhAAAAAwEAAQAAAYEAp+PkIiaI2fZoHPSmCSLw1hms+KhYX9AgbrYOi/MxKBysLojfpqnB\nHIggjmvQTYiZpvDU03oWb664JRhufcyG6mLQwB41Z/r7W+PcT8yL/jOudWKo9PJSG0fbRC\nBygqu2h/BpQ5vDYBvRMyRo5S+6JEMpuEx9TB5frOJlMq/6m9rp5WQQ4sQELKYVPIgi37bp\nFgiJJkIOAko9Rod1mwZWfhF+XltBF7gMOF7EmwU1lfQh0aMFSKWKj7xGEqR7KAoxHHffPK\ndfYaYhpJwNCeM+yX1JTYMk/9XIW/Bgkw0/tgwgUQKW7CIOkzgVUvj0enpgEN3mc1FtPt/6\nETOIqdLo5bUMvLlOoL2CAKsecFxjE4VaWXFIGoSokrFaP7OG/OIjHuAxt1vI8+Koussjb9\nFXnRMz1GdZV3dRiRaMvbijbkk3vtZLInAHJbmTei7jbDx3D8RQsznJqDZ1VxCgFyJ7fsrP\n/+Qg1WrK6GUgB2Zw41A+KDbCyN1SDpxsYF65MEh9AAAFeFAMoMtQDKDLAAAAB3NzaC1yc2\nEAAAGBAKfj5CImiNn2aBz0pgki8NYZrPioWF/QIG62DovzMSgcrC6I36apwRyIII5r0E2I\nmabw1NN6Fm+uuCUYbn3Mhupi0MAeNWf6+1vj3E/Mi/4zrnViqPTyUhtH20QgcoKrtofwaU\nObw2Ab0TMkaOUvuiRDKbhMfUweX6ziZTKv+pva6eVkEOLEBCymFTyIIt+26RYIiSZCDgJK\nPUaHdZsGVn4Rfl5bQRe4DDhexJsFNZX0IdGjBUilio+8RhKkeygKMRx33zynX2GmIaScDQ\nnjPsl9SU2DJP/VyFvwYJMNP7YMIFECluwiDpM4FVL49Hp6YBDd5nNRbT7f+hEziKnS6OW1\nDLy5TqC9ggCrHnBcYxOFWllxSBqEqJKxWj+zhvziIx7gMbdbyPPiqLrLI2/RV50TM9RnWV\nd3UYkWjL24o25JN77WSyJwByW5k3ou42w8dw/EULM5yag2dVcQoBcie37Kz//kINVqyuhl\nIAdmcONQPig2wsjdUg6cbGBeuTBIfQAAAAMBAAEAAAGAANkgzH+zgR8NThjPTkGtWUuLvp\nLX0B4Z99fhcW64VhqfpQ7fIGAAVX+mOHSjeqzLZ+w/YFUgJWQgJ9x8fGlgL3Fx2rKcXvWF\n4mQ04finfBCF8QUJ/k4gwOSx9Ha8gAapjKdtL2CrUezkt5SCF3xQUqwTMHbpysy8JisGS1\nqtEln+r1W8KcUckfQsgcqHReg45mSt0AdqkN46pS9R1ly9FZ8gK2Oxy71L3yyyuLzD6p7E\nh/hXR74XBIcKjJVk+OIPn4alrQiTZ4w4CytxT2yPD8/UxfHVibzpqeUOokgbmtXvcdi4s1\nbjUqohXO2Uy3qBuJw4+09gbagdBNazVAxDdWgaPlGZhySuy6831vwfrLItlsCKX8WGtZTu\nhxaHef2EIl1dRrp8h9XIQrG7zhbV7wBwEjuB0ypSTW1oURdRl6pyqQGhwzwlbsKd3qumH9\nKC216y9yhWd48Folm6UF0Vb6as2icGZ9wjdckIGEvY9e2vcKz5MvgaCcV42f6CJlixAAAA\nwQCVYwwKCHNlZxl0/NMkDJ+hp7/InHF6mz/3VO58iCb19TLDVUC2dDGPXNYwWTT9Pclefw\nV5HNBHcAfTzgB4dpQyNiDyV914HL7DFEGduoPnwBYjeFre54v0YjjnskjJO7myircdbdX/\n/i+7LMUw5aZZXCC8a5BD/rdV6IKJWJG5QBXbe5fVf1XwOjBTzlhIPIqhNFfSu+mFikp5BR\nwHGBqsKMju6inYmW6YADeY/SvOQjDEB37RqGZxqyIx8V2ZYwUAAADBANJZC8Ih75k2BUwg\nuzzfd/AIJPfzULOT0NfDEZ/TiZsn0qWKn/4DafjHe8VILRfzE4n+7npadiew2H+n4/RGH/\nYOBLlvkkIBT+KX4iZ9fsxhXk0KtSEr8I7AOBPGUrfhiLpo2U4OmIi9fwO/buMJtuLMLe4q\np1VYjj7TxjjN+EtbQGpo2c6tnmQ5gBeqQH5rkzHYpwjEdRNZDSWG8Xqi4qkAl7sAQZxzjj\niaHzdwJL840VAQfbnb54qmMR9z0HMT8QAAAMEAzFPkrAGFmGcl51g3zsqRymXvF0ySlTxv\n5pd5mg3KQJ6gL7CAhB7GdJaYWTgc+QI3G8JaVuQ5PUwetMAoWdo7DDbc5v5WLoD2fSujOj\n2+2gmKDXXgYHSBSoSa18uE7U/kATzLOiAT4gsfKnQGpe3y8Yh/OkOcKQ34YqXyA44w+tHg\n0Bws75GyFzmcuzsEYHhISLXbpjqZJ+nzmbT77VCFYzP0fOokQcJYpVxlh0J0Q40/2OzTgR\nScrfcq2UkhbNlNAAAAAAEC\n-----END OPENSSH PRIVATE KEY-----\n" + ); assert_eq!( ssh.public_key, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCn4+QiJojZ9mgc9KYJIvDWGaz4qFhf0CButg6L8zEoHKwuiN+mqcEciCCOa9BNiJmm8NTTehZvrrglGG59zIbqYtDAHjVn+vtb49xPzIv+M651Yqj08lIbR9tEIHKCq7aH8GlDm8NgG9EzJGjlL7okQym4TH1MHl+s4mUyr/qb2unlZBDixAQsphU8iCLftukWCIkmQg4CSj1Gh3WbBlZ+EX5eW0EXuAw4XsSbBTWV9CHRowVIpYqPvEYSpHsoCjEcd988p19hpiGknA0J4z7JfUlNgyT/1chb8GCTDT+2DCBRApbsIg6TOBVS+PR6emAQ3eZzUW0+3/oRM4ip0ujltQy8uU6gvYIAqx5wXGMThVpZcUgahKiSsVo/s4b84iMe4DG3W8jz4qi6yyNv0VedEzPUZ1lXd1GJFoy9uKNuSTe+1ksicAcluZN6LuNsPHcPxFCzOcmoNnVXEKAXInt+ys//5CDVasroZSAHZnDjUD4oNsLI3VIOnGxgXrkwSH0=" diff --git a/crates/bitwarden-exporters/src/cxf/tests/one_password_import_test.rs b/crates/bitwarden-exporters/src/cxf/tests/one_password_import_test.rs index a610d9644..b7456e509 100644 --- a/crates/bitwarden-exporters/src/cxf/tests/one_password_import_test.rs +++ b/crates/bitwarden-exporters/src/cxf/tests/one_password_import_test.rs @@ -6,9 +6,9 @@ mod tests { use crate::{ - cxf::{parse_cxf, CxfError}, Card, CipherType, Field, Identity, ImportingCipher, Login, LoginUri, SecureNote, SecureNoteType, + cxf::{CxfError, parse_cxf}, }; fn load_file() -> Result, CxfError> { diff --git a/crates/bitwarden-exporters/src/cxf/tests/sample_import_test.rs b/crates/bitwarden-exporters/src/cxf/tests/sample_import_test.rs index 1bb3e97ea..1ccbc7bb5 100644 --- a/crates/bitwarden-exporters/src/cxf/tests/sample_import_test.rs +++ b/crates/bitwarden-exporters/src/cxf/tests/sample_import_test.rs @@ -3,8 +3,8 @@ //! These tests validate the parsing of real CXF sample files against the specification. use crate::{ - cxf::{import::parse_item, CxfError}, CipherType, ImportingCipher, + cxf::{CxfError, import::parse_item}, }; /// Parse CXF payload in the format compatible with the CXF specification (At the diff --git a/crates/bitwarden-exporters/src/cxf/wifi.rs b/crates/bitwarden-exporters/src/cxf/wifi.rs index 41bc25d41..545bd543f 100644 --- a/crates/bitwarden-exporters/src/cxf/wifi.rs +++ b/crates/bitwarden-exporters/src/cxf/wifi.rs @@ -1,6 +1,6 @@ use credential_exchange_format::WifiCredential; -use crate::{cxf::editable_field::create_field, Field}; +use crate::{Field, cxf::editable_field::create_field}; /// Convert WiFi credentials to custom fields following the CXF mapping convention pub(super) fn wifi_to_fields(wifi: &WifiCredential) -> Vec { diff --git a/crates/bitwarden-exporters/src/encrypted_json.rs b/crates/bitwarden-exporters/src/encrypted_json.rs index d0a855738..c939e3a8d 100644 --- a/crates/bitwarden-exporters/src/encrypted_json.rs +++ b/crates/bitwarden-exporters/src/encrypted_json.rs @@ -1,12 +1,12 @@ -use bitwarden_crypto::{generate_random_bytes, Kdf, KeyEncryptable, PinKey}; +use bitwarden_crypto::{Kdf, KeyEncryptable, PinKey, generate_random_bytes}; use bitwarden_encoding::B64; use serde::Serialize; use thiserror::Error; use uuid::Uuid; use crate::{ - json::{self, export_json}, Cipher, Folder, + json::{self, export_json}, }; #[derive(Error, Debug)] diff --git a/crates/bitwarden-exporters/src/export.rs b/crates/bitwarden-exporters/src/export.rs index 098c1aac9..19aeaa2b3 100644 --- a/crates/bitwarden-exporters/src/export.rs +++ b/crates/bitwarden-exporters/src/export.rs @@ -1,14 +1,14 @@ use bitwarden_collections::collection::Collection; -use bitwarden_core::{key_management::KeyIds, Client}; +use bitwarden_core::{Client, key_management::KeyIds}; use bitwarden_crypto::{CompositeEncryptable, IdentifyKey, KeyStoreContext}; use bitwarden_vault::{Cipher, CipherView, Folder, FolderView}; use crate::{ + ExportError, ExportFormat, ImportingCipher, csv::export_csv, - cxf::{build_cxf, parse_cxf, Account}, + cxf::{Account, build_cxf, parse_cxf}, encrypted_json::export_encrypted_json, json::export_json, - ExportError, ExportFormat, ImportingCipher, }; pub(crate) fn export_vault( diff --git a/crates/bitwarden-exporters/src/exporter_client.rs b/crates/bitwarden-exporters/src/exporter_client.rs index 451148179..d55f73f05 100644 --- a/crates/bitwarden-exporters/src/exporter_client.rs +++ b/crates/bitwarden-exporters/src/exporter_client.rs @@ -5,8 +5,8 @@ use bitwarden_vault::{Cipher, Folder}; use wasm_bindgen::prelude::*; use crate::{ - export::{export_cxf, export_organization_vault, export_vault, import_cxf}, Account, ExportError, ExportFormat, + export::{export_cxf, export_organization_vault, export_vault, import_cxf}, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-exporters/src/models.rs b/crates/bitwarden-exporters/src/models.rs index d66f12d1a..0c069a535 100644 --- a/crates/bitwarden-exporters/src/models.rs +++ b/crates/bitwarden-exporters/src/models.rs @@ -1,4 +1,4 @@ -use bitwarden_core::{key_management::KeyIds, require, MissingFieldError}; +use bitwarden_core::{MissingFieldError, key_management::KeyIds, require}; use bitwarden_crypto::KeyStore; use bitwarden_vault::{ CardView, Cipher, CipherType, CipherView, Fido2CredentialFullView, FieldType, FieldView, diff --git a/crates/bitwarden-fido/src/authenticator.rs b/crates/bitwarden-fido/src/authenticator.rs index 2559c26e1..6093142e6 100644 --- a/crates/bitwarden-fido/src/authenticator.rs +++ b/crates/bitwarden-fido/src/authenticator.rs @@ -8,19 +8,19 @@ use log::error; use passkey::{ authenticator::{Authenticator, DiscoverabilitySupport, StoreInfo, UIHint, UserCheck}, types::{ - ctap2::{self, Ctap2Error, StatusCode, VendorError}, Passkey, + ctap2::{self, Ctap2Error, StatusCode, VendorError}, }, }; use thiserror::Error; use super::{ - try_from_credential_new_view, types::*, CheckUserOptions, CipherViewContainer, - Fido2CredentialStore, Fido2UserInterface, SelectedCredential, UnknownEnumError, AAGUID, + AAGUID, CheckUserOptions, CipherViewContainer, Fido2CredentialStore, Fido2UserInterface, + SelectedCredential, UnknownEnumError, try_from_credential_new_view, types::*, }; use crate::{ - fill_with_credential, string_to_guid_bytes, try_from_credential_full, Fido2CallbackError, - FillCredentialError, InvalidGuidError, + Fido2CallbackError, FillCredentialError, InvalidGuidError, fill_with_credential, + string_to_guid_bytes, try_from_credential_full, }; #[derive(Debug, Error)] diff --git a/crates/bitwarden-fido/src/client.rs b/crates/bitwarden-fido/src/client.rs index 3f86b8750..9e58fdaef 100644 --- a/crates/bitwarden-fido/src/client.rs +++ b/crates/bitwarden-fido/src/client.rs @@ -2,14 +2,14 @@ use passkey::client::WebauthnError; use thiserror::Error; use super::{ + Fido2Authenticator, PublicKeyCredentialAuthenticatorAssertionResponse, + PublicKeyCredentialAuthenticatorAttestationResponse, authenticator::GetSelectedCredentialError, get_string_name_from_enum, types::{ AuthenticatorAssertionResponse, AuthenticatorAttestationResponse, ClientData, ClientExtensionResults, CredPropsResult, Origin, }, - Fido2Authenticator, PublicKeyCredentialAuthenticatorAssertionResponse, - PublicKeyCredentialAuthenticatorAttestationResponse, }; use crate::types::InvalidOriginError; diff --git a/crates/bitwarden-fido/src/crypto.rs b/crates/bitwarden-fido/src/crypto.rs index fcde29a1a..e087b319c 100644 --- a/crates/bitwarden-fido/src/crypto.rs +++ b/crates/bitwarden-fido/src/crypto.rs @@ -1,9 +1,9 @@ -use coset::{iana, CoseKey}; +use coset::{CoseKey, iana}; use p256::{ - pkcs8::{DecodePrivateKey, EncodePrivateKey}, SecretKey, + pkcs8::{DecodePrivateKey, EncodePrivateKey}, }; -use passkey::authenticator::{private_key_from_cose_key, CoseKeyPair}; +use passkey::authenticator::{CoseKeyPair, private_key_from_cose_key}; use thiserror::Error; #[derive(Debug, Error)] diff --git a/crates/bitwarden-fido/src/lib.rs b/crates/bitwarden-fido/src/lib.rs index 04df63207..d75a5f32b 100644 --- a/crates/bitwarden-fido/src/lib.rs +++ b/crates/bitwarden-fido/src/lib.rs @@ -7,7 +7,7 @@ use bitwarden_vault::{ CipherError, CipherView, Fido2CredentialFullView, Fido2CredentialNewView, Fido2CredentialView, }; use crypto::{CoseKeyToPkcs8Error, PrivateKeyFromSecretKeyError}; -use passkey::types::{ctap2::Aaguid, Passkey}; +use passkey::types::{Passkey, ctap2::Aaguid}; #[cfg(feature = "uniffi")] uniffi::setup_scaffolding!(); @@ -296,7 +296,9 @@ mod tests { let bytes = super::string_to_guid_bytes(uuid).unwrap(); assert_eq!( bytes, - vec![213, 72, 130, 110, 121, 180, 219, 64, 163, 216, 17, 17, 111, 126, 131, 73] + vec![ + 213, 72, 130, 110, 121, 180, 219, 64, 163, 216, 17, 17, 111, 126, 131, 73 + ] ); } @@ -306,7 +308,9 @@ mod tests { let bytes = super::string_to_guid_bytes(b64).unwrap(); assert_eq!( bytes, - vec![213, 72, 130, 110, 121, 180, 219, 64, 163, 216, 17, 17, 111, 126, 131, 73] + vec![ + 213, 72, 130, 110, 121, 180, 219, 64, 163, 216, 17, 17, 111, 126, 131, 73 + ] ); } } diff --git a/crates/bitwarden-fido/src/types.rs b/crates/bitwarden-fido/src/types.rs index da74a0450..ff9c95235 100644 --- a/crates/bitwarden-fido/src/types.rs +++ b/crates/bitwarden-fido/src/types.rs @@ -10,8 +10,8 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use super::{ - get_enum_from_string_name, string_to_guid_bytes, InvalidGuidError, SelectedCredential, - UnknownEnumError, Verification, + InvalidGuidError, SelectedCredential, UnknownEnumError, Verification, + get_enum_from_string_name, string_to_guid_bytes, }; #[allow(missing_docs)] @@ -53,9 +53,7 @@ impl NoneWhitespace for Option { #[allow(missing_docs)] #[derive(Debug, Error)] pub enum Fido2CredentialAutofillViewError { - #[error( - "Autofill credentials can only be created from existing ciphers that have a cipher id" - )] + #[error("Autofill credentials can only be created from existing ciphers that have a cipher id")] MissingCipherId, #[error(transparent)] diff --git a/crates/bitwarden-generators/src/generator_client.rs b/crates/bitwarden-generators/src/generator_client.rs index 6bc6bd2e5..2fdf69998 100644 --- a/crates/bitwarden-generators/src/generator_client.rs +++ b/crates/bitwarden-generators/src/generator_client.rs @@ -3,9 +3,9 @@ use bitwarden_core::Client; use wasm_bindgen::prelude::*; use crate::{ - passphrase::passphrase, password::password, username::username, PassphraseError, - PassphraseGeneratorRequest, PasswordError, PasswordGeneratorRequest, UsernameError, - UsernameGeneratorRequest, + PassphraseError, PassphraseGeneratorRequest, PasswordError, PasswordGeneratorRequest, + UsernameError, UsernameGeneratorRequest, passphrase::passphrase, password::password, + username::username, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-generators/src/passphrase.rs b/crates/bitwarden-generators/src/passphrase.rs index e8aba4139..0095bab5e 100644 --- a/crates/bitwarden-generators/src/passphrase.rs +++ b/crates/bitwarden-generators/src/passphrase.rs @@ -1,6 +1,6 @@ use bitwarden_crypto::EFF_LONG_WORD_LIST; use bitwarden_error::bitwarden_error; -use rand::{seq::SliceRandom, Rng, RngCore}; +use rand::{Rng, RngCore, seq::SliceRandom}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use thiserror::Error; diff --git a/crates/bitwarden-generators/src/password.rs b/crates/bitwarden-generators/src/password.rs index 5e112b055..137be9bcb 100644 --- a/crates/bitwarden-generators/src/password.rs +++ b/crates/bitwarden-generators/src/password.rs @@ -1,7 +1,7 @@ use std::collections::BTreeSet; use bitwarden_error::bitwarden_error; -use rand::{distributions::Distribution, seq::SliceRandom, RngCore}; +use rand::{RngCore, distributions::Distribution, seq::SliceRandom}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use thiserror::Error; diff --git a/crates/bitwarden-generators/src/username.rs b/crates/bitwarden-generators/src/username.rs index f611da690..00d5af936 100644 --- a/crates/bitwarden-generators/src/username.rs +++ b/crates/bitwarden-generators/src/username.rs @@ -1,6 +1,6 @@ use bitwarden_crypto::EFF_LONG_WORD_LIST; use bitwarden_error::bitwarden_error; -use rand::{distributions::Distribution, seq::SliceRandom, Rng, RngCore}; +use rand::{Rng, RngCore, distributions::Distribution, seq::SliceRandom}; use reqwest::StatusCode; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -156,8 +156,8 @@ pub(crate) async fn username( input: UsernameGeneratorRequest, http: &reqwest::Client, ) -> Result { - use rand::thread_rng; use UsernameGeneratorRequest::*; + use rand::thread_rng; match input { Word { capitalize, diff --git a/crates/bitwarden-generators/src/username_forwarders/addyio.rs b/crates/bitwarden-generators/src/username_forwarders/addyio.rs index 4b75e1c84..bace22fa6 100644 --- a/crates/bitwarden-generators/src/username_forwarders/addyio.rs +++ b/crates/bitwarden-generators/src/username_forwarders/addyio.rs @@ -1,4 +1,4 @@ -use reqwest::{header::CONTENT_TYPE, StatusCode}; +use reqwest::{StatusCode, header::CONTENT_TYPE}; use crate::username::UsernameError; @@ -56,7 +56,7 @@ mod tests { use crate::username::UsernameError; #[tokio::test] async fn test_mock_server() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; diff --git a/crates/bitwarden-generators/src/username_forwarders/duckduckgo.rs b/crates/bitwarden-generators/src/username_forwarders/duckduckgo.rs index 3f21fd3a5..4b86e68bd 100644 --- a/crates/bitwarden-generators/src/username_forwarders/duckduckgo.rs +++ b/crates/bitwarden-generators/src/username_forwarders/duckduckgo.rs @@ -1,4 +1,4 @@ -use reqwest::{header::CONTENT_TYPE, StatusCode}; +use reqwest::{StatusCode, header::CONTENT_TYPE}; use crate::username::UsernameError; @@ -41,7 +41,7 @@ mod tests { use crate::username::UsernameError; #[tokio::test] async fn test_mock_server() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; diff --git a/crates/bitwarden-generators/src/username_forwarders/fastmail.rs b/crates/bitwarden-generators/src/username_forwarders/fastmail.rs index 8a73250c4..5cf181d7c 100644 --- a/crates/bitwarden-generators/src/username_forwarders/fastmail.rs +++ b/crates/bitwarden-generators/src/username_forwarders/fastmail.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use reqwest::{header::CONTENT_TYPE, StatusCode}; +use reqwest::{StatusCode, header::CONTENT_TYPE}; use serde_json::json; use crate::username::UsernameError; @@ -129,7 +129,7 @@ mod tests { use crate::username::UsernameError; #[tokio::test] async fn test_mock_server() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; diff --git a/crates/bitwarden-generators/src/username_forwarders/firefox.rs b/crates/bitwarden-generators/src/username_forwarders/firefox.rs index 66c2a3a2c..7866c0a4b 100644 --- a/crates/bitwarden-generators/src/username_forwarders/firefox.rs +++ b/crates/bitwarden-generators/src/username_forwarders/firefox.rs @@ -1,6 +1,6 @@ use reqwest::{ - header::{self}, StatusCode, + header::{self}, }; use crate::username::UsernameError; @@ -64,7 +64,7 @@ mod tests { #[tokio::test] async fn test_mock_success() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; @@ -101,7 +101,7 @@ mod tests { #[tokio::test] async fn test_mock_without_website() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; @@ -137,7 +137,7 @@ mod tests { #[tokio::test] async fn test_mock_invalid_token() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; diff --git a/crates/bitwarden-generators/src/username_forwarders/forwardemail.rs b/crates/bitwarden-generators/src/username_forwarders/forwardemail.rs index 1cec22882..936416b1c 100644 --- a/crates/bitwarden-generators/src/username_forwarders/forwardemail.rs +++ b/crates/bitwarden-generators/src/username_forwarders/forwardemail.rs @@ -1,4 +1,4 @@ -use reqwest::{header::CONTENT_TYPE, StatusCode}; +use reqwest::{StatusCode, header::CONTENT_TYPE}; use crate::username::UsernameError; @@ -93,7 +93,7 @@ mod tests { #[tokio::test] async fn test_mock_server() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; @@ -200,9 +200,11 @@ mod tests { .await .unwrap_err(); - assert!(free_token_error - .to_string() - .contains("Please upgrade to a paid plan")); + assert!( + free_token_error + .to_string() + .contains("Please upgrade to a paid plan") + ); server.verify().await; } diff --git a/crates/bitwarden-generators/src/username_forwarders/simplelogin.rs b/crates/bitwarden-generators/src/username_forwarders/simplelogin.rs index c5266ac3e..da7b197ca 100644 --- a/crates/bitwarden-generators/src/username_forwarders/simplelogin.rs +++ b/crates/bitwarden-generators/src/username_forwarders/simplelogin.rs @@ -1,4 +1,4 @@ -use reqwest::{header::CONTENT_TYPE, StatusCode}; +use reqwest::{StatusCode, header::CONTENT_TYPE}; use crate::username::UsernameError; @@ -60,7 +60,7 @@ mod tests { use crate::username::UsernameError; #[tokio::test] async fn test_mock_server() { - use wiremock::{matchers, Mock, ResponseTemplate}; + use wiremock::{Mock, ResponseTemplate, matchers}; let server = wiremock::MockServer::start().await; diff --git a/crates/bitwarden-ipc/src/discover/mod.rs b/crates/bitwarden-ipc/src/discover/mod.rs index 5cbf504fb..497f4e96a 100644 --- a/crates/bitwarden-ipc/src/discover/mod.rs +++ b/crates/bitwarden-ipc/src/discover/mod.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "wasm")] use {tsify::Tsify, wasm_bindgen::prelude::*}; -use crate::{rpc::request::RpcRequest, RpcHandler}; +use crate::{RpcHandler, rpc::request::RpcRequest}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DiscoverRequest; diff --git a/crates/bitwarden-ipc/src/ipc_client.rs b/crates/bitwarden-ipc/src/ipc_client.rs index 95495deda..926b1f325 100644 --- a/crates/bitwarden-ipc/src/ipc_client.rs +++ b/crates/bitwarden-ipc/src/ipc_client.rs @@ -7,6 +7,7 @@ use thiserror::Error; use tokio::{select, sync::RwLock}; use crate::{ + RpcHandler, constants::CHANNEL_BUFFER_CAPACITY, endpoint::Endpoint, message::{ @@ -17,12 +18,11 @@ use crate::{ error::RpcError, exec::handler_registry::RpcHandlerRegistry, request::RpcRequest, - request_message::{RpcRequestMessage, RpcRequestPayload, RPC_REQUEST_PAYLOAD_TYPE_NAME}, + request_message::{RPC_REQUEST_PAYLOAD_TYPE_NAME, RpcRequestMessage, RpcRequestPayload}, response_message::{IncomingRpcResponseMessage, OutgoingRpcResponseMessage}, }, serde_utils, traits::{CommunicationBackend, CryptoProvider, SessionRepository}, - RpcHandler, }; /// An IPC client that handles communication between different components and clients. @@ -448,7 +448,7 @@ mod tests { use crate::{ endpoint::Endpoint, traits::{ - tests::TestCommunicationBackend, InMemorySessionRepository, NoEncryptionCryptoProvider, + InMemorySessionRepository, NoEncryptionCryptoProvider, tests::TestCommunicationBackend, }, }; diff --git a/crates/bitwarden-ipc/src/message.rs b/crates/bitwarden-ipc/src/message.rs index cff102f2a..113da7141 100644 --- a/crates/bitwarden-ipc/src/message.rs +++ b/crates/bitwarden-ipc/src/message.rs @@ -1,4 +1,4 @@ -use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::DeserializeOwned}; #[cfg(feature = "wasm")] use wasm_bindgen::prelude::*; diff --git a/crates/bitwarden-ipc/src/rpc/exec/handler_registry.rs b/crates/bitwarden-ipc/src/rpc/exec/handler_registry.rs index c3df38cec..121cc607a 100644 --- a/crates/bitwarden-ipc/src/rpc/exec/handler_registry.rs +++ b/crates/bitwarden-ipc/src/rpc/exec/handler_registry.rs @@ -36,7 +36,7 @@ impl RpcHandlerRegistry { #[cfg(test)] mod test { - use serde::{de::DeserializeOwned, Deserialize, Serialize}; + use serde::{Deserialize, Serialize, de::DeserializeOwned}; use super::*; use crate::{ diff --git a/crates/bitwarden-ipc/src/rpc/request.rs b/crates/bitwarden-ipc/src/rpc/request.rs index 43d62173f..eb518683c 100644 --- a/crates/bitwarden-ipc/src/rpc/request.rs +++ b/crates/bitwarden-ipc/src/rpc/request.rs @@ -1,4 +1,4 @@ -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; pub trait RpcRequest: Serialize + DeserializeOwned + 'static { type Response: Serialize + DeserializeOwned + 'static; diff --git a/crates/bitwarden-ipc/src/serde_utils.rs b/crates/bitwarden-ipc/src/serde_utils.rs index 3c888441a..ea5f37dea 100644 --- a/crates/bitwarden-ipc/src/serde_utils.rs +++ b/crates/bitwarden-ipc/src/serde_utils.rs @@ -2,7 +2,7 @@ //! This module provides functions to serialize and deserialize IPC messages in one place, //! ensuring consistency and reducing code duplication across the IPC crate. -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; pub(crate) type SerializeError = serde_json::Error; pub(crate) type DeserializeError = serde_json::Error; diff --git a/crates/bitwarden-ipc/src/traits/communication_backend.rs b/crates/bitwarden-ipc/src/traits/communication_backend.rs index 896bdd806..1fde88819 100644 --- a/crates/bitwarden-ipc/src/traits/communication_backend.rs +++ b/crates/bitwarden-ipc/src/traits/communication_backend.rs @@ -58,8 +58,8 @@ pub mod tests { use std::sync::Arc; use tokio::sync::{ - broadcast::{self, Receiver, Sender}, RwLock, + broadcast::{self, Receiver, Sender}, }; use super::*; diff --git a/crates/bitwarden-ipc/src/wasm/discover.rs b/crates/bitwarden-ipc/src/wasm/discover.rs index 75a4b481e..925877bf8 100644 --- a/crates/bitwarden-ipc/src/wasm/discover.rs +++ b/crates/bitwarden-ipc/src/wasm/discover.rs @@ -3,9 +3,9 @@ use wasm_bindgen::prelude::wasm_bindgen; use super::JsIpcClient; use crate::{ + RequestError, discover::{DiscoverHandler, DiscoverRequest, DiscoverResponse}, endpoint::Endpoint, - RequestError, }; #[wasm_bindgen(js_name = ipcRegisterDiscoverHandler)] diff --git a/crates/bitwarden-ipc/src/wasm/ipc_client.rs b/crates/bitwarden-ipc/src/wasm/ipc_client.rs index ae39ccf61..141f5989e 100644 --- a/crates/bitwarden-ipc/src/wasm/ipc_client.rs +++ b/crates/bitwarden-ipc/src/wasm/ipc_client.rs @@ -5,10 +5,10 @@ use wasm_bindgen::prelude::*; use super::communication_backend::JsCommunicationBackend; use crate::{ + IpcClient, ipc_client::{IpcClientSubscription, ReceiveError, SubscribeError}, message::{IncomingMessage, OutgoingMessage}, traits::{InMemorySessionRepository, NoEncryptionCryptoProvider}, - IpcClient, }; /// JavaScript wrapper around the IPC client. For more information, see the diff --git a/crates/bitwarden-send/src/send.rs b/crates/bitwarden-send/src/send.rs index 6c2bfa946..8906a1938 100644 --- a/crates/bitwarden-send/src/send.rs +++ b/crates/bitwarden-send/src/send.rs @@ -4,10 +4,10 @@ use bitwarden_core::{ require, }; use bitwarden_crypto::{ - generate_random_bytes, CompositeEncryptable, CryptoError, Decryptable, EncString, IdentifyKey, - KeyStoreContext, OctetStreamBytes, PrimitiveEncryptable, + CompositeEncryptable, CryptoError, Decryptable, EncString, IdentifyKey, KeyStoreContext, + OctetStreamBytes, PrimitiveEncryptable, generate_random_bytes, }; -use bitwarden_encoding::{B64Url, B64}; +use bitwarden_encoding::{B64, B64Url}; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; @@ -432,7 +432,10 @@ mod tests { #[allow(deprecated)] let send_key = ctx.dangerous_get_symmetric_key(send_key).unwrap(); let send_key_b64 = send_key.to_base64(); - assert_eq!(send_key_b64.to_string(), "IR9ImHGm6rRuIjiN7csj94bcZR5WYTJj5GtNfx33zm6tJCHUl+QZlpNPba8g2yn70KnOHsAODLcR0um6E3MAlg=="); + assert_eq!( + send_key_b64.to_string(), + "IR9ImHGm6rRuIjiN7csj94bcZR5WYTJj5GtNfx33zm6tJCHUl+QZlpNPba8g2yn70KnOHsAODLcR0um6E3MAlg==" + ); } #[test] diff --git a/crates/bitwarden-ssh/src/export.rs b/crates/bitwarden-ssh/src/export.rs index 44c0bc3b7..bba3d91a3 100644 --- a/crates/bitwarden-ssh/src/export.rs +++ b/crates/bitwarden-ssh/src/export.rs @@ -1,6 +1,6 @@ use pkcs8::EncodePrivateKey; use rsa::RsaPrivateKey; -use ssh_key::{private::RsaKeypair, PrivateKey}; +use ssh_key::{PrivateKey, private::RsaKeypair}; use crate::error::SshKeyExportError; diff --git a/crates/bitwarden-ssh/src/generator.rs b/crates/bitwarden-ssh/src/generator.rs index fcd16980b..a058ee8f8 100644 --- a/crates/bitwarden-ssh/src/generator.rs +++ b/crates/bitwarden-ssh/src/generator.rs @@ -1,6 +1,6 @@ use bitwarden_vault::SshKeyView; use serde::{Deserialize, Serialize}; -use ssh_key::{rand_core::CryptoRngCore, Algorithm}; +use ssh_key::{Algorithm, rand_core::CryptoRngCore}; #[cfg(feature = "wasm")] use tsify::Tsify; diff --git a/crates/bitwarden-ssh/src/import.rs b/crates/bitwarden-ssh/src/import.rs index df51dbd72..c8f745b61 100644 --- a/crates/bitwarden-ssh/src/import.rs +++ b/crates/bitwarden-ssh/src/import.rs @@ -1,7 +1,7 @@ use bitwarden_vault::SshKeyView; use ed25519; use pem_rfc7468::PemLabel; -use pkcs8::{der::Decode, pkcs5, DecodePrivateKey, PrivateKeyInfo, SecretDocument}; +use pkcs8::{DecodePrivateKey, PrivateKeyInfo, SecretDocument, der::Decode, pkcs5}; use ssh_key::private::{Ed25519Keypair, RsaKeypair}; use crate::{error::SshKeyImportError, ssh_private_key_to_view}; diff --git a/crates/bitwarden-state/src/registry.rs b/crates/bitwarden-state/src/registry.rs index ae6d6500c..e2a7e766e 100644 --- a/crates/bitwarden-state/src/registry.rs +++ b/crates/bitwarden-state/src/registry.rs @@ -5,7 +5,7 @@ use std::{ }; use bitwarden_error::bitwarden_error; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; use thiserror::Error; use crate::{ diff --git a/crates/bitwarden-state/src/sdk_managed/sqlite.rs b/crates/bitwarden-state/src/sdk_managed/sqlite.rs index bcb2c3dfe..b23e46eb8 100644 --- a/crates/bitwarden-state/src/sdk_managed/sqlite.rs +++ b/crates/bitwarden-state/src/sdk_managed/sqlite.rs @@ -5,7 +5,7 @@ use tokio::sync::Mutex; use crate::{ repository::{ - validate_registry_name, RepositoryItem, RepositoryMigrationStep, RepositoryMigrations, + RepositoryItem, RepositoryMigrationStep, RepositoryMigrations, validate_registry_name, }, sdk_managed::{Database, DatabaseConfiguration, DatabaseError}, }; diff --git a/crates/bitwarden-threading/tests/thread_bound_runner/wasm.rs b/crates/bitwarden-threading/tests/thread_bound_runner/wasm.rs index 96b8e1775..e55dd203f 100644 --- a/crates/bitwarden-threading/tests/thread_bound_runner/wasm.rs +++ b/crates/bitwarden-threading/tests/thread_bound_runner/wasm.rs @@ -1,6 +1,6 @@ use bitwarden_threading::ThreadBoundRunner; use serde::{Deserialize, Serialize}; -use tsify::{serde_wasm_bindgen, Tsify}; +use tsify::{Tsify, serde_wasm_bindgen}; use wasm_bindgen::prelude::*; use wasm_bindgen_test::wasm_bindgen_test; diff --git a/crates/bitwarden-uniffi/src/android_support.rs b/crates/bitwarden-uniffi/src/android_support.rs index aa0e4228a..12ebc38df 100644 --- a/crates/bitwarden-uniffi/src/android_support.rs +++ b/crates/bitwarden-uniffi/src/android_support.rs @@ -1,13 +1,13 @@ use std::{error::Error, sync::OnceLock}; -use jni::sys::{jint, jsize, JavaVM}; +use jni::sys::{JavaVM, jint, jsize}; pub static JAVA_VM: OnceLock = OnceLock::new(); // This function is called when the Android app calls `System.loadLibrary("bitwarden_uniffi")` // Important: This function must be named `JNI_OnLoad` or otherwise it won't be called #[allow(non_snake_case)] -#[no_mangle] +#[unsafe(no_mangle)] pub extern "system" fn JNI_OnLoad(vm_ptr: jni::JavaVM, _reserved: *mut std::ffi::c_void) -> jint { log::info!("JNI_OnLoad initializing"); JAVA_VM.get_or_init(|| vm_ptr); diff --git a/crates/bitwarden-uniffi/src/auth/mod.rs b/crates/bitwarden-uniffi/src/auth/mod.rs index a25e8470b..d320f120e 100644 --- a/crates/bitwarden-uniffi/src/auth/mod.rs +++ b/crates/bitwarden-uniffi/src/auth/mod.rs @@ -1,6 +1,6 @@ use bitwarden_core::auth::{ - password::MasterPasswordPolicyOptions, AuthRequestResponse, KeyConnectorResponse, - RegisterKeyResponse, RegisterTdeKeyResponse, + AuthRequestResponse, KeyConnectorResponse, RegisterKeyResponse, RegisterTdeKeyResponse, + password::MasterPasswordPolicyOptions, }; use bitwarden_crypto::{EncString, HashPurpose, Kdf, TrustDeviceResponse, UnsignedSharedKey}; use bitwarden_encoding::B64; diff --git a/crates/bitwarden-uniffi/src/lib.rs b/crates/bitwarden-uniffi/src/lib.rs index 772efcdae..9e2244dd8 100644 --- a/crates/bitwarden-uniffi/src/lib.rs +++ b/crates/bitwarden-uniffi/src/lib.rs @@ -5,7 +5,7 @@ uniffi::setup_scaffolding!(); use std::sync::Arc; use auth::AuthClient; -use bitwarden_core::{client::internal::ClientManagedTokens, ClientSettings}; +use bitwarden_core::{ClientSettings, client::internal::ClientManagedTokens}; #[allow(missing_docs)] pub mod auth; @@ -65,7 +65,7 @@ impl Client { #[allow(missing_docs)] pub fn platform(&self) -> PlatformClient { - PlatformClient(self.0 .0.clone()) + PlatformClient(self.0.0.clone()) } /// Generator operations @@ -90,7 +90,7 @@ impl Client { /// Auth operations pub fn auth(&self) -> AuthClient { - AuthClient(self.0 .0.clone()) + AuthClient(self.0.0.clone()) } /// Test method, echoes back the input @@ -100,7 +100,7 @@ impl Client { /// Test method, calls http endpoint pub async fn http_get(&self, url: String) -> Result { - let client = self.0 .0.internal.get_http_client(); + let client = self.0.0.internal.get_http_client(); let res = client .get(&url) .send() diff --git a/crates/bitwarden-uniffi/src/platform/fido2.rs b/crates/bitwarden-uniffi/src/platform/fido2.rs index 812d3ae6c..a16c12dea 100644 --- a/crates/bitwarden-uniffi/src/platform/fido2.rs +++ b/crates/bitwarden-uniffi/src/platform/fido2.rs @@ -128,9 +128,9 @@ impl ClientFido2Client { request: String, client_data: ClientData, ) -> Result { - let ui = UniffiTraitBridge(self.0 .1.as_ref()); - let cs = UniffiTraitBridge(self.0 .2.as_ref()); - let mut client = self.0 .0.create_client(&ui, &cs); + let ui = UniffiTraitBridge(self.0.1.as_ref()); + let cs = UniffiTraitBridge(self.0.2.as_ref()); + let mut client = self.0.0.create_client(&ui, &cs); let result = client .register(origin, request, client_data) @@ -145,9 +145,9 @@ impl ClientFido2Client { request: String, client_data: ClientData, ) -> Result { - let ui = UniffiTraitBridge(self.0 .1.as_ref()); - let cs = UniffiTraitBridge(self.0 .2.as_ref()); - let mut client = self.0 .0.create_client(&ui, &cs); + let ui = UniffiTraitBridge(self.0.1.as_ref()); + let cs = UniffiTraitBridge(self.0.2.as_ref()); + let mut client = self.0.0.create_client(&ui, &cs); let result = client .authenticate(origin, request, client_data) diff --git a/crates/bitwarden-uniffi/src/platform/mod.rs b/crates/bitwarden-uniffi/src/platform/mod.rs index f17f91019..8f71c5775 100644 --- a/crates/bitwarden-uniffi/src/platform/mod.rs +++ b/crates/bitwarden-uniffi/src/platform/mod.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bitwarden_core::{platform::FingerprintRequest, Client}; +use bitwarden_core::{Client, platform::FingerprintRequest}; use bitwarden_fido::ClientFido2Ext; use bitwarden_state::DatabaseConfiguration; use bitwarden_vault::Cipher; diff --git a/crates/bitwarden-uniffi/src/platform/repository.rs b/crates/bitwarden-uniffi/src/platform/repository.rs index cfe93726d..7cee81918 100644 --- a/crates/bitwarden-uniffi/src/platform/repository.rs +++ b/crates/bitwarden-uniffi/src/platform/repository.rs @@ -49,7 +49,7 @@ macro_rules! create_uniffi_repository { id: String, ) -> Result, $crate::platform::repository::RepositoryError>; async fn list(&self) - -> Result, $crate::platform::repository::RepositoryError>; + -> Result, $crate::platform::repository::RepositoryError>; async fn set( &self, id: String, diff --git a/crates/bitwarden-uuid-macro/src/lib.rs b/crates/bitwarden-uuid-macro/src/lib.rs index 529459fcd..f499a6e4a 100644 --- a/crates/bitwarden-uuid-macro/src/lib.rs +++ b/crates/bitwarden-uuid-macro/src/lib.rs @@ -3,8 +3,9 @@ use proc_macro::TokenStream; use quote::quote; use syn::{ + Ident, Visibility, parse::{Parse, ParseStream}, - parse_macro_input, Ident, Visibility, + parse_macro_input, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index 593378a63..ba8c9bb5d 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -225,8 +225,8 @@ mod tests { use bitwarden_encoding::B64; use crate::{ - cipher::cipher::{CipherRepromptType, CipherType}, AttachmentFile, AttachmentFileView, AttachmentView, Cipher, + cipher::cipher::{CipherRepromptType, CipherType}, }; #[test] diff --git a/crates/bitwarden-vault/src/cipher/card.rs b/crates/bitwarden-vault/src/cipher/card.rs index 4b622a80f..6c0507502 100644 --- a/crates/bitwarden-vault/src/cipher/card.rs +++ b/crates/bitwarden-vault/src/cipher/card.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use tsify::Tsify; use super::cipher::CipherKind; -use crate::{cipher::cipher::CopyableCipherFields, Cipher, VaultParseError}; +use crate::{Cipher, VaultParseError, cipher::cipher::CopyableCipherFields}; #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index 392eea61f..9c6b36173 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -1,8 +1,9 @@ use bitwarden_api_api::models::CipherDetailsResponseModel; use bitwarden_collections::collection::CollectionId; use bitwarden_core::{ + MissingFieldError, OrganizationId, UserId, key_management::{KeyIds, SymmetricKeyId}, - require, MissingFieldError, OrganizationId, UserId, + require, }; use bitwarden_crypto::{ CompositeEncryptable, CryptoError, Decryptable, EncString, IdentifyKey, KeyStoreContext, @@ -29,8 +30,8 @@ use super::{ secure_note, ssh_key, }; use crate::{ - password_history, EncryptError, Fido2CredentialFullView, Fido2CredentialView, FolderId, Login, - LoginView, VaultParseError, + EncryptError, Fido2CredentialFullView, Fido2CredentialView, FolderId, Login, LoginView, + VaultParseError, password_history, }; uuid_newtype!(pub CipherId); @@ -45,7 +46,9 @@ pub enum CipherError { Crypto(#[from] CryptoError), #[error(transparent)] Encrypt(#[from] EncryptError), - #[error("This cipher contains attachments without keys. Those attachments will need to be reuploaded to complete the operation")] + #[error( + "This cipher contains attachments without keys. Those attachments will need to be reuploaded to complete the operation" + )] AttachmentsWithoutKeys, } @@ -803,7 +806,7 @@ mod tests { use bitwarden_crypto::SymmetricCryptoKey; use super::*; - use crate::{login::Fido2CredentialListView, Fido2Credential}; + use crate::{Fido2Credential, login::Fido2CredentialListView}; fn generate_cipher() -> CipherView { let test_id = "fd411a1a-fec8-4070-985d-0e6560860e69".parse().unwrap(); @@ -1060,9 +1063,10 @@ mod tests { // Check that the cipher key can be unwrapped with the new key assert!(cipher.key.is_some()); - assert!(ctx - .unwrap_symmetric_key(new_key_id, new_key_id, &cipher.key.unwrap()) - .is_ok()); + assert!( + ctx.unwrap_symmetric_key(new_key_id, new_key_id, &cipher.key.unwrap()) + .is_ok() + ); } #[test] @@ -1146,9 +1150,11 @@ mod tests { cipher.attachments = Some(vec![attachment]); // Neither cipher nor attachment have keys, so the cipher can't be moved - assert!(cipher - .move_to_organization(&mut key_store.context(), org) - .is_err()); + assert!( + cipher + .move_to_organization(&mut key_store.context(), org) + .is_err() + ); } #[test] diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index edb9e53fd..060e1bcfd 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -1,4 +1,4 @@ -use bitwarden_core::{key_management::SymmetricKeyId, Client, OrganizationId}; +use bitwarden_core::{Client, OrganizationId, key_management::SymmetricKeyId}; use bitwarden_crypto::{CompositeEncryptable, IdentifyKey, SymmetricCryptoKey}; #[cfg(feature = "wasm")] use bitwarden_encoding::B64; @@ -7,8 +7,8 @@ use wasm_bindgen::prelude::*; use super::EncryptionContext; use crate::{ - cipher::cipher::DecryptCipherListResult, Cipher, CipherError, CipherListView, CipherView, - DecryptError, EncryptError, Fido2CredentialFullView, + Cipher, CipherError, CipherListView, CipherView, DecryptError, EncryptError, + Fido2CredentialFullView, cipher::cipher::DecryptCipherListResult, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-vault/src/cipher/field.rs b/crates/bitwarden-vault/src/cipher/field.rs index 9811e68b2..2434f57af 100644 --- a/crates/bitwarden-vault/src/cipher/field.rs +++ b/crates/bitwarden-vault/src/cipher/field.rs @@ -1,7 +1,8 @@ use bitwarden_api_api::models::CipherFieldModel; use bitwarden_core::{ + MissingFieldError, key_management::{KeyIds, SymmetricKeyId}, - require, MissingFieldError, + require, }; use bitwarden_crypto::{ CompositeEncryptable, CryptoError, Decryptable, EncString, KeyStoreContext, diff --git a/crates/bitwarden-vault/src/cipher/identity.rs b/crates/bitwarden-vault/src/cipher/identity.rs index 1484b3f44..801c69b18 100644 --- a/crates/bitwarden-vault/src/cipher/identity.rs +++ b/crates/bitwarden-vault/src/cipher/identity.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use tsify::Tsify; use super::cipher::CipherKind; -use crate::{cipher::cipher::CopyableCipherFields, Cipher, VaultParseError}; +use crate::{Cipher, VaultParseError, cipher::cipher::CopyableCipherFields}; #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] diff --git a/crates/bitwarden-vault/src/cipher/login.rs b/crates/bitwarden-vault/src/cipher/login.rs index 0bb0f29cf..814f68385 100644 --- a/crates/bitwarden-vault/src/cipher/login.rs +++ b/crates/bitwarden-vault/src/cipher/login.rs @@ -17,7 +17,7 @@ use tsify::Tsify; use wasm_bindgen::prelude::wasm_bindgen; use super::cipher::CipherKind; -use crate::{cipher::cipher::CopyableCipherFields, Cipher, VaultParseError}; +use crate::{Cipher, VaultParseError, cipher::cipher::CopyableCipherFields}; #[allow(missing_docs)] #[derive(Clone, Copy, Serialize_repr, Deserialize_repr, Debug, PartialEq)] @@ -592,8 +592,8 @@ impl CipherKind for Login { #[cfg(test)] mod tests { use crate::{ - cipher::cipher::{CipherKind, CopyableCipherFields}, Login, + cipher::cipher::{CipherKind, CopyableCipherFields}, }; #[test] diff --git a/crates/bitwarden-vault/src/cipher/secure_note.rs b/crates/bitwarden-vault/src/cipher/secure_note.rs index 268b71971..022fc651a 100644 --- a/crates/bitwarden-vault/src/cipher/secure_note.rs +++ b/crates/bitwarden-vault/src/cipher/secure_note.rs @@ -12,8 +12,8 @@ use tsify::Tsify; use wasm_bindgen::prelude::wasm_bindgen; use crate::{ - cipher::cipher::{CipherKind, CopyableCipherFields}, Cipher, VaultParseError, + cipher::cipher::{CipherKind, CopyableCipherFields}, }; #[allow(missing_docs)] @@ -106,9 +106,9 @@ impl CipherKind for SecureNote { #[cfg(test)] mod tests { use crate::{ + CipherRepromptType, CipherType, SecureNoteType, cipher::cipher::{Cipher, CipherKind, CopyableCipherFields}, secure_note::SecureNote, - CipherRepromptType, CipherType, SecureNoteType, }; fn create_cipher_for_note(note: SecureNote) -> Cipher { diff --git a/crates/bitwarden-vault/src/cipher/ssh_key.rs b/crates/bitwarden-vault/src/cipher/ssh_key.rs index e56da0033..c199f1fbd 100644 --- a/crates/bitwarden-vault/src/cipher/ssh_key.rs +++ b/crates/bitwarden-vault/src/cipher/ssh_key.rs @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; use tsify::Tsify; use super::cipher::CipherKind; -use crate::{cipher::cipher::CopyableCipherFields, Cipher, VaultParseError}; +use crate::{Cipher, VaultParseError, cipher::cipher::CopyableCipherFields}; #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] diff --git a/crates/bitwarden-vault/src/folder/create.rs b/crates/bitwarden-vault/src/folder/create.rs index a3e36161a..2d678525d 100644 --- a/crates/bitwarden-vault/src/folder/create.rs +++ b/crates/bitwarden-vault/src/folder/create.rs @@ -1,7 +1,8 @@ use bitwarden_api_api::models::FolderRequestModel; use bitwarden_core::{ + ApiError, MissingFieldError, key_management::{KeyIds, SymmetricKeyId}, - require, ApiError, MissingFieldError, + require, }; use bitwarden_crypto::{ CompositeEncryptable, CryptoError, IdentifyKey, KeyStore, KeyStoreContext, PrimitiveEncryptable, diff --git a/crates/bitwarden-vault/src/folder/edit.rs b/crates/bitwarden-vault/src/folder/edit.rs index da8106cca..a3b9fa8d3 100644 --- a/crates/bitwarden-vault/src/folder/edit.rs +++ b/crates/bitwarden-vault/src/folder/edit.rs @@ -1,4 +1,4 @@ -use bitwarden_core::{key_management::KeyIds, ApiError, MissingFieldError}; +use bitwarden_core::{ApiError, MissingFieldError, key_management::KeyIds}; use bitwarden_crypto::{CryptoError, KeyStore}; use bitwarden_error::bitwarden_error; use bitwarden_state::repository::{Repository, RepositoryError}; diff --git a/crates/bitwarden-vault/src/folder/folder_client.rs b/crates/bitwarden-vault/src/folder/folder_client.rs index 2275b2dac..26a202031 100644 --- a/crates/bitwarden-vault/src/folder/folder_client.rs +++ b/crates/bitwarden-vault/src/folder/folder_client.rs @@ -6,10 +6,10 @@ use bitwarden_state::repository::{Repository, RepositoryError}; use wasm_bindgen::prelude::*; use crate::{ - error::{DecryptError, EncryptError}, - folder::{create_folder, edit_folder, get_folder, list_folders}, CreateFolderError, EditFolderError, Folder, FolderAddEditRequest, FolderId, FolderView, GetFolderError, + error::{DecryptError, EncryptError}, + folder::{create_folder, edit_folder, get_folder, list_folders}, }; /// Wrapper for folder specific functionality. diff --git a/crates/bitwarden-vault/src/lib.rs b/crates/bitwarden-vault/src/lib.rs index c9a8df332..61d5b099f 100644 --- a/crates/bitwarden-vault/src/lib.rs +++ b/crates/bitwarden-vault/src/lib.rs @@ -17,7 +17,7 @@ mod domain; pub use domain::GlobalDomains; mod totp; pub use totp::{ - generate_totp, generate_totp_cipher_view, Totp, TotpAlgorithm, TotpError, TotpResponse, + Totp, TotpAlgorithm, TotpError, TotpResponse, generate_totp, generate_totp_cipher_view, }; mod error; pub use error::{DecryptError, EncryptError, VaultParseError}; diff --git a/crates/bitwarden-vault/src/sync.rs b/crates/bitwarden-vault/src/sync.rs index 57fe160ca..e0290c96a 100644 --- a/crates/bitwarden-vault/src/sync.rs +++ b/crates/bitwarden-vault/src/sync.rs @@ -3,8 +3,8 @@ use bitwarden_api_api::models::{ }; use bitwarden_collections::{collection::Collection, error::CollectionsParseError}; use bitwarden_core::{ - client::encryption_settings::EncryptionSettingsError, require, Client, MissingFieldError, - OrganizationId, UserId, + Client, MissingFieldError, OrganizationId, UserId, + client::encryption_settings::EncryptionSettingsError, require, }; use serde::{Deserialize, Serialize}; use thiserror::Error; diff --git a/crates/bitwarden-vault/src/totp.rs b/crates/bitwarden-vault/src/totp.rs index c9e29d4ae..10723ee9d 100644 --- a/crates/bitwarden-vault/src/totp.rs +++ b/crates/bitwarden-vault/src/totp.rs @@ -10,7 +10,7 @@ use bitwarden_error::bitwarden_error; use chrono::{DateTime, Utc}; use data_encoding::BASE32_NOPAD; use hmac::{Hmac, Mac}; -use percent_encoding::{percent_decode_str, percent_encode, NON_ALPHANUMERIC}; +use percent_encoding::{NON_ALPHANUMERIC, percent_decode_str, percent_encode}; use reqwest::Url; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -376,9 +376,9 @@ mod tests { use super::*; use crate::{ + CipherRepromptType, cipher::cipher::{CipherListViewType, CopyableCipherFields}, login::LoginListView, - CipherRepromptType, }; #[test] @@ -693,14 +693,18 @@ mod tests { let uri = original.to_string(); let parsed = Totp::from_str(&uri).unwrap(); - assert!(parsed - .account - .unwrap() - .eq_ignore_ascii_case(&original.account.unwrap())); - assert!(parsed - .issuer - .unwrap() - .eq_ignore_ascii_case(&original.issuer.unwrap())); + assert!( + parsed + .account + .unwrap() + .eq_ignore_ascii_case(&original.account.unwrap()) + ); + assert!( + parsed + .issuer + .unwrap() + .eq_ignore_ascii_case(&original.issuer.unwrap()) + ); assert_eq!(parsed.algorithm, original.algorithm); assert_eq!(parsed.digits, original.digits); assert_eq!(parsed.period, original.period); diff --git a/crates/bitwarden-vault/src/totp_client.rs b/crates/bitwarden-vault/src/totp_client.rs index 2498aea37..23510fb7c 100644 --- a/crates/bitwarden-vault/src/totp_client.rs +++ b/crates/bitwarden-vault/src/totp_client.rs @@ -3,7 +3,7 @@ use chrono::{DateTime, Utc}; #[cfg(feature = "wasm")] use wasm_bindgen::prelude::*; -use crate::{generate_totp, generate_totp_cipher_view, CipherListView, TotpError, TotpResponse}; +use crate::{CipherListView, TotpError, TotpResponse, generate_totp, generate_totp_cipher_view}; #[allow(missing_docs)] #[cfg_attr(feature = "wasm", wasm_bindgen)] diff --git a/crates/bitwarden-vault/src/vault_client.rs b/crates/bitwarden-vault/src/vault_client.rs index 55ee82a3b..2fd6a513e 100644 --- a/crates/bitwarden-vault/src/vault_client.rs +++ b/crates/bitwarden-vault/src/vault_client.rs @@ -3,10 +3,10 @@ use bitwarden_core::Client; use wasm_bindgen::prelude::*; use crate::{ - collection_client::CollectionsClient, - sync::{sync, SyncError}, AttachmentsClient, CiphersClient, FoldersClient, PasswordHistoryClient, SyncRequest, SyncResponse, TotpClient, + collection_client::CollectionsClient, + sync::{SyncError, sync}, }; #[allow(missing_docs)] diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 54c5efa3a..e7f3299a2 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -3,12 +3,12 @@ use std::{fmt::Display, sync::Arc}; use bitwarden_core::ClientSettings; use bitwarden_error::bitwarden_error; -use bitwarden_pm::{clients::*, PasswordManagerClient}; +use bitwarden_pm::{PasswordManagerClient, clients::*}; use wasm_bindgen::prelude::*; use crate::platform::{ - token_provider::{JsTokenProvider, WasmClientManagedTokens}, PlatformClient, + token_provider::{JsTokenProvider, WasmClientManagedTokens}, }; /// The main entry point for the Bitwarden SDK in WebAssembly environments @@ -43,7 +43,7 @@ impl BitwardenClient { /// Test method, calls http endpoint pub async fn http_get(&self, url: String) -> Result { - let client = self.0 .0.internal.get_http_client(); + let client = self.0.0.internal.get_http_client(); let res = client.get(&url).send().await.map_err(|e| e.to_string())?; res.text().await.map_err(|e| e.to_string()) @@ -56,7 +56,7 @@ impl BitwardenClient { /// Crypto related operations. pub fn crypto(&self) -> CryptoClient { - self.0 .0.crypto() + self.0.0.crypto() } /// Vault item related operations. @@ -66,7 +66,7 @@ impl BitwardenClient { /// Constructs a specific client for platform-specific functionality pub fn platform(&self) -> PlatformClient { - PlatformClient::new(self.0 .0.clone()) + PlatformClient::new(self.0.0.clone()) } /// Constructs a specific client for generating passwords and passphrases diff --git a/crates/bitwarden-wasm-internal/src/init.rs b/crates/bitwarden-wasm-internal/src/init.rs index b4cf0e17b..0fd20f069 100644 --- a/crates/bitwarden-wasm-internal/src/init.rs +++ b/crates/bitwarden-wasm-internal/src/init.rs @@ -1,4 +1,4 @@ -use log::{set_max_level, Level}; +use log::{Level, set_max_level}; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/bitwarden-wasm-internal/src/platform/mod.rs b/crates/bitwarden-wasm-internal/src/platform/mod.rs index 8f49d2ac6..daf85ac65 100644 --- a/crates/bitwarden-wasm-internal/src/platform/mod.rs +++ b/crates/bitwarden-wasm-internal/src/platform/mod.rs @@ -3,7 +3,7 @@ use bitwarden_state::DatabaseConfiguration; use bitwarden_vault::{Cipher, Folder}; use serde::{Deserialize, Serialize}; use tsify::Tsify; -use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; +use wasm_bindgen::{JsValue, prelude::wasm_bindgen}; mod repository; pub mod token_provider; diff --git a/crates/bitwarden-wasm-internal/src/platform/repository.rs b/crates/bitwarden-wasm-internal/src/platform/repository.rs index ecae315ca..3ec4033f5 100644 --- a/crates/bitwarden-wasm-internal/src/platform/repository.rs +++ b/crates/bitwarden-wasm-internal/src/platform/repository.rs @@ -37,8 +37,8 @@ use std::{future::Future, marker::PhantomData, rc::Rc}; use bitwarden_state::repository::{Repository, RepositoryError, RepositoryItem}; use bitwarden_threading::ThreadBoundRunner; -use serde::{de::DeserializeOwned, Serialize}; -use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; +use serde::{Serialize, de::DeserializeOwned}; +use wasm_bindgen::{JsValue, prelude::wasm_bindgen}; /// This trait defines the methods that a [::wasm_bindgen] repository must implement. /// The trait itself exists to provide a generic way of handling the [::wasm_bindgen] interface, @@ -109,7 +109,7 @@ macro_rules! create_wasm_repository { ) -> Result<::wasm_bindgen::JsValue, ::wasm_bindgen::JsValue>; #[wasm_bindgen(method, catch)] async fn list(this: &$name) - -> Result<::wasm_bindgen::JsValue, ::wasm_bindgen::JsValue>; + -> Result<::wasm_bindgen::JsValue, ::wasm_bindgen::JsValue>; #[wasm_bindgen(method, catch)] async fn set( this: &$name, diff --git a/crates/bitwarden-wasm-internal/src/platform/token_provider.rs b/crates/bitwarden-wasm-internal/src/platform/token_provider.rs index 814af0f5b..c7450c8d7 100644 --- a/crates/bitwarden-wasm-internal/src/platform/token_provider.rs +++ b/crates/bitwarden-wasm-internal/src/platform/token_provider.rs @@ -1,6 +1,6 @@ use bitwarden_core::client::internal::ClientManagedTokens; use bitwarden_threading::ThreadBoundRunner; -use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; +use wasm_bindgen::{JsValue, prelude::wasm_bindgen}; #[wasm_bindgen(typescript_custom_section)] const TOKEN_CUSTOM_TS_TYPE: &'static str = r#" diff --git a/crates/bw/src/auth/login.rs b/crates/bw/src/auth/login.rs index 38e685fff..c5d50af38 100644 --- a/crates/bw/src/auth/login.rs +++ b/crates/bw/src/auth/login.rs @@ -1,13 +1,13 @@ use bitwarden_cli::text_prompt_when_none; use bitwarden_core::{ + Client, auth::login::{ ApiKeyLoginRequest, PasswordLoginRequest, TwoFactorEmailRequest, TwoFactorProvider, TwoFactorRequest, }, - Client, }; use bitwarden_vault::{SyncRequest, VaultClientExt}; -use color_eyre::eyre::{bail, Result}; +use color_eyre::eyre::{Result, bail}; use inquire::{Password, Text}; use log::{debug, error, info}; diff --git a/crates/bw/src/main.rs b/crates/bw/src/main.rs index 4f3ff8b41..b65304726 100644 --- a/crates/bw/src/main.rs +++ b/crates/bw/src/main.rs @@ -1,11 +1,11 @@ #![doc = include_str!("../README.md")] -use bitwarden_cli::{install_color_eyre, Color}; +use bitwarden_cli::{Color, install_color_eyre}; use bitwarden_core::ClientSettings; use bitwarden_generators::{ GeneratorClientsExt, PassphraseGeneratorRequest, PasswordGeneratorRequest, }; -use clap::{command, Args, CommandFactory, Parser, Subcommand}; +use clap::{Args, CommandFactory, Parser, Subcommand, command}; use color_eyre::eyre::Result; use render::Output;