diff --git a/crates/bitwarden-api-api/.openapi-generator/FILES b/crates/bitwarden-api-api/.openapi-generator/FILES index d477e416e..b01ce9d70 100644 --- a/crates/bitwarden-api-api/.openapi-generator/FILES +++ b/crates/bitwarden-api-api/.openapi-generator/FILES @@ -120,10 +120,12 @@ src/models/bulk_deny_admin_auth_request_request_model.rs src/models/change_plan_frequency_request.rs src/models/cipher.rs src/models/cipher_attachment_model.rs +src/models/cipher_bulk_archive_request_model.rs src/models/cipher_bulk_delete_request_model.rs src/models/cipher_bulk_move_request_model.rs src/models/cipher_bulk_restore_request_model.rs src/models/cipher_bulk_share_request_model.rs +src/models/cipher_bulk_unarchive_request_model.rs src/models/cipher_bulk_update_collections_request_model.rs src/models/cipher_card_model.rs src/models/cipher_collections_request_model.rs diff --git a/crates/bitwarden-api-api/README.md b/crates/bitwarden-api-api/README.md index f79a76f09..f08240b7a 100644 --- a/crates/bitwarden-api-api/README.md +++ b/crates/bitwarden-api-api/README.md @@ -106,6 +106,7 @@ All URIs are relative to _http://localhost_ | _AuthRequestsApi_ | [**auth_requests_post**](docs/AuthRequestsApi.md#auth_requests_post) | **POST** /auth-requests | | _CiphersApi_ | [**ciphers_admin_delete**](docs/CiphersApi.md#ciphers_admin_delete) | **DELETE** /ciphers/admin | | _CiphersApi_ | [**ciphers_admin_post**](docs/CiphersApi.md#ciphers_admin_post) | **POST** /ciphers/admin | +| _CiphersApi_ | [**ciphers_archive_put**](docs/CiphersApi.md#ciphers_archive_put) | **PUT** /ciphers/archive | | _CiphersApi_ | [**ciphers_attachment_validate_azure_post**](docs/CiphersApi.md#ciphers_attachment_validate_azure_post) | **POST** /ciphers/attachment/validate/azure | | _CiphersApi_ | [**ciphers_bulk_collections_post**](docs/CiphersApi.md#ciphers_bulk_collections_post) | **POST** /ciphers/bulk-collections | | _CiphersApi_ | [**ciphers_create_post**](docs/CiphersApi.md#ciphers_create_post) | **POST** /ciphers/create | @@ -119,6 +120,7 @@ All URIs are relative to _http://localhost_ | _CiphersApi_ | [**ciphers_id_admin_get**](docs/CiphersApi.md#ciphers_id_admin_get) | **GET** /ciphers/{id}/admin | | _CiphersApi_ | [**ciphers_id_admin_post**](docs/CiphersApi.md#ciphers_id_admin_post) | **POST** /ciphers/{id}/admin | | _CiphersApi_ | [**ciphers_id_admin_put**](docs/CiphersApi.md#ciphers_id_admin_put) | **PUT** /ciphers/{id}/admin | +| _CiphersApi_ | [**ciphers_id_archive_put**](docs/CiphersApi.md#ciphers_id_archive_put) | **PUT** /ciphers/{id}/archive | | _CiphersApi_ | [**ciphers_id_attachment_admin_post**](docs/CiphersApi.md#ciphers_id_attachment_admin_post) | **POST** /ciphers/{id}/attachment-admin | | _CiphersApi_ | [**ciphers_id_attachment_attachment_id_admin_delete**](docs/CiphersApi.md#ciphers_id_attachment_attachment_id_admin_delete) | **DELETE** /ciphers/{id}/attachment/{attachmentId}/admin | | _CiphersApi_ | [**ciphers_id_attachment_attachment_id_admin_get**](docs/CiphersApi.md#ciphers_id_attachment_attachment_id_admin_get) | **GET** /ciphers/{id}/attachment/{attachmentId}/admin | @@ -153,6 +155,7 @@ All URIs are relative to _http://localhost_ | _CiphersApi_ | [**ciphers_id_restore_put**](docs/CiphersApi.md#ciphers_id_restore_put) | **PUT** /ciphers/{id}/restore | | _CiphersApi_ | [**ciphers_id_share_post**](docs/CiphersApi.md#ciphers_id_share_post) | **POST** /ciphers/{id}/share | | _CiphersApi_ | [**ciphers_id_share_put**](docs/CiphersApi.md#ciphers_id_share_put) | **PUT** /ciphers/{id}/share | +| _CiphersApi_ | [**ciphers_id_unarchive_put**](docs/CiphersApi.md#ciphers_id_unarchive_put) | **PUT** /ciphers/{id}/unarchive | | _CiphersApi_ | [**ciphers_move_post**](docs/CiphersApi.md#ciphers_move_post) | **POST** /ciphers/move | | _CiphersApi_ | [**ciphers_move_put**](docs/CiphersApi.md#ciphers_move_put) | **PUT** /ciphers/move | | _CiphersApi_ | [**ciphers_organization_details_assigned_get**](docs/CiphersApi.md#ciphers_organization_details_assigned_get) | **GET** /ciphers/organization-details/assigned | @@ -163,6 +166,7 @@ All URIs are relative to _http://localhost_ | _CiphersApi_ | [**ciphers_restore_put**](docs/CiphersApi.md#ciphers_restore_put) | **PUT** /ciphers/restore | | _CiphersApi_ | [**ciphers_share_post**](docs/CiphersApi.md#ciphers_share_post) | **POST** /ciphers/share | | _CiphersApi_ | [**ciphers_share_put**](docs/CiphersApi.md#ciphers_share_put) | **PUT** /ciphers/share | +| _CiphersApi_ | [**ciphers_unarchive_put**](docs/CiphersApi.md#ciphers_unarchive_put) | **PUT** /ciphers/unarchive | | _CollectionsApi_ | [**collections_get**](docs/CollectionsApi.md#collections_get) | **GET** /collections | | _CollectionsApi_ | [**organizations_org_id_collections_bulk_access_post**](docs/CollectionsApi.md#organizations_org_id_collections_bulk_access_post) | **POST** /organizations/{orgId}/collections/bulk-access | | _CollectionsApi_ | [**organizations_org_id_collections_delete**](docs/CollectionsApi.md#organizations_org_id_collections_delete) | **DELETE** /organizations/{orgId}/collections | @@ -625,10 +629,12 @@ All URIs are relative to _http://localhost_ - [ChangePlanFrequencyRequest](docs/ChangePlanFrequencyRequest.md) - [Cipher](docs/Cipher.md) - [CipherAttachmentModel](docs/CipherAttachmentModel.md) +- [CipherBulkArchiveRequestModel](docs/CipherBulkArchiveRequestModel.md) - [CipherBulkDeleteRequestModel](docs/CipherBulkDeleteRequestModel.md) - [CipherBulkMoveRequestModel](docs/CipherBulkMoveRequestModel.md) - [CipherBulkRestoreRequestModel](docs/CipherBulkRestoreRequestModel.md) - [CipherBulkShareRequestModel](docs/CipherBulkShareRequestModel.md) +- [CipherBulkUnarchiveRequestModel](docs/CipherBulkUnarchiveRequestModel.md) - [CipherBulkUpdateCollectionsRequestModel](docs/CipherBulkUpdateCollectionsRequestModel.md) - [CipherCardModel](docs/CipherCardModel.md) - [CipherCollectionsRequestModel](docs/CipherCollectionsRequestModel.md) diff --git a/crates/bitwarden-api-api/src/apis/ciphers_api.rs b/crates/bitwarden-api-api/src/apis/ciphers_api.rs index c5f0c2ce2..e1adfeea9 100644 --- a/crates/bitwarden-api-api/src/apis/ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/ciphers_api.rs @@ -28,6 +28,13 @@ pub enum CiphersAdminPostError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_archive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersArchivePutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`ciphers_attachment_validate_azure_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -119,6 +126,13 @@ pub enum CiphersIdAdminPutError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_id_archive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersIdArchivePutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`ciphers_id_attachment_admin_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -357,6 +371,13 @@ pub enum CiphersIdSharePutError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_id_unarchive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersIdUnarchivePutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`ciphers_move_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -427,6 +448,13 @@ pub enum CiphersSharePutError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_unarchive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersUnarchivePutError { + UnknownValue(serde_json::Value), +} + pub async fn ciphers_admin_delete( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -514,6 +542,53 @@ pub async fn ciphers_admin_post( } } +pub async fn ciphers_archive_put( + configuration: &configuration::Configuration, + cipher_bulk_archive_request_model: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_cipher_bulk_archive_request_model = cipher_bulk_archive_request_model; + + let uri_str = format!("{}/ciphers/archive", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_cipher_bulk_archive_request_model); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(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(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + pub async fn ciphers_attachment_validate_azure_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -1068,6 +1143,56 @@ pub async fn ciphers_id_admin_put( } } +pub async fn ciphers_id_archive_put( + configuration: &configuration::Configuration, + id: uuid::Uuid, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_id = id; + + let uri_str = format!( + "{}/ciphers/{id}/archive", + configuration.base_path, + id = crate::apis::urlencode(p_id.to_string()) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + pub async fn ciphers_id_attachment_admin_post( configuration: &configuration::Configuration, id: &str, @@ -2821,6 +2946,56 @@ pub async fn ciphers_id_share_put( } } +pub async fn ciphers_id_unarchive_put( + configuration: &configuration::Configuration, + id: uuid::Uuid, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_id = id; + + let uri_str = format!( + "{}/ciphers/{id}/unarchive", + configuration.base_path, + id = crate::apis::urlencode(p_id.to_string()) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + pub async fn ciphers_move_post( configuration: &configuration::Configuration, cipher_bulk_move_request_model: Option, @@ -3055,7 +3230,7 @@ pub async fn ciphers_post( pub async fn ciphers_purge_post( configuration: &configuration::Configuration, - organization_id: Option<&str>, + organization_id: Option, secret_verification_request_model: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -3285,3 +3460,50 @@ pub async fn ciphers_share_put( })) } } + +pub async fn ciphers_unarchive_put( + configuration: &configuration::Configuration, + cipher_bulk_unarchive_request_model: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_cipher_bulk_unarchive_request_model = cipher_bulk_unarchive_request_model; + + let uri_str = format!("{}/ciphers/unarchive", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_cipher_bulk_unarchive_request_model); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(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(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs b/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs index 4d8bc6dcf..99573dcba 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 @@ -128,6 +128,7 @@ pub async fn organizations_organization_id_billing_vnext_address_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -189,6 +190,7 @@ pub async fn organizations_organization_id_billing_vnext_address_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/address", @@ -376,6 +378,9 @@ pub async fn organizations_organization_id_billing_vnext_address_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -463,6 +468,7 @@ pub async fn organizations_organization_id_billing_vnext_address_put( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, billing_address_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -525,6 +531,7 @@ pub async fn organizations_organization_id_billing_vnext_address_put( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_billing_address_request = billing_address_request; let uri_str = format!( @@ -713,6 +720,9 @@ pub async fn organizations_organization_id_billing_vnext_address_put( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -801,6 +811,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, bit_pay_credit_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -863,6 +874,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_bit_pay_credit_request = bit_pay_credit_request; let uri_str = format!( @@ -1053,6 +1065,9 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1141,6 +1156,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -1202,6 +1218,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/credit", @@ -1389,6 +1406,9 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1476,6 +1496,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -1537,6 +1558,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/payment-method", @@ -1724,6 +1746,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1811,6 +1836,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, tokenized_payment_method_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -1873,6 +1899,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_tokenized_payment_method_request = tokenized_payment_method_request; let uri_str = format!( @@ -2061,6 +2088,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -2149,6 +2179,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, verify_bank_account_request: Option, ) -> Result<(), Error> { @@ -2212,6 +2243,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_verify_bank_account_request = verify_bank_account_request; let uri_str = format!( @@ -2402,6 +2434,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/crates/bitwarden-api-api/src/models/cipher.rs b/crates/bitwarden-api-api/src/models/cipher.rs index 8bdcdb0bd..cea411cae 100644 --- a/crates/bitwarden-api-api/src/models/cipher.rs +++ b/crates/bitwarden-api-api/src/models/cipher.rs @@ -40,6 +40,8 @@ pub struct Cipher { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, } impl Cipher { @@ -58,6 +60,7 @@ impl Cipher { deleted_date: None, reprompt: None, key: None, + archived_date: None, } } } diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_archive_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_archive_request_model.rs new file mode 100644 index 000000000..b32db1950 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_archive_request_model.rs @@ -0,0 +1,25 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CipherBulkArchiveRequestModel { + #[serde(rename = "ids")] + pub ids: Vec, +} + +impl CipherBulkArchiveRequestModel { + pub fn new(ids: Vec) -> CipherBulkArchiveRequestModel { + CipherBulkArchiveRequestModel { ids } + } +} diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_unarchive_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_unarchive_request_model.rs new file mode 100644 index 000000000..0bf375689 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_unarchive_request_model.rs @@ -0,0 +1,25 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CipherBulkUnarchiveRequestModel { + #[serde(rename = "ids")] + pub ids: Vec, +} + +impl CipherBulkUnarchiveRequestModel { + pub fn new(ids: Vec) -> CipherBulkUnarchiveRequestModel { + CipherBulkUnarchiveRequestModel { ids } + } +} diff --git a/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs index e0b1958d9..e71a0529d 100644 --- a/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -97,6 +99,7 @@ impl CipherDetailsResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, folder_id: None, favorite: None, edit: None, diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs index 37d33da67..86a1d62d9 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherMiniDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "collectionIds", skip_serializing_if = "Option::is_none")] pub collection_ids: Option>, } @@ -87,6 +89,7 @@ impl CipherMiniDetailsResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, collection_ids: None, } } diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs index f4596cf22..9e660a791 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherMiniResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, } impl CipherMiniResponseModel { @@ -85,6 +87,7 @@ impl CipherMiniResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, } } } diff --git a/crates/bitwarden-api-api/src/models/cipher_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_request_model.rs index 0da128035..d639a320b 100644 --- a/crates/bitwarden-api-api/src/models/cipher_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_request_model.rs @@ -56,6 +56,8 @@ pub struct CipherRequestModel { skip_serializing_if = "Option::is_none" )] pub last_known_revision_date: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, } impl CipherRequestModel { @@ -80,6 +82,7 @@ impl CipherRequestModel { secure_note: None, ssh_key: None, last_known_revision_date: None, + archived_date: None, } } } diff --git a/crates/bitwarden-api-api/src/models/cipher_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_response_model.rs index 4470969c8..8a529831b 100644 --- a/crates/bitwarden-api-api/src/models/cipher_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -95,6 +97,7 @@ impl CipherResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, folder_id: None, favorite: None, edit: None, diff --git a/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs index a7f207c55..86f19c6a0 100644 --- a/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs @@ -56,6 +56,8 @@ pub struct CipherWithIdRequestModel { skip_serializing_if = "Option::is_none" )] pub last_known_revision_date: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "id")] pub id: uuid::Uuid, } @@ -82,6 +84,7 @@ impl CipherWithIdRequestModel { secure_note: None, ssh_key: None, last_known_revision_date: None, + archived_date: None, id, } } diff --git a/crates/bitwarden-api-api/src/models/event_type.rs b/crates/bitwarden-api-api/src/models/event_type.rs index 29cce16a4..40cb4efc4 100644 --- a/crates/bitwarden-api-api/src/models/event_type.rs +++ b/crates/bitwarden-api-api/src/models/event_type.rs @@ -48,6 +48,8 @@ pub enum EventType { Cipher_SoftDeleted = 1115, Cipher_Restored = 1116, Cipher_ClientToggledCardNumberVisible = 1117, + Cipher_Archived = 1118, + Cipher_Unarchived = 1119, Collection_Created = 1300, Collection_Updated = 1301, Collection_Deleted = 1302, @@ -136,6 +138,8 @@ impl std::fmt::Display for EventType { Self::Cipher_SoftDeleted => "1115", Self::Cipher_Restored => "1116", Self::Cipher_ClientToggledCardNumberVisible => "1117", + Self::Cipher_Archived => "1118", + Self::Cipher_Unarchived => "1119", Self::Collection_Created => "1300", Self::Collection_Updated => "1301", Self::Collection_Deleted => "1302", diff --git a/crates/bitwarden-api-api/src/models/mod.rs b/crates/bitwarden-api-api/src/models/mod.rs index 0529112f4..78a50cff6 100644 --- a/crates/bitwarden-api-api/src/models/mod.rs +++ b/crates/bitwarden-api-api/src/models/mod.rs @@ -102,6 +102,8 @@ pub mod cipher; pub use self::cipher::Cipher; pub mod cipher_attachment_model; pub use self::cipher_attachment_model::CipherAttachmentModel; +pub mod cipher_bulk_archive_request_model; +pub use self::cipher_bulk_archive_request_model::CipherBulkArchiveRequestModel; pub mod cipher_bulk_delete_request_model; pub use self::cipher_bulk_delete_request_model::CipherBulkDeleteRequestModel; pub mod cipher_bulk_move_request_model; @@ -110,6 +112,8 @@ pub mod cipher_bulk_restore_request_model; pub use self::cipher_bulk_restore_request_model::CipherBulkRestoreRequestModel; pub mod cipher_bulk_share_request_model; pub use self::cipher_bulk_share_request_model::CipherBulkShareRequestModel; +pub mod cipher_bulk_unarchive_request_model; +pub use self::cipher_bulk_unarchive_request_model::CipherBulkUnarchiveRequestModel; pub mod cipher_bulk_update_collections_request_model; pub use self::cipher_bulk_update_collections_request_model::CipherBulkUpdateCollectionsRequestModel; pub mod cipher_card_model; diff --git a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs index 7b0383cb8..c39a877f7 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs @@ -16,12 +16,20 @@ use crate::models; pub struct OrganizationUserBulkConfirmRequestModel { #[serde(rename = "keys")] pub keys: Vec, + #[serde( + rename = "defaultUserCollectionName", + skip_serializing_if = "Option::is_none" + )] + pub default_user_collection_name: Option, } impl OrganizationUserBulkConfirmRequestModel { pub fn new( keys: Vec, ) -> OrganizationUserBulkConfirmRequestModel { - OrganizationUserBulkConfirmRequestModel { keys } + OrganizationUserBulkConfirmRequestModel { + keys, + default_user_collection_name: None, + } } } diff --git a/crates/bitwarden-exporters/src/lib.rs b/crates/bitwarden-exporters/src/lib.rs index 9cf2ccf40..f9b08bd0b 100644 --- a/crates/bitwarden-exporters/src/lib.rs +++ b/crates/bitwarden-exporters/src/lib.rs @@ -148,6 +148,7 @@ impl From for CipherView { creation_date: value.creation_date, deleted_date: None, revision_date: value.revision_date, + archived_date: None, } } } diff --git a/crates/bitwarden-exporters/src/models.rs b/crates/bitwarden-exporters/src/models.rs index 3bc3a85c4..bf8cbd7ac 100644 --- a/crates/bitwarden-exporters/src/models.rs +++ b/crates/bitwarden-exporters/src/models.rs @@ -261,6 +261,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, }; let login = from_login(&view, &key_store).unwrap(); @@ -312,6 +313,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, }; let encrypted = key_store.encrypt(cipher_view).unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index af63efc5e..1536dc7d1 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -286,6 +286,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + archived_date: None, }, attachment, contents: contents.as_slice(), @@ -340,6 +341,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + archived_date: None, }; let enc_file = STANDARD.decode(b"Ao00qr1xLsV+ZNQpYZ/UwEwOWo3hheKwCYcOGIbsorZ6JIG2vLWfWEXCVqP0hDuzRvmx8otApNZr8pJYLNwCe1aQ+ySHQYGkdubFjoMojulMbQ959Y4SJ6Its/EnVvpbDnxpXTDpbutDxyhxfq1P3lstL2G9rObJRrxiwdGlRGu1h94UA1fCCkIUQux5LcqUee6W4MyQmRnsUziH8gGzmtI=").unwrap(); @@ -398,6 +400,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + archived_date: None, }; let enc_file = STANDARD.decode(b"AsQLXOBHrJ8porroTUlPxeJOm9XID7LL9D2+KwYATXEpR1EFjLBpcCvMmnqcnYLXIEefe9TCeY4Us50ux43kRSpvdB7YkjxDKV0O1/y6tB7qC4vvv9J9+O/uDEnMx/9yXuEhAW/LA/TsU/WAgxkOM0uTvm8JdD9LUR1z9Ql7zOWycMVzkvGsk2KBNcqAdrotS5FlDftZOXyU8pWecNeyA/w=").unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index cc96a028e..b45a1c7b7 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -139,6 +139,7 @@ pub struct Cipher { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + pub archived_date: Option>, } bitwarden_state::register_repository_item!(Cipher, "Cipher"); @@ -182,6 +183,7 @@ pub struct CipherView { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + pub archived_date: Option>, } #[allow(missing_docs)] @@ -250,6 +252,7 @@ pub struct CipherListView { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + pub archived_date: Option>, /// Hints for the presentation layer for which fields can be copied. pub copyable_fields: Vec, @@ -336,6 +339,7 @@ impl CompositeEncryptable for CipherView { deleted_date: cipher_view.deleted_date, revision_date: cipher_view.revision_date, permissions: cipher_view.permissions, + archived_date: cipher_view.archived_date, }) } } @@ -379,6 +383,7 @@ impl Decryptable for Cipher { creation_date: self.creation_date, deleted_date: self.deleted_date, revision_date: self.revision_date, + archived_date: self.archived_date, }; // For compatibility we only remove URLs with invalid checksums if the cipher has a key @@ -684,6 +689,7 @@ impl Decryptable for Cipher { revision_date: self.revision_date, copyable_fields: self.get_copyable_fields(), local_data: self.local_data.decrypt(ctx, ciphers_key)?, + archived_date: self.archived_date, }) } } @@ -765,6 +771,7 @@ impl TryFrom for Cipher { deleted_date: cipher.deleted_date.map(|d| d.parse()).transpose()?, revision_date: require!(cipher.revision_date).parse()?, key: EncString::try_from_optional(cipher.key)?, + archived_date: cipher.archived_date.map(|d| d.parse()).transpose()?, }) } } @@ -839,6 +846,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, } } @@ -903,6 +911,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, }; let view: CipherListView = key_store.decrypt(&cipher).unwrap(); @@ -947,6 +956,7 @@ mod tests { CopyableCipherFields::LoginTotp ], local_data: None, + archived_date: cipher.archived_date, } ) } diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 335787e9a..edb9e53fd 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -221,6 +221,7 @@ mod tests { creation_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), + archived_date: None, } } @@ -261,6 +262,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, } } @@ -323,6 +325,7 @@ mod tests { creation_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), + archived_date: None, }]) .unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/secure_note.rs b/crates/bitwarden-vault/src/cipher/secure_note.rs index 821bded5c..268b71971 100644 --- a/crates/bitwarden-vault/src/cipher/secure_note.rs +++ b/crates/bitwarden-vault/src/cipher/secure_note.rs @@ -139,6 +139,7 @@ mod tests { creation_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), + archived_date: None, } } diff --git a/crates/bitwarden-vault/src/totp.rs b/crates/bitwarden-vault/src/totp.rs index 196182102..446379631 100644 --- a/crates/bitwarden-vault/src/totp.rs +++ b/crates/bitwarden-vault/src/totp.rs @@ -753,6 +753,7 @@ mod tests { revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), copyable_fields: vec![CopyableCipherFields::LoginTotp], local_data: None, + archived_date: None, }; let key = SymmetricCryptoKey::try_from("w2LO+nwV4oxwswVYCxlOfRUseXfvU03VzvKQHrqeklPgiMZrspUe6sOBToCnDn9Ay0tuCBn8ykVVRb7PWhub2Q==".to_string()).unwrap();