diff --git a/README.md b/README.md index dbf4e4f2c..9e3aa325f 100644 --- a/README.md +++ b/README.md @@ -68,21 +68,7 @@ ASPNETCORE_ENVIRONMENT=development dotnet swagger tofile --output ../../identity Runs from the root of the SDK project. ```bash -npx openapi-generator-cli generate \ - -i ../server/api.json \ - -g rust \ - -o crates/bitwarden-api-api \ - --package-name bitwarden-api-api \ - -t ./support/openapi-template \ - --additional-properties=packageVersion=1.0.0 - -npx openapi-generator-cli generate \ - -i ../server/identity.json \ - -g rust \ - -o crates/bitwarden-api-identity \ - --package-name bitwarden-api-identity \ - -t ./support/openapi-template \ - --additional-properties=packageVersion=1.0.0 +./support/build-api.sh ``` OpenApi Generator works using templates, we have customized our templates to work better with our diff --git a/crates/bitwarden-api-api/.openapi-generator-ignore b/crates/bitwarden-api-api/.openapi-generator-ignore index b72fc90d8..0a3fec13f 100644 --- a/crates/bitwarden-api-api/.openapi-generator-ignore +++ b/crates/bitwarden-api-api/.openapi-generator-ignore @@ -25,5 +25,3 @@ docs/*.md .travis.yml git_push.sh - -src/models/organization_user_status_type.rs diff --git a/crates/bitwarden-api-api/.openapi-generator/FILES b/crates/bitwarden-api-api/.openapi-generator/FILES index 4566fa01c..206ad61b2 100644 --- a/crates/bitwarden-api-api/.openapi-generator/FILES +++ b/crates/bitwarden-api-api/.openapi-generator/FILES @@ -253,6 +253,7 @@ src/models/organization_user_public_key_response_model_list_response_model.rs src/models/organization_user_reset_password_details_response_model.rs src/models/organization_user_reset_password_enrollment_request_model.rs src/models/organization_user_reset_password_request_model.rs +src/models/organization_user_status_type.rs src/models/organization_user_type.rs src/models/organization_user_update_groups_request_model.rs src/models/organization_user_update_request_model.rs diff --git a/crates/bitwarden-api-api/src/models/algorithm.rs b/crates/bitwarden-api-api/src/models/algorithm.rs index 315879d54..2c302de0a 100644 --- a/crates/bitwarden-api-api/src/models/algorithm.rs +++ b/crates/bitwarden-api-api/src/models/algorithm.rs @@ -14,41 +14,41 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum Algorithm { - Variant65535 = -65535, - Variant259 = -259, - Variant258 = -258, - Variant257 = -257, - Variant47 = -47, - Variant39 = -39, - Variant38 = -38, - Variant37 = -37, - Variant36 = -36, - Variant35 = -35, - Variant8 = -8, - Variant7 = -7, + RS1 = -65535, + RS512 = -259, + RS384 = -258, + RS256 = -257, + ES256K = -47, + PS512 = -39, + PS384 = -38, + PS256 = -37, + ES512 = -36, + ES384 = -35, + EdDSA = -8, + ES256 = -7, } impl ToString for Algorithm { fn to_string(&self) -> String { match self { - Self::Variant65535 => String::from("-65535"), - Self::Variant259 => String::from("-259"), - Self::Variant258 => String::from("-258"), - Self::Variant257 => String::from("-257"), - Self::Variant47 => String::from("-47"), - Self::Variant39 => String::from("-39"), - Self::Variant38 => String::from("-38"), - Self::Variant37 => String::from("-37"), - Self::Variant36 => String::from("-36"), - Self::Variant35 => String::from("-35"), - Self::Variant8 => String::from("-8"), - Self::Variant7 => String::from("-7"), + Self::RS1 => String::from("-65535"), + Self::RS512 => String::from("-259"), + Self::RS384 => String::from("-258"), + Self::RS256 => String::from("-257"), + Self::ES256K => String::from("-47"), + Self::PS512 => String::from("-39"), + Self::PS384 => String::from("-38"), + Self::PS256 => String::from("-37"), + Self::ES512 => String::from("-36"), + Self::ES384 => String::from("-35"), + Self::EdDSA => String::from("-8"), + Self::ES256 => String::from("-7"), } } } impl Default for Algorithm { fn default() -> Algorithm { - Self::Variant65535 + Self::RS1 } } diff --git a/crates/bitwarden-api-api/src/models/auth_request_type.rs b/crates/bitwarden-api-api/src/models/auth_request_type.rs index fbcfb8e9f..1ca3f7790 100644 --- a/crates/bitwarden-api-api/src/models/auth_request_type.rs +++ b/crates/bitwarden-api-api/src/models/auth_request_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum AuthRequestType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + AuthenticateAndUnlock = 0, + Unlock = 1, + AdminApproval = 2, } impl ToString for AuthRequestType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::AuthenticateAndUnlock => String::from("0"), + Self::Unlock => String::from("1"), + Self::AdminApproval => String::from("2"), } } } impl Default for AuthRequestType { fn default() -> AuthRequestType { - Self::Variant0 + Self::AuthenticateAndUnlock } } diff --git a/crates/bitwarden-api-api/src/models/bitwarden_product_type.rs b/crates/bitwarden-api-api/src/models/bitwarden_product_type.rs deleted file mode 100644 index 2224e9781..000000000 --- a/crates/bitwarden-api-api/src/models/bitwarden_product_type.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -/// -#[repr(i64)] -#[derive( - Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, -)] -pub enum BitwardenProductType { - Variant0 = 0, - Variant1 = 1, -} - -impl ToString for BitwardenProductType { - fn to_string(&self) -> String { - match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - } - } -} - -impl Default for BitwardenProductType { - fn default() -> BitwardenProductType { - Self::Variant0 - } -} diff --git a/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs b/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs index d20cef2db..4443b8c03 100644 --- a/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs +++ b/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum CipherRepromptType { - Variant0 = 0, - Variant1 = 1, + None = 0, + Password = 1, } impl ToString for CipherRepromptType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::None => String::from("0"), + Self::Password => String::from("1"), } } } impl Default for CipherRepromptType { fn default() -> CipherRepromptType { - Self::Variant0 + Self::None } } diff --git a/crates/bitwarden-api-api/src/models/cipher_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_response_model_list_response_model.rs deleted file mode 100644 index ca2541930..000000000 --- a/crates/bitwarden-api-api/src/models/cipher_response_model_list_response_model.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct CipherResponseModelListResponseModel { - #[serde(rename = "object", skip_serializing_if = "Option::is_none")] - pub object: Option, - #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option>, - #[serde(rename = "continuationToken", skip_serializing_if = "Option::is_none")] - pub continuation_token: Option, -} - -impl CipherResponseModelListResponseModel { - pub fn new() -> CipherResponseModelListResponseModel { - CipherResponseModelListResponseModel { - object: None, - data: None, - continuation_token: None, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/cipher_type.rs b/crates/bitwarden-api-api/src/models/cipher_type.rs index 1420ac6a4..044349ef8 100644 --- a/crates/bitwarden-api-api/src/models/cipher_type.rs +++ b/crates/bitwarden-api-api/src/models/cipher_type.rs @@ -14,25 +14,25 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum CipherType { - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Login = 1, + SecureNote = 2, + Card = 3, + Identity = 4, } impl ToString for CipherType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Login => String::from("1"), + Self::SecureNote => String::from("2"), + Self::Card => String::from("3"), + Self::Identity => String::from("4"), } } } impl Default for CipherType { fn default() -> CipherType { - Self::Variant1 + Self::Login } } diff --git a/crates/bitwarden-api-api/src/models/device_type.rs b/crates/bitwarden-api-api/src/models/device_type.rs index 26bbc7a52..12e162ce6 100644 --- a/crates/bitwarden-api-api/src/models/device_type.rs +++ b/crates/bitwarden-api-api/src/models/device_type.rs @@ -14,69 +14,69 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum DeviceType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, - Variant12 = 12, - Variant13 = 13, - Variant14 = 14, - Variant15 = 15, - Variant16 = 16, - Variant17 = 17, - Variant18 = 18, - Variant19 = 19, - Variant20 = 20, - Variant21 = 21, - Variant22 = 22, - Variant23 = 23, - Variant24 = 24, - Variant25 = 25, + Android = 0, + iOS = 1, + ChromeExtension = 2, + FirefoxExtension = 3, + OperaExtension = 4, + EdgeExtension = 5, + WindowsDesktop = 6, + MacOsDesktop = 7, + LinuxDesktop = 8, + ChromeBrowser = 9, + FirefoxBrowser = 10, + OperaBrowser = 11, + EdgeBrowser = 12, + IEBrowser = 13, + UnknownBrowser = 14, + AndroidAmazon = 15, + UWP = 16, + SafariBrowser = 17, + VivaldiBrowser = 18, + VivaldiExtension = 19, + SafariExtension = 20, + SDK = 21, + Server = 22, + WindowsCLI = 23, + MacOsCLI = 24, + LinuxCLI = 25, } impl ToString for DeviceType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), - Self::Variant12 => String::from("12"), - Self::Variant13 => String::from("13"), - Self::Variant14 => String::from("14"), - Self::Variant15 => String::from("15"), - Self::Variant16 => String::from("16"), - Self::Variant17 => String::from("17"), - Self::Variant18 => String::from("18"), - Self::Variant19 => String::from("19"), - Self::Variant20 => String::from("20"), - Self::Variant21 => String::from("21"), - Self::Variant22 => String::from("22"), - Self::Variant23 => String::from("23"), - Self::Variant24 => String::from("24"), - Self::Variant25 => String::from("25"), + Self::Android => String::from("0"), + Self::iOS => String::from("1"), + Self::ChromeExtension => String::from("2"), + Self::FirefoxExtension => String::from("3"), + Self::OperaExtension => String::from("4"), + Self::EdgeExtension => String::from("5"), + Self::WindowsDesktop => String::from("6"), + Self::MacOsDesktop => String::from("7"), + Self::LinuxDesktop => String::from("8"), + Self::ChromeBrowser => String::from("9"), + Self::FirefoxBrowser => String::from("10"), + Self::OperaBrowser => String::from("11"), + Self::EdgeBrowser => String::from("12"), + Self::IEBrowser => String::from("13"), + Self::UnknownBrowser => String::from("14"), + Self::AndroidAmazon => String::from("15"), + Self::UWP => String::from("16"), + Self::SafariBrowser => String::from("17"), + Self::VivaldiBrowser => String::from("18"), + Self::VivaldiExtension => String::from("19"), + Self::SafariExtension => String::from("20"), + Self::SDK => String::from("21"), + Self::Server => String::from("22"), + Self::WindowsCLI => String::from("23"), + Self::MacOsCLI => String::from("24"), + Self::LinuxCLI => String::from("25"), } } } impl Default for DeviceType { fn default() -> DeviceType { - Self::Variant0 + Self::Android } } diff --git a/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs b/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs index a4766cec4..9b046f3eb 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs @@ -14,27 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EmergencyAccessStatusType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Invited = 0, + Accepted = 1, + Confirmed = 2, + RecoveryInitiated = 3, + RecoveryApproved = 4, } impl ToString for EmergencyAccessStatusType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Invited => String::from("0"), + Self::Accepted => String::from("1"), + Self::Confirmed => String::from("2"), + Self::RecoveryInitiated => String::from("3"), + Self::RecoveryApproved => String::from("4"), } } } impl Default for EmergencyAccessStatusType { fn default() -> EmergencyAccessStatusType { - Self::Variant0 + Self::Invited } } diff --git a/crates/bitwarden-api-api/src/models/emergency_access_type.rs b/crates/bitwarden-api-api/src/models/emergency_access_type.rs index 007df25a2..317c42f94 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_type.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EmergencyAccessType { - Variant0 = 0, - Variant1 = 1, + View = 0, + Takeover = 1, } impl ToString for EmergencyAccessType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::View => String::from("0"), + Self::Takeover => String::from("1"), } } } impl Default for EmergencyAccessType { fn default() -> EmergencyAccessType { - Self::Variant0 + Self::View } } diff --git a/crates/bitwarden-api-api/src/models/event_system_user.rs b/crates/bitwarden-api-api/src/models/event_system_user.rs index 8a1795433..afb1333e8 100644 --- a/crates/bitwarden-api-api/src/models/event_system_user.rs +++ b/crates/bitwarden-api-api/src/models/event_system_user.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EventSystemUser { - Variant1 = 1, - Variant2 = 2, + SCIM = 1, + DomainVerification = 2, } impl ToString for EventSystemUser { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::SCIM => String::from("1"), + Self::DomainVerification => String::from("2"), } } } impl Default for EventSystemUser { fn default() -> EventSystemUser { - Self::Variant1 + Self::SCIM } } diff --git a/crates/bitwarden-api-api/src/models/event_type.rs b/crates/bitwarden-api-api/src/models/event_type.rs index cc4e96c14..2826c1fb4 100644 --- a/crates/bitwarden-api-api/src/models/event_type.rs +++ b/crates/bitwarden-api-api/src/models/event_type.rs @@ -14,165 +14,165 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EventType { - Variant1000 = 1000, - Variant1001 = 1001, - Variant1002 = 1002, - Variant1003 = 1003, - Variant1004 = 1004, - Variant1005 = 1005, - Variant1006 = 1006, - Variant1007 = 1007, - Variant1008 = 1008, - Variant1009 = 1009, - Variant1010 = 1010, - Variant1100 = 1100, - Variant1101 = 1101, - Variant1102 = 1102, - Variant1103 = 1103, - Variant1104 = 1104, - Variant1105 = 1105, - Variant1106 = 1106, - Variant1107 = 1107, - Variant1108 = 1108, - Variant1109 = 1109, - Variant1110 = 1110, - Variant1111 = 1111, - Variant1112 = 1112, - Variant1113 = 1113, - Variant1114 = 1114, - Variant1115 = 1115, - Variant1116 = 1116, - Variant1117 = 1117, - Variant1300 = 1300, - Variant1301 = 1301, - Variant1302 = 1302, - Variant1400 = 1400, - Variant1401 = 1401, - Variant1402 = 1402, - Variant1500 = 1500, - Variant1501 = 1501, - Variant1502 = 1502, - Variant1503 = 1503, - Variant1504 = 1504, - Variant1505 = 1505, - Variant1506 = 1506, - Variant1507 = 1507, - Variant1508 = 1508, - Variant1509 = 1509, - Variant1510 = 1510, - Variant1511 = 1511, - Variant1512 = 1512, - Variant1513 = 1513, - Variant1514 = 1514, - Variant1600 = 1600, - Variant1601 = 1601, - Variant1602 = 1602, - Variant1603 = 1603, - Variant1604 = 1604, - Variant1605 = 1605, - Variant1606 = 1606, - Variant1607 = 1607, - Variant1608 = 1608, - Variant1609 = 1609, - Variant1700 = 1700, - Variant1800 = 1800, - Variant1801 = 1801, - Variant1802 = 1802, - Variant1803 = 1803, - Variant1900 = 1900, - Variant1901 = 1901, - Variant1902 = 1902, - Variant1903 = 1903, - Variant2000 = 2000, - Variant2001 = 2001, - Variant2002 = 2002, - Variant2003 = 2003, - Variant2100 = 2100, + User_LoggedIn = 1000, + User_ChangedPassword = 1001, + User_Updated2fa = 1002, + User_Disabled2fa = 1003, + User_Recovered2fa = 1004, + User_FailedLogIn = 1005, + User_FailedLogIn2fa = 1006, + User_ClientExportedVault = 1007, + User_UpdatedTempPassword = 1008, + User_MigratedKeyToKeyConnector = 1009, + User_RequestedDeviceApproval = 1010, + Cipher_Created = 1100, + Cipher_Updated = 1101, + Cipher_Deleted = 1102, + Cipher_AttachmentCreated = 1103, + Cipher_AttachmentDeleted = 1104, + Cipher_Shared = 1105, + Cipher_UpdatedCollections = 1106, + Cipher_ClientViewed = 1107, + Cipher_ClientToggledPasswordVisible = 1108, + Cipher_ClientToggledHiddenFieldVisible = 1109, + Cipher_ClientToggledCardCodeVisible = 1110, + Cipher_ClientCopiedPassword = 1111, + Cipher_ClientCopiedHiddenField = 1112, + Cipher_ClientCopiedCardCode = 1113, + Cipher_ClientAutofilled = 1114, + Cipher_SoftDeleted = 1115, + Cipher_Restored = 1116, + Cipher_ClientToggledCardNumberVisible = 1117, + Collection_Created = 1300, + Collection_Updated = 1301, + Collection_Deleted = 1302, + Group_Created = 1400, + Group_Updated = 1401, + Group_Deleted = 1402, + OrganizationUser_Invited = 1500, + OrganizationUser_Confirmed = 1501, + OrganizationUser_Updated = 1502, + OrganizationUser_Removed = 1503, + OrganizationUser_UpdatedGroups = 1504, + OrganizationUser_UnlinkedSso = 1505, + OrganizationUser_ResetPassword_Enroll = 1506, + OrganizationUser_ResetPassword_Withdraw = 1507, + OrganizationUser_AdminResetPassword = 1508, + OrganizationUser_ResetSsoLink = 1509, + OrganizationUser_FirstSsoLogin = 1510, + OrganizationUser_Revoked = 1511, + OrganizationUser_Restored = 1512, + OrganizationUser_ApprovedAuthRequest = 1513, + OrganizationUser_RejectedAuthRequest = 1514, + Organization_Updated = 1600, + Organization_PurgedVault = 1601, + Organization_ClientExportedVault = 1602, + Organization_VaultAccessed = 1603, + Organization_EnabledSso = 1604, + Organization_DisabledSso = 1605, + Organization_EnabledKeyConnector = 1606, + Organization_DisabledKeyConnector = 1607, + Organization_SponsorshipsSynced = 1608, + Organization_CollectionManagement_Updated = 1609, + Policy_Updated = 1700, + ProviderUser_Invited = 1800, + ProviderUser_Confirmed = 1801, + ProviderUser_Updated = 1802, + ProviderUser_Removed = 1803, + ProviderOrganization_Created = 1900, + ProviderOrganization_Added = 1901, + ProviderOrganization_Removed = 1902, + ProviderOrganization_VaultAccessed = 1903, + OrganizationDomain_Added = 2000, + OrganizationDomain_Removed = 2001, + OrganizationDomain_Verified = 2002, + OrganizationDomain_NotVerified = 2003, + Secret_Retrieved = 2100, } impl ToString for EventType { fn to_string(&self) -> String { match self { - Self::Variant1000 => String::from("1000"), - Self::Variant1001 => String::from("1001"), - Self::Variant1002 => String::from("1002"), - Self::Variant1003 => String::from("1003"), - Self::Variant1004 => String::from("1004"), - Self::Variant1005 => String::from("1005"), - Self::Variant1006 => String::from("1006"), - Self::Variant1007 => String::from("1007"), - Self::Variant1008 => String::from("1008"), - Self::Variant1009 => String::from("1009"), - Self::Variant1010 => String::from("1010"), - Self::Variant1100 => String::from("1100"), - Self::Variant1101 => String::from("1101"), - Self::Variant1102 => String::from("1102"), - Self::Variant1103 => String::from("1103"), - Self::Variant1104 => String::from("1104"), - Self::Variant1105 => String::from("1105"), - Self::Variant1106 => String::from("1106"), - Self::Variant1107 => String::from("1107"), - Self::Variant1108 => String::from("1108"), - Self::Variant1109 => String::from("1109"), - Self::Variant1110 => String::from("1110"), - Self::Variant1111 => String::from("1111"), - Self::Variant1112 => String::from("1112"), - Self::Variant1113 => String::from("1113"), - Self::Variant1114 => String::from("1114"), - Self::Variant1115 => String::from("1115"), - Self::Variant1116 => String::from("1116"), - Self::Variant1117 => String::from("1117"), - Self::Variant1300 => String::from("1300"), - Self::Variant1301 => String::from("1301"), - Self::Variant1302 => String::from("1302"), - Self::Variant1400 => String::from("1400"), - Self::Variant1401 => String::from("1401"), - Self::Variant1402 => String::from("1402"), - Self::Variant1500 => String::from("1500"), - Self::Variant1501 => String::from("1501"), - Self::Variant1502 => String::from("1502"), - Self::Variant1503 => String::from("1503"), - Self::Variant1504 => String::from("1504"), - Self::Variant1505 => String::from("1505"), - Self::Variant1506 => String::from("1506"), - Self::Variant1507 => String::from("1507"), - Self::Variant1508 => String::from("1508"), - Self::Variant1509 => String::from("1509"), - Self::Variant1510 => String::from("1510"), - Self::Variant1511 => String::from("1511"), - Self::Variant1512 => String::from("1512"), - Self::Variant1513 => String::from("1513"), - Self::Variant1514 => String::from("1514"), - Self::Variant1600 => String::from("1600"), - Self::Variant1601 => String::from("1601"), - Self::Variant1602 => String::from("1602"), - Self::Variant1603 => String::from("1603"), - Self::Variant1604 => String::from("1604"), - Self::Variant1605 => String::from("1605"), - Self::Variant1606 => String::from("1606"), - Self::Variant1607 => String::from("1607"), - Self::Variant1608 => String::from("1608"), - Self::Variant1609 => String::from("1609"), - Self::Variant1700 => String::from("1700"), - Self::Variant1800 => String::from("1800"), - Self::Variant1801 => String::from("1801"), - Self::Variant1802 => String::from("1802"), - Self::Variant1803 => String::from("1803"), - Self::Variant1900 => String::from("1900"), - Self::Variant1901 => String::from("1901"), - Self::Variant1902 => String::from("1902"), - Self::Variant1903 => String::from("1903"), - Self::Variant2000 => String::from("2000"), - Self::Variant2001 => String::from("2001"), - Self::Variant2002 => String::from("2002"), - Self::Variant2003 => String::from("2003"), - Self::Variant2100 => String::from("2100"), + Self::User_LoggedIn => String::from("1000"), + Self::User_ChangedPassword => String::from("1001"), + Self::User_Updated2fa => String::from("1002"), + Self::User_Disabled2fa => String::from("1003"), + Self::User_Recovered2fa => String::from("1004"), + Self::User_FailedLogIn => String::from("1005"), + Self::User_FailedLogIn2fa => String::from("1006"), + Self::User_ClientExportedVault => String::from("1007"), + Self::User_UpdatedTempPassword => String::from("1008"), + Self::User_MigratedKeyToKeyConnector => String::from("1009"), + Self::User_RequestedDeviceApproval => String::from("1010"), + Self::Cipher_Created => String::from("1100"), + Self::Cipher_Updated => String::from("1101"), + Self::Cipher_Deleted => String::from("1102"), + Self::Cipher_AttachmentCreated => String::from("1103"), + Self::Cipher_AttachmentDeleted => String::from("1104"), + Self::Cipher_Shared => String::from("1105"), + Self::Cipher_UpdatedCollections => String::from("1106"), + Self::Cipher_ClientViewed => String::from("1107"), + Self::Cipher_ClientToggledPasswordVisible => String::from("1108"), + Self::Cipher_ClientToggledHiddenFieldVisible => String::from("1109"), + Self::Cipher_ClientToggledCardCodeVisible => String::from("1110"), + Self::Cipher_ClientCopiedPassword => String::from("1111"), + Self::Cipher_ClientCopiedHiddenField => String::from("1112"), + Self::Cipher_ClientCopiedCardCode => String::from("1113"), + Self::Cipher_ClientAutofilled => String::from("1114"), + Self::Cipher_SoftDeleted => String::from("1115"), + Self::Cipher_Restored => String::from("1116"), + Self::Cipher_ClientToggledCardNumberVisible => String::from("1117"), + Self::Collection_Created => String::from("1300"), + Self::Collection_Updated => String::from("1301"), + Self::Collection_Deleted => String::from("1302"), + Self::Group_Created => String::from("1400"), + Self::Group_Updated => String::from("1401"), + Self::Group_Deleted => String::from("1402"), + Self::OrganizationUser_Invited => String::from("1500"), + Self::OrganizationUser_Confirmed => String::from("1501"), + Self::OrganizationUser_Updated => String::from("1502"), + Self::OrganizationUser_Removed => String::from("1503"), + Self::OrganizationUser_UpdatedGroups => String::from("1504"), + Self::OrganizationUser_UnlinkedSso => String::from("1505"), + Self::OrganizationUser_ResetPassword_Enroll => String::from("1506"), + Self::OrganizationUser_ResetPassword_Withdraw => String::from("1507"), + Self::OrganizationUser_AdminResetPassword => String::from("1508"), + Self::OrganizationUser_ResetSsoLink => String::from("1509"), + Self::OrganizationUser_FirstSsoLogin => String::from("1510"), + Self::OrganizationUser_Revoked => String::from("1511"), + Self::OrganizationUser_Restored => String::from("1512"), + Self::OrganizationUser_ApprovedAuthRequest => String::from("1513"), + Self::OrganizationUser_RejectedAuthRequest => String::from("1514"), + Self::Organization_Updated => String::from("1600"), + Self::Organization_PurgedVault => String::from("1601"), + Self::Organization_ClientExportedVault => String::from("1602"), + Self::Organization_VaultAccessed => String::from("1603"), + Self::Organization_EnabledSso => String::from("1604"), + Self::Organization_DisabledSso => String::from("1605"), + Self::Organization_EnabledKeyConnector => String::from("1606"), + Self::Organization_DisabledKeyConnector => String::from("1607"), + Self::Organization_SponsorshipsSynced => String::from("1608"), + Self::Organization_CollectionManagement_Updated => String::from("1609"), + Self::Policy_Updated => String::from("1700"), + Self::ProviderUser_Invited => String::from("1800"), + Self::ProviderUser_Confirmed => String::from("1801"), + Self::ProviderUser_Updated => String::from("1802"), + Self::ProviderUser_Removed => String::from("1803"), + Self::ProviderOrganization_Created => String::from("1900"), + Self::ProviderOrganization_Added => String::from("1901"), + Self::ProviderOrganization_Removed => String::from("1902"), + Self::ProviderOrganization_VaultAccessed => String::from("1903"), + Self::OrganizationDomain_Added => String::from("2000"), + Self::OrganizationDomain_Removed => String::from("2001"), + Self::OrganizationDomain_Verified => String::from("2002"), + Self::OrganizationDomain_NotVerified => String::from("2003"), + Self::Secret_Retrieved => String::from("2100"), } } } impl Default for EventType { fn default() -> EventType { - Self::Variant1000 + Self::User_LoggedIn } } diff --git a/crates/bitwarden-api-api/src/models/field_type.rs b/crates/bitwarden-api-api/src/models/field_type.rs index fbaa9b728..3a6209399 100644 --- a/crates/bitwarden-api-api/src/models/field_type.rs +++ b/crates/bitwarden-api-api/src/models/field_type.rs @@ -14,25 +14,25 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum FieldType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, + Text = 0, + Hidden = 1, + Boolean = 2, + Linked = 3, } impl ToString for FieldType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), + Self::Text => String::from("0"), + Self::Hidden => String::from("1"), + Self::Boolean => String::from("2"), + Self::Linked => String::from("3"), } } } impl Default for FieldType { fn default() -> FieldType { - Self::Variant0 + Self::Text } } diff --git a/crates/bitwarden-api-api/src/models/file_upload_type.rs b/crates/bitwarden-api-api/src/models/file_upload_type.rs index 765bc7563..79327b3cb 100644 --- a/crates/bitwarden-api-api/src/models/file_upload_type.rs +++ b/crates/bitwarden-api-api/src/models/file_upload_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum FileUploadType { - Variant0 = 0, - Variant1 = 1, + Direct = 0, + Azure = 1, } impl ToString for FileUploadType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::Direct => String::from("0"), + Self::Azure => String::from("1"), } } } impl Default for FileUploadType { fn default() -> FileUploadType { - Self::Variant0 + Self::Direct } } diff --git a/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs b/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs index f5e1c3655..f30b2d5e7 100644 --- a/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs +++ b/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs @@ -14,199 +14,199 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum GlobalEquivalentDomainsType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, - Variant12 = 12, - Variant13 = 13, - Variant14 = 14, - Variant15 = 15, - Variant16 = 16, - Variant17 = 17, - Variant18 = 18, - Variant19 = 19, - Variant20 = 20, - Variant21 = 21, - Variant22 = 22, - Variant23 = 23, - Variant24 = 24, - Variant25 = 25, - Variant26 = 26, - Variant27 = 27, - Variant28 = 28, - Variant29 = 29, - Variant30 = 30, - Variant31 = 31, - Variant32 = 32, - Variant33 = 33, - Variant34 = 34, - Variant35 = 35, - Variant36 = 36, - Variant37 = 37, - Variant38 = 38, - Variant39 = 39, - Variant40 = 40, - Variant41 = 41, - Variant42 = 42, - Variant43 = 43, - Variant44 = 44, - Variant45 = 45, - Variant46 = 46, - Variant47 = 47, - Variant48 = 48, - Variant49 = 49, - Variant50 = 50, - Variant51 = 51, - Variant52 = 52, - Variant53 = 53, - Variant54 = 54, - Variant55 = 55, - Variant56 = 56, - Variant57 = 57, - Variant58 = 58, - Variant59 = 59, - Variant60 = 60, - Variant61 = 61, - Variant62 = 62, - Variant63 = 63, - Variant64 = 64, - Variant65 = 65, - Variant66 = 66, - Variant67 = 67, - Variant68 = 68, - Variant69 = 69, - Variant70 = 70, - Variant71 = 71, - Variant72 = 72, - Variant73 = 73, - Variant74 = 74, - Variant75 = 75, - Variant76 = 76, - Variant77 = 77, - Variant78 = 78, - Variant79 = 79, - Variant80 = 80, - Variant81 = 81, - Variant82 = 82, - Variant83 = 83, - Variant84 = 84, - Variant85 = 85, - Variant86 = 86, - Variant87 = 87, - Variant88 = 88, - Variant89 = 89, - Variant90 = 90, + Google = 0, + Apple = 1, + Ameritrade = 2, + BoA = 3, + Sprint = 4, + WellsFargo = 5, + Merrill = 6, + Citi = 7, + Cnet = 8, + Gap = 9, + Microsoft = 10, + United = 11, + Yahoo = 12, + Zonelabs = 13, + PayPal = 14, + Avon = 15, + Diapers = 16, + Contacts = 17, + Amazon = 18, + Cox = 19, + Norton = 20, + Verizon = 21, + Buy = 22, + Sirius = 23, + Ea = 24, + Basecamp = 25, + Steam = 26, + Chart = 27, + Gotomeeting = 28, + Gogo = 29, + Oracle = 30, + Discover = 31, + Dcu = 32, + Healthcare = 33, + Pepco = 34, + Century21 = 35, + Comcast = 36, + Cricket = 37, + Mtb = 38, + Dropbox = 39, + Snapfish = 40, + Alibaba = 41, + Playstation = 42, + Mercado = 43, + Zendesk = 44, + Autodesk = 45, + RailNation = 46, + Wpcu = 47, + Mathletics = 48, + Discountbank = 49, + Mi = 50, + Facebook = 51, + Postepay = 52, + Skysports = 53, + Disney = 54, + Pokemon = 55, + Uv = 56, + Yahavo = 57, + Mdsol = 58, + Sears = 59, + Xiami = 60, + Belkin = 61, + Turbotax = 62, + Shopify = 63, + Ebay = 64, + Techdata = 65, + Schwab = 66, + Mozilla = 67, + Tesla = 68, + MorganStanley = 69, + TaxAct = 70, + Wikimedia = 71, + Airbnb = 72, + Eventbrite = 73, + StackExchange = 74, + Docusign = 75, + Envato = 76, + X10Hosting = 77, + Cisco = 78, + CedarFair = 79, + Ubiquiti = 80, + Discord = 81, + Netcup = 82, + Yandex = 83, + Sony = 84, + Proton = 85, + Ubisoft = 86, + TransferWise = 87, + TakeawayEU = 88, + Atlassian = 89, + Pinterest = 90, } impl ToString for GlobalEquivalentDomainsType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), - Self::Variant12 => String::from("12"), - Self::Variant13 => String::from("13"), - Self::Variant14 => String::from("14"), - Self::Variant15 => String::from("15"), - Self::Variant16 => String::from("16"), - Self::Variant17 => String::from("17"), - Self::Variant18 => String::from("18"), - Self::Variant19 => String::from("19"), - Self::Variant20 => String::from("20"), - Self::Variant21 => String::from("21"), - Self::Variant22 => String::from("22"), - Self::Variant23 => String::from("23"), - Self::Variant24 => String::from("24"), - Self::Variant25 => String::from("25"), - Self::Variant26 => String::from("26"), - Self::Variant27 => String::from("27"), - Self::Variant28 => String::from("28"), - Self::Variant29 => String::from("29"), - Self::Variant30 => String::from("30"), - Self::Variant31 => String::from("31"), - Self::Variant32 => String::from("32"), - Self::Variant33 => String::from("33"), - Self::Variant34 => String::from("34"), - Self::Variant35 => String::from("35"), - Self::Variant36 => String::from("36"), - Self::Variant37 => String::from("37"), - Self::Variant38 => String::from("38"), - Self::Variant39 => String::from("39"), - Self::Variant40 => String::from("40"), - Self::Variant41 => String::from("41"), - Self::Variant42 => String::from("42"), - Self::Variant43 => String::from("43"), - Self::Variant44 => String::from("44"), - Self::Variant45 => String::from("45"), - Self::Variant46 => String::from("46"), - Self::Variant47 => String::from("47"), - Self::Variant48 => String::from("48"), - Self::Variant49 => String::from("49"), - Self::Variant50 => String::from("50"), - Self::Variant51 => String::from("51"), - Self::Variant52 => String::from("52"), - Self::Variant53 => String::from("53"), - Self::Variant54 => String::from("54"), - Self::Variant55 => String::from("55"), - Self::Variant56 => String::from("56"), - Self::Variant57 => String::from("57"), - Self::Variant58 => String::from("58"), - Self::Variant59 => String::from("59"), - Self::Variant60 => String::from("60"), - Self::Variant61 => String::from("61"), - Self::Variant62 => String::from("62"), - Self::Variant63 => String::from("63"), - Self::Variant64 => String::from("64"), - Self::Variant65 => String::from("65"), - Self::Variant66 => String::from("66"), - Self::Variant67 => String::from("67"), - Self::Variant68 => String::from("68"), - Self::Variant69 => String::from("69"), - Self::Variant70 => String::from("70"), - Self::Variant71 => String::from("71"), - Self::Variant72 => String::from("72"), - Self::Variant73 => String::from("73"), - Self::Variant74 => String::from("74"), - Self::Variant75 => String::from("75"), - Self::Variant76 => String::from("76"), - Self::Variant77 => String::from("77"), - Self::Variant78 => String::from("78"), - Self::Variant79 => String::from("79"), - Self::Variant80 => String::from("80"), - Self::Variant81 => String::from("81"), - Self::Variant82 => String::from("82"), - Self::Variant83 => String::from("83"), - Self::Variant84 => String::from("84"), - Self::Variant85 => String::from("85"), - Self::Variant86 => String::from("86"), - Self::Variant87 => String::from("87"), - Self::Variant88 => String::from("88"), - Self::Variant89 => String::from("89"), - Self::Variant90 => String::from("90"), + Self::Google => String::from("0"), + Self::Apple => String::from("1"), + Self::Ameritrade => String::from("2"), + Self::BoA => String::from("3"), + Self::Sprint => String::from("4"), + Self::WellsFargo => String::from("5"), + Self::Merrill => String::from("6"), + Self::Citi => String::from("7"), + Self::Cnet => String::from("8"), + Self::Gap => String::from("9"), + Self::Microsoft => String::from("10"), + Self::United => String::from("11"), + Self::Yahoo => String::from("12"), + Self::Zonelabs => String::from("13"), + Self::PayPal => String::from("14"), + Self::Avon => String::from("15"), + Self::Diapers => String::from("16"), + Self::Contacts => String::from("17"), + Self::Amazon => String::from("18"), + Self::Cox => String::from("19"), + Self::Norton => String::from("20"), + Self::Verizon => String::from("21"), + Self::Buy => String::from("22"), + Self::Sirius => String::from("23"), + Self::Ea => String::from("24"), + Self::Basecamp => String::from("25"), + Self::Steam => String::from("26"), + Self::Chart => String::from("27"), + Self::Gotomeeting => String::from("28"), + Self::Gogo => String::from("29"), + Self::Oracle => String::from("30"), + Self::Discover => String::from("31"), + Self::Dcu => String::from("32"), + Self::Healthcare => String::from("33"), + Self::Pepco => String::from("34"), + Self::Century21 => String::from("35"), + Self::Comcast => String::from("36"), + Self::Cricket => String::from("37"), + Self::Mtb => String::from("38"), + Self::Dropbox => String::from("39"), + Self::Snapfish => String::from("40"), + Self::Alibaba => String::from("41"), + Self::Playstation => String::from("42"), + Self::Mercado => String::from("43"), + Self::Zendesk => String::from("44"), + Self::Autodesk => String::from("45"), + Self::RailNation => String::from("46"), + Self::Wpcu => String::from("47"), + Self::Mathletics => String::from("48"), + Self::Discountbank => String::from("49"), + Self::Mi => String::from("50"), + Self::Facebook => String::from("51"), + Self::Postepay => String::from("52"), + Self::Skysports => String::from("53"), + Self::Disney => String::from("54"), + Self::Pokemon => String::from("55"), + Self::Uv => String::from("56"), + Self::Yahavo => String::from("57"), + Self::Mdsol => String::from("58"), + Self::Sears => String::from("59"), + Self::Xiami => String::from("60"), + Self::Belkin => String::from("61"), + Self::Turbotax => String::from("62"), + Self::Shopify => String::from("63"), + Self::Ebay => String::from("64"), + Self::Techdata => String::from("65"), + Self::Schwab => String::from("66"), + Self::Mozilla => String::from("67"), + Self::Tesla => String::from("68"), + Self::MorganStanley => String::from("69"), + Self::TaxAct => String::from("70"), + Self::Wikimedia => String::from("71"), + Self::Airbnb => String::from("72"), + Self::Eventbrite => String::from("73"), + Self::StackExchange => String::from("74"), + Self::Docusign => String::from("75"), + Self::Envato => String::from("76"), + Self::X10Hosting => String::from("77"), + Self::Cisco => String::from("78"), + Self::CedarFair => String::from("79"), + Self::Ubiquiti => String::from("80"), + Self::Discord => String::from("81"), + Self::Netcup => String::from("82"), + Self::Yandex => String::from("83"), + Self::Sony => String::from("84"), + Self::Proton => String::from("85"), + Self::Ubisoft => String::from("86"), + Self::TransferWise => String::from("87"), + Self::TakeawayEU => String::from("88"), + Self::Atlassian => String::from("89"), + Self::Pinterest => String::from("90"), } } } impl Default for GlobalEquivalentDomainsType { fn default() -> GlobalEquivalentDomainsType { - Self::Variant0 + Self::Google } } diff --git a/crates/bitwarden-api-api/src/models/iap_check_request_model.rs b/crates/bitwarden-api-api/src/models/iap_check_request_model.rs deleted file mode 100644 index f18b4b017..000000000 --- a/crates/bitwarden-api-api/src/models/iap_check_request_model.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct IapCheckRequestModel { - #[serde(rename = "paymentMethodType")] - pub payment_method_type: crate::models::PaymentMethodType, -} - -impl IapCheckRequestModel { - pub fn new(payment_method_type: crate::models::PaymentMethodType) -> IapCheckRequestModel { - IapCheckRequestModel { - payment_method_type, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/inner_project.rs b/crates/bitwarden-api-api/src/models/inner_project.rs deleted file mode 100644 index 59ecb7f07..000000000 --- a/crates/bitwarden-api-api/src/models/inner_project.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct InnerProject { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl InnerProject { - pub fn new() -> InnerProject { - InnerProject { - id: None, - name: None, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/inner_secret.rs b/crates/bitwarden-api-api/src/models/inner_secret.rs deleted file mode 100644 index 43deb0f1a..000000000 --- a/crates/bitwarden-api-api/src/models/inner_secret.rs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct InnerSecret { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")] - pub organization_id: Option, - #[serde(rename = "key", skip_serializing_if = "Option::is_none")] - pub key: Option, - #[serde(rename = "creationDate", skip_serializing_if = "Option::is_none")] - pub creation_date: Option, - #[serde(rename = "revisionDate", skip_serializing_if = "Option::is_none")] - pub revision_date: Option, - #[serde(rename = "projects", skip_serializing_if = "Option::is_none")] - pub projects: Option>, - #[serde(rename = "read", skip_serializing_if = "Option::is_none")] - pub read: Option, - #[serde(rename = "write", skip_serializing_if = "Option::is_none")] - pub write: Option, -} - -impl InnerSecret { - pub fn new() -> InnerSecret { - InnerSecret { - id: None, - organization_id: None, - key: None, - creation_date: None, - revision_date: None, - projects: None, - read: None, - write: None, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/kdf_type.rs b/crates/bitwarden-api-api/src/models/kdf_type.rs index 83b611680..e371ee156 100644 --- a/crates/bitwarden-api-api/src/models/kdf_type.rs +++ b/crates/bitwarden-api-api/src/models/kdf_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum KdfType { - Variant0 = 0, - Variant1 = 1, + PBKDF2_SHA256 = 0, + Argon2id = 1, } impl ToString for KdfType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::PBKDF2_SHA256 => String::from("0"), + Self::Argon2id => String::from("1"), } } } impl Default for KdfType { fn default() -> KdfType { - Self::Variant0 + Self::PBKDF2_SHA256 } } diff --git a/crates/bitwarden-api-api/src/models/license_type.rs b/crates/bitwarden-api-api/src/models/license_type.rs index 0f887fa79..178b3433f 100644 --- a/crates/bitwarden-api-api/src/models/license_type.rs +++ b/crates/bitwarden-api-api/src/models/license_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum LicenseType { - Variant0 = 0, - Variant1 = 1, + User = 0, + Organization = 1, } impl ToString for LicenseType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::User => String::from("0"), + Self::Organization => String::from("1"), } } } impl Default for LicenseType { fn default() -> LicenseType { - Self::Variant0 + Self::User } } diff --git a/crates/bitwarden-api-api/src/models/member_decryption_type.rs b/crates/bitwarden-api-api/src/models/member_decryption_type.rs index e36344a9f..dba1b793b 100644 --- a/crates/bitwarden-api-api/src/models/member_decryption_type.rs +++ b/crates/bitwarden-api-api/src/models/member_decryption_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum MemberDecryptionType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + MasterPassword = 0, + KeyConnector = 1, + TrustedDeviceEncryption = 2, } impl ToString for MemberDecryptionType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::MasterPassword => String::from("0"), + Self::KeyConnector => String::from("1"), + Self::TrustedDeviceEncryption => String::from("2"), } } } impl Default for MemberDecryptionType { fn default() -> MemberDecryptionType { - Self::Variant0 + Self::MasterPassword } } diff --git a/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs b/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs index 73fb93eb8..792a2dd9e 100644 --- a/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs +++ b/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OpenIdConnectRedirectBehavior { - Variant0 = 0, - Variant1 = 1, + RedirectGet = 0, + FormPost = 1, } impl ToString for OpenIdConnectRedirectBehavior { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::RedirectGet => String::from("0"), + Self::FormPost => String::from("1"), } } } impl Default for OpenIdConnectRedirectBehavior { fn default() -> OpenIdConnectRedirectBehavior { - Self::Variant0 + Self::RedirectGet } } diff --git a/crates/bitwarden-api-api/src/models/organization_api_key_type.rs b/crates/bitwarden-api-api/src/models/organization_api_key_type.rs index 4790406e5..83f76baaa 100644 --- a/crates/bitwarden-api-api/src/models/organization_api_key_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_api_key_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationApiKeyType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + Default = 0, + BillingSync = 1, + Scim = 2, } impl ToString for OrganizationApiKeyType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::Default => String::from("0"), + Self::BillingSync => String::from("1"), + Self::Scim => String::from("2"), } } } impl Default for OrganizationApiKeyType { fn default() -> OrganizationApiKeyType { - Self::Variant0 + Self::Default } } diff --git a/crates/bitwarden-api-api/src/models/organization_connection_type.rs b/crates/bitwarden-api-api/src/models/organization_connection_type.rs index eddf5460c..201c03ed2 100644 --- a/crates/bitwarden-api-api/src/models/organization_connection_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_connection_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationConnectionType { - Variant1 = 1, - Variant2 = 2, + CloudBillingSync = 1, + Scim = 2, } impl ToString for OrganizationConnectionType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::CloudBillingSync => String::from("1"), + Self::Scim => String::from("2"), } } } impl Default for OrganizationConnectionType { fn default() -> OrganizationConnectionType { - Self::Variant1 + Self::CloudBillingSync } } diff --git a/crates/bitwarden-api-api/src/models/organization_enroll_secrets_manager_request_model.rs b/crates/bitwarden-api-api/src/models/organization_enroll_secrets_manager_request_model.rs deleted file mode 100644 index 16c34a3c5..000000000 --- a/crates/bitwarden-api-api/src/models/organization_enroll_secrets_manager_request_model.rs +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct OrganizationEnrollSecretsManagerRequestModel { - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} - -impl OrganizationEnrollSecretsManagerRequestModel { - pub fn new() -> OrganizationEnrollSecretsManagerRequestModel { - OrganizationEnrollSecretsManagerRequestModel { enabled: None } - } -} diff --git a/crates/bitwarden-api-api/src/models/organization_user_status_type.rs b/crates/bitwarden-api-api/src/models/organization_user_status_type.rs index 7486cab57..5d3c99199 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_status_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_status_type.rs @@ -14,25 +14,25 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationUserStatusType { - _0 = 0, - _1 = 1, - _2 = 2, - __1 = -1, + Invited = 0, + Accepted = 1, + Confirmed = 2, + Revoked = -1, } impl ToString for OrganizationUserStatusType { fn to_string(&self) -> String { match self { - Self::_0 => String::from("0"), - Self::_1 => String::from("1"), - Self::_2 => String::from("2"), - Self::__1 => String::from("-1"), + Self::Invited => String::from("0"), + Self::Accepted => String::from("1"), + Self::Confirmed => String::from("2"), + Self::Revoked => String::from("-1"), } } } impl Default for OrganizationUserStatusType { fn default() -> OrganizationUserStatusType { - Self::_0 + Self::Invited } } diff --git a/crates/bitwarden-api-api/src/models/organization_user_type.rs b/crates/bitwarden-api-api/src/models/organization_user_type.rs index e3642946d..38e415f05 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_type.rs @@ -14,27 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationUserType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Owner = 0, + Admin = 1, + User = 2, + Manager = 3, + Custom = 4, } impl ToString for OrganizationUserType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Owner => String::from("0"), + Self::Admin => String::from("1"), + Self::User => String::from("2"), + Self::Manager => String::from("3"), + Self::Custom => String::from("4"), } } } impl Default for OrganizationUserType { fn default() -> OrganizationUserType { - Self::Variant0 + Self::Owner } } diff --git a/crates/bitwarden-api-api/src/models/payment_method_type.rs b/crates/bitwarden-api-api/src/models/payment_method_type.rs index 8df2830a4..c4d6cf93c 100644 --- a/crates/bitwarden-api-api/src/models/payment_method_type.rs +++ b/crates/bitwarden-api-api/src/models/payment_method_type.rs @@ -14,33 +14,33 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PaymentMethodType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant8 = 8, - Variant255 = 255, + Card = 0, + BankAccount = 1, + PayPal = 2, + BitPay = 3, + Credit = 4, + WireTransfer = 5, + Check = 8, + None = 255, } impl ToString for PaymentMethodType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant8 => String::from("8"), - Self::Variant255 => String::from("255"), + Self::Card => String::from("0"), + Self::BankAccount => String::from("1"), + Self::PayPal => String::from("2"), + Self::BitPay => String::from("3"), + Self::Credit => String::from("4"), + Self::WireTransfer => String::from("5"), + Self::Check => String::from("8"), + Self::None => String::from("255"), } } } impl Default for PaymentMethodType { fn default() -> PaymentMethodType { - Self::Variant0 + Self::Card } } diff --git a/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs b/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs index 5e2a55824..02a750f3d 100644 --- a/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs +++ b/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs @@ -14,19 +14,19 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PlanSponsorshipType { - Variant0 = 0, + FamiliesForEnterprise = 0, } impl ToString for PlanSponsorshipType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), + Self::FamiliesForEnterprise => String::from("0"), } } } impl Default for PlanSponsorshipType { fn default() -> PlanSponsorshipType { - Self::Variant0 + Self::FamiliesForEnterprise } } diff --git a/crates/bitwarden-api-api/src/models/plan_type.rs b/crates/bitwarden-api-api/src/models/plan_type.rs index a43634b19..109e9250e 100644 --- a/crates/bitwarden-api-api/src/models/plan_type.rs +++ b/crates/bitwarden-api-api/src/models/plan_type.rs @@ -14,51 +14,51 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PlanType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, - Variant12 = 12, - Variant13 = 13, - Variant14 = 14, - Variant15 = 15, - Variant16 = 16, + Free = 0, + FamiliesAnnually2019 = 1, + TeamsMonthly2019 = 2, + TeamsAnnually2019 = 3, + EnterpriseMonthly2019 = 4, + EnterpriseAnnually2019 = 5, + Custom = 6, + FamiliesAnnually = 7, + TeamsMonthly2020 = 8, + TeamsAnnually2020 = 9, + EnterpriseMonthly2020 = 10, + EnterpriseAnnually2020 = 11, + TeamsMonthly = 12, + TeamsAnnually = 13, + EnterpriseMonthly = 14, + EnterpriseAnnually = 15, + TeamsStarter = 16, } impl ToString for PlanType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), - Self::Variant12 => String::from("12"), - Self::Variant13 => String::from("13"), - Self::Variant14 => String::from("14"), - Self::Variant15 => String::from("15"), - Self::Variant16 => String::from("16"), + Self::Free => String::from("0"), + Self::FamiliesAnnually2019 => String::from("1"), + Self::TeamsMonthly2019 => String::from("2"), + Self::TeamsAnnually2019 => String::from("3"), + Self::EnterpriseMonthly2019 => String::from("4"), + Self::EnterpriseAnnually2019 => String::from("5"), + Self::Custom => String::from("6"), + Self::FamiliesAnnually => String::from("7"), + Self::TeamsMonthly2020 => String::from("8"), + Self::TeamsAnnually2020 => String::from("9"), + Self::EnterpriseMonthly2020 => String::from("10"), + Self::EnterpriseAnnually2020 => String::from("11"), + Self::TeamsMonthly => String::from("12"), + Self::TeamsAnnually => String::from("13"), + Self::EnterpriseMonthly => String::from("14"), + Self::EnterpriseAnnually => String::from("15"), + Self::TeamsStarter => String::from("16"), } } } impl Default for PlanType { fn default() -> PlanType { - Self::Variant0 + Self::Free } } diff --git a/crates/bitwarden-api-api/src/models/policy_type.rs b/crates/bitwarden-api-api/src/models/policy_type.rs index dbb186a21..fc9e6ca63 100644 --- a/crates/bitwarden-api-api/src/models/policy_type.rs +++ b/crates/bitwarden-api-api/src/models/policy_type.rs @@ -14,41 +14,41 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PolicyType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, + TwoFactorAuthentication = 0, + MasterPassword = 1, + PasswordGenerator = 2, + SingleOrg = 3, + RequireSso = 4, + PersonalOwnership = 5, + DisableSend = 6, + SendOptions = 7, + ResetPassword = 8, + MaximumVaultTimeout = 9, + DisablePersonalVaultExport = 10, + ActivateAutofill = 11, } impl ToString for PolicyType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), + Self::TwoFactorAuthentication => String::from("0"), + Self::MasterPassword => String::from("1"), + Self::PasswordGenerator => String::from("2"), + Self::SingleOrg => String::from("3"), + Self::RequireSso => String::from("4"), + Self::PersonalOwnership => String::from("5"), + Self::DisableSend => String::from("6"), + Self::SendOptions => String::from("7"), + Self::ResetPassword => String::from("8"), + Self::MaximumVaultTimeout => String::from("9"), + Self::DisablePersonalVaultExport => String::from("10"), + Self::ActivateAutofill => String::from("11"), } } } impl Default for PolicyType { fn default() -> PolicyType { - Self::Variant0 + Self::TwoFactorAuthentication } } diff --git a/crates/bitwarden-api-api/src/models/product_type.rs b/crates/bitwarden-api-api/src/models/product_type.rs index aa4ebedc5..e60a9c57c 100644 --- a/crates/bitwarden-api-api/src/models/product_type.rs +++ b/crates/bitwarden-api-api/src/models/product_type.rs @@ -14,27 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProductType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Free = 0, + Families = 1, + Teams = 2, + Enterprise = 3, + TeamsStarter = 4, } impl ToString for ProductType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Free => String::from("0"), + Self::Families => String::from("1"), + Self::Teams => String::from("2"), + Self::Enterprise => String::from("3"), + Self::TeamsStarter => String::from("4"), } } } impl Default for ProductType { fn default() -> ProductType { - Self::Variant0 + Self::Free } } diff --git a/crates/bitwarden-api-api/src/models/provider_type.rs b/crates/bitwarden-api-api/src/models/provider_type.rs index 340210d32..f2d30a6cd 100644 --- a/crates/bitwarden-api-api/src/models/provider_type.rs +++ b/crates/bitwarden-api-api/src/models/provider_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProviderType { - Variant0 = 0, - Variant1 = 1, + Msp = 0, + Reseller = 1, } impl ToString for ProviderType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::Msp => String::from("0"), + Self::Reseller => String::from("1"), } } } impl Default for ProviderType { fn default() -> ProviderType { - Self::Variant0 + Self::Msp } } diff --git a/crates/bitwarden-api-api/src/models/provider_user_status_type.rs b/crates/bitwarden-api-api/src/models/provider_user_status_type.rs index 0918fe1d6..653dabbeb 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_status_type.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_status_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProviderUserStatusType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + Invited = 0, + Accepted = 1, + Confirmed = 2, } impl ToString for ProviderUserStatusType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::Invited => String::from("0"), + Self::Accepted => String::from("1"), + Self::Confirmed => String::from("2"), } } } impl Default for ProviderUserStatusType { fn default() -> ProviderUserStatusType { - Self::Variant0 + Self::Invited } } diff --git a/crates/bitwarden-api-api/src/models/provider_user_type.rs b/crates/bitwarden-api-api/src/models/provider_user_type.rs index 28b130f8d..c51a3b932 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_type.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProviderUserType { - Variant0 = 0, - Variant1 = 1, + ProviderAdmin = 0, + ServiceUser = 1, } impl ToString for ProviderUserType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::ProviderAdmin => String::from("0"), + Self::ServiceUser => String::from("1"), } } } impl Default for ProviderUserType { fn default() -> ProviderUserType { - Self::Variant0 + Self::ProviderAdmin } } diff --git a/crates/bitwarden-api-api/src/models/push_type.rs b/crates/bitwarden-api-api/src/models/push_type.rs index fe38f85a7..8e69b5a73 100644 --- a/crates/bitwarden-api-api/src/models/push_type.rs +++ b/crates/bitwarden-api-api/src/models/push_type.rs @@ -14,51 +14,51 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PushType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, - Variant12 = 12, - Variant13 = 13, - Variant14 = 14, - Variant15 = 15, - Variant16 = 16, + SyncCipherUpdate = 0, + SyncCipherCreate = 1, + SyncLoginDelete = 2, + SyncFolderDelete = 3, + SyncCiphers = 4, + SyncVault = 5, + SyncOrgKeys = 6, + SyncFolderCreate = 7, + SyncFolderUpdate = 8, + SyncCipherDelete = 9, + SyncSettings = 10, + LogOut = 11, + SyncSendCreate = 12, + SyncSendUpdate = 13, + SyncSendDelete = 14, + AuthRequest = 15, + AuthRequestResponse = 16, } impl ToString for PushType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), - Self::Variant12 => String::from("12"), - Self::Variant13 => String::from("13"), - Self::Variant14 => String::from("14"), - Self::Variant15 => String::from("15"), - Self::Variant16 => String::from("16"), + Self::SyncCipherUpdate => String::from("0"), + Self::SyncCipherCreate => String::from("1"), + Self::SyncLoginDelete => String::from("2"), + Self::SyncFolderDelete => String::from("3"), + Self::SyncCiphers => String::from("4"), + Self::SyncVault => String::from("5"), + Self::SyncOrgKeys => String::from("6"), + Self::SyncFolderCreate => String::from("7"), + Self::SyncFolderUpdate => String::from("8"), + Self::SyncCipherDelete => String::from("9"), + Self::SyncSettings => String::from("10"), + Self::LogOut => String::from("11"), + Self::SyncSendCreate => String::from("12"), + Self::SyncSendUpdate => String::from("13"), + Self::SyncSendDelete => String::from("14"), + Self::AuthRequest => String::from("15"), + Self::AuthRequestResponse => String::from("16"), } } } impl Default for PushType { fn default() -> PushType { - Self::Variant0 + Self::SyncCipherUpdate } } diff --git a/crates/bitwarden-api-api/src/models/saml2_binding_type.rs b/crates/bitwarden-api-api/src/models/saml2_binding_type.rs index 039309cad..e01b398cd 100644 --- a/crates/bitwarden-api-api/src/models/saml2_binding_type.rs +++ b/crates/bitwarden-api-api/src/models/saml2_binding_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum Saml2BindingType { - Variant1 = 1, - Variant2 = 2, + HttpRedirect = 1, + HttpPost = 2, } impl ToString for Saml2BindingType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::HttpRedirect => String::from("1"), + Self::HttpPost => String::from("2"), } } } impl Default for Saml2BindingType { fn default() -> Saml2BindingType { - Self::Variant1 + Self::HttpRedirect } } diff --git a/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs b/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs index 6399c7f9b..e8680e9a6 100644 --- a/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs +++ b/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs @@ -14,35 +14,35 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum Saml2NameIdFormat { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, + NotConfigured = 0, + Unspecified = 1, + EmailAddress = 2, + X509SubjectName = 3, + WindowsDomainQualifiedName = 4, + KerberosPrincipalName = 5, + EntityIdentifier = 6, + Persistent = 7, + Transient = 8, } impl ToString for Saml2NameIdFormat { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), + Self::NotConfigured => String::from("0"), + Self::Unspecified => String::from("1"), + Self::EmailAddress => String::from("2"), + Self::X509SubjectName => String::from("3"), + Self::WindowsDomainQualifiedName => String::from("4"), + Self::KerberosPrincipalName => String::from("5"), + Self::EntityIdentifier => String::from("6"), + Self::Persistent => String::from("7"), + Self::Transient => String::from("8"), } } } impl Default for Saml2NameIdFormat { fn default() -> Saml2NameIdFormat { - Self::Variant0 + Self::NotConfigured } } diff --git a/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs b/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs index 3b0668865..12be578aa 100644 --- a/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs +++ b/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum Saml2SigningBehavior { - Variant0 = 0, - Variant1 = 1, - Variant3 = 3, + IfIdpWantAuthnRequestsSigned = 0, + Always = 1, + Never = 3, } impl ToString for Saml2SigningBehavior { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant3 => String::from("3"), + Self::IfIdpWantAuthnRequestsSigned => String::from("0"), + Self::Always => String::from("1"), + Self::Never => String::from("3"), } } } impl Default for Saml2SigningBehavior { fn default() -> Saml2SigningBehavior { - Self::Variant0 + Self::IfIdpWantAuthnRequestsSigned } } diff --git a/crates/bitwarden-api-api/src/models/secure_note_type.rs b/crates/bitwarden-api-api/src/models/secure_note_type.rs index 9fd0a3158..dd8516f6e 100644 --- a/crates/bitwarden-api-api/src/models/secure_note_type.rs +++ b/crates/bitwarden-api-api/src/models/secure_note_type.rs @@ -14,19 +14,19 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum SecureNoteType { - Variant0 = 0, + Generic = 0, } impl ToString for SecureNoteType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), + Self::Generic => String::from("0"), } } } impl Default for SecureNoteType { fn default() -> SecureNoteType { - Self::Variant0 + Self::Generic } } diff --git a/crates/bitwarden-api-api/src/models/send_type.rs b/crates/bitwarden-api-api/src/models/send_type.rs index 5ea1c2504..6364c4af2 100644 --- a/crates/bitwarden-api-api/src/models/send_type.rs +++ b/crates/bitwarden-api-api/src/models/send_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum SendType { - Variant0 = 0, - Variant1 = 1, + Text = 0, + File = 1, } impl ToString for SendType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::Text => String::from("0"), + Self::File => String::from("1"), } } } impl Default for SendType { fn default() -> SendType { - Self::Variant0 + Self::Text } } diff --git a/crates/bitwarden-api-api/src/models/service_account_access_policies_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_access_policies_response_model.rs deleted file mode 100644 index 22db48178..000000000 --- a/crates/bitwarden-api-api/src/models/service_account_access_policies_response_model.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServiceAccountAccessPoliciesResponseModel { - #[serde(rename = "object", skip_serializing_if = "Option::is_none")] - pub object: Option, - #[serde(rename = "userAccessPolicies", skip_serializing_if = "Option::is_none")] - pub user_access_policies: - Option>, - #[serde( - rename = "groupAccessPolicies", - skip_serializing_if = "Option::is_none" - )] - pub group_access_policies: - Option>, -} - -impl ServiceAccountAccessPoliciesResponseModel { - pub fn new() -> ServiceAccountAccessPoliciesResponseModel { - ServiceAccountAccessPoliciesResponseModel { - object: None, - user_access_policies: None, - group_access_policies: None, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/service_account_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_response_model_list_response_model.rs deleted file mode 100644 index 41ad4c28a..000000000 --- a/crates/bitwarden-api-api/src/models/service_account_response_model_list_response_model.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServiceAccountResponseModelListResponseModel { - #[serde(rename = "object", skip_serializing_if = "Option::is_none")] - pub object: Option, - #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option>, - #[serde(rename = "continuationToken", skip_serializing_if = "Option::is_none")] - pub continuation_token: Option, -} - -impl ServiceAccountResponseModelListResponseModel { - pub fn new() -> ServiceAccountResponseModelListResponseModel { - ServiceAccountResponseModelListResponseModel { - object: None, - data: None, - continuation_token: None, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/sso_type.rs b/crates/bitwarden-api-api/src/models/sso_type.rs index 3e1aefa4d..9ff337676 100644 --- a/crates/bitwarden-api-api/src/models/sso_type.rs +++ b/crates/bitwarden-api-api/src/models/sso_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum SsoType { - Variant1 = 1, - Variant2 = 2, + OpenIdConnect = 1, + Saml2 = 2, } impl ToString for SsoType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::OpenIdConnect => String::from("1"), + Self::Saml2 => String::from("2"), } } } impl Default for SsoType { fn default() -> SsoType { - Self::Variant1 + Self::OpenIdConnect } } diff --git a/crates/bitwarden-api-api/src/models/transaction_type.rs b/crates/bitwarden-api-api/src/models/transaction_type.rs index c9cda7c76..1bb69ccbb 100644 --- a/crates/bitwarden-api-api/src/models/transaction_type.rs +++ b/crates/bitwarden-api-api/src/models/transaction_type.rs @@ -14,27 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum TransactionType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Charge = 0, + Credit = 1, + PromotionalCredit = 2, + ReferralCredit = 3, + Refund = 4, } impl ToString for TransactionType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Charge => String::from("0"), + Self::Credit => String::from("1"), + Self::PromotionalCredit => String::from("2"), + Self::ReferralCredit => String::from("3"), + Self::Refund => String::from("4"), } } } impl Default for TransactionType { fn default() -> TransactionType { - Self::Variant0 + Self::Charge } } diff --git a/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs b/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs index 00188f0fd..94d20ee2a 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs @@ -14,33 +14,33 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum TwoFactorProviderType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, + Authenticator = 0, + Email = 1, + Duo = 2, + YubiKey = 3, + U2f = 4, + Remember = 5, + OrganizationDuo = 6, + WebAuthn = 7, } impl ToString for TwoFactorProviderType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), + Self::Authenticator => String::from("0"), + Self::Email => String::from("1"), + Self::Duo => String::from("2"), + Self::YubiKey => String::from("3"), + Self::U2f => String::from("4"), + Self::Remember => String::from("5"), + Self::OrganizationDuo => String::from("6"), + Self::WebAuthn => String::from("7"), } } } impl Default for TwoFactorProviderType { fn default() -> TwoFactorProviderType { - Self::Variant0 + Self::Authenticator } } diff --git a/crates/bitwarden-api-api/src/models/uri_match_type.rs b/crates/bitwarden-api-api/src/models/uri_match_type.rs index f4ee450c1..6ccf82edb 100644 --- a/crates/bitwarden-api-api/src/models/uri_match_type.rs +++ b/crates/bitwarden-api-api/src/models/uri_match_type.rs @@ -14,29 +14,29 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum UriMatchType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, + Domain = 0, + Host = 1, + StartsWith = 2, + Exact = 3, + RegularExpression = 4, + Never = 5, } impl ToString for UriMatchType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), + Self::Domain => String::from("0"), + Self::Host => String::from("1"), + Self::StartsWith => String::from("2"), + Self::Exact => String::from("3"), + Self::RegularExpression => String::from("4"), + Self::Never => String::from("5"), } } } impl Default for UriMatchType { fn default() -> UriMatchType { - Self::Variant0 + Self::Domain } } diff --git a/crates/bitwarden-api-api/src/models/web_authn_prf_status.rs b/crates/bitwarden-api-api/src/models/web_authn_prf_status.rs index eb58bfdcc..074c402dc 100644 --- a/crates/bitwarden-api-api/src/models/web_authn_prf_status.rs +++ b/crates/bitwarden-api-api/src/models/web_authn_prf_status.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum WebAuthnPrfStatus { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + Enabled = 0, + Supported = 1, + Unsupported = 2, } impl ToString for WebAuthnPrfStatus { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::Enabled => String::from("0"), + Self::Supported => String::from("1"), + Self::Unsupported => String::from("2"), } } } impl Default for WebAuthnPrfStatus { fn default() -> WebAuthnPrfStatus { - Self::Variant0 + Self::Enabled } } diff --git a/crates/bitwarden-api-identity/src/models/kdf_type.rs b/crates/bitwarden-api-identity/src/models/kdf_type.rs index 4b6acaef8..733fba272 100644 --- a/crates/bitwarden-api-identity/src/models/kdf_type.rs +++ b/crates/bitwarden-api-identity/src/models/kdf_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum KdfType { - Variant0 = 0, - Variant1 = 1, + PBKDF2_SHA256 = 0, + Argon2id = 1, } impl ToString for KdfType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::PBKDF2_SHA256 => String::from("0"), + Self::Argon2id => String::from("1"), } } } impl Default for KdfType { fn default() -> KdfType { - Self::Variant0 + Self::PBKDF2_SHA256 } } diff --git a/crates/bitwarden/src/admin_console/policy.rs b/crates/bitwarden/src/admin_console/policy.rs index 9a4b0d16f..7e87b8623 100644 --- a/crates/bitwarden/src/admin_console/policy.rs +++ b/crates/bitwarden/src/admin_console/policy.rs @@ -53,20 +53,28 @@ impl TryFrom for Policy { impl From for PolicyType { fn from(policy_type: bitwarden_api_api::models::PolicyType) -> Self { match policy_type { - bitwarden_api_api::models::PolicyType::Variant0 => PolicyType::TwoFactorAuthentication, - bitwarden_api_api::models::PolicyType::Variant1 => PolicyType::MasterPassword, - bitwarden_api_api::models::PolicyType::Variant2 => PolicyType::PasswordGenerator, - bitwarden_api_api::models::PolicyType::Variant3 => PolicyType::SingleOrg, - bitwarden_api_api::models::PolicyType::Variant4 => PolicyType::RequireSso, - bitwarden_api_api::models::PolicyType::Variant5 => PolicyType::PersonalOwnership, - bitwarden_api_api::models::PolicyType::Variant6 => PolicyType::DisableSend, - bitwarden_api_api::models::PolicyType::Variant7 => PolicyType::SendOptions, - bitwarden_api_api::models::PolicyType::Variant8 => PolicyType::ResetPassword, - bitwarden_api_api::models::PolicyType::Variant9 => PolicyType::MaximumVaultTimeout, - bitwarden_api_api::models::PolicyType::Variant10 => { + bitwarden_api_api::models::PolicyType::TwoFactorAuthentication => { + PolicyType::TwoFactorAuthentication + } + bitwarden_api_api::models::PolicyType::MasterPassword => PolicyType::MasterPassword, + bitwarden_api_api::models::PolicyType::PasswordGenerator => { + PolicyType::PasswordGenerator + } + bitwarden_api_api::models::PolicyType::SingleOrg => PolicyType::SingleOrg, + bitwarden_api_api::models::PolicyType::RequireSso => PolicyType::RequireSso, + bitwarden_api_api::models::PolicyType::PersonalOwnership => { + PolicyType::PersonalOwnership + } + bitwarden_api_api::models::PolicyType::DisableSend => PolicyType::DisableSend, + bitwarden_api_api::models::PolicyType::SendOptions => PolicyType::SendOptions, + bitwarden_api_api::models::PolicyType::ResetPassword => PolicyType::ResetPassword, + bitwarden_api_api::models::PolicyType::MaximumVaultTimeout => { + PolicyType::MaximumVaultTimeout + } + bitwarden_api_api::models::PolicyType::DisablePersonalVaultExport => { PolicyType::DisablePersonalVaultExport } - bitwarden_api_api::models::PolicyType::Variant11 => PolicyType::ActivateAutofill, + bitwarden_api_api::models::PolicyType::ActivateAutofill => PolicyType::ActivateAutofill, } } } diff --git a/crates/bitwarden/src/auth/api/response/identity_success_response.rs b/crates/bitwarden/src/auth/api/response/identity_success_response.rs index e59f91b7b..fb59c1caa 100644 --- a/crates/bitwarden/src/auth/api/response/identity_success_response.rs +++ b/crates/bitwarden/src/auth/api/response/identity_success_response.rs @@ -53,7 +53,7 @@ mod test { private_key: Default::default(), key: Default::default(), two_factor_token: Default::default(), - kdf: KdfType::Variant0, + kdf: KdfType::default(), kdf_iterations: crate::util::default_pbkdf2_iterations(), reset_master_password: Default::default(), force_password_reset: Default::default(), diff --git a/crates/bitwarden/src/auth/login/auth_request.rs b/crates/bitwarden/src/auth/login/auth_request.rs index 30db06124..1d85c75d6 100644 --- a/crates/bitwarden/src/auth/login/auth_request.rs +++ b/crates/bitwarden/src/auth/login/auth_request.rs @@ -41,7 +41,7 @@ pub(crate) async fn send_new_auth_request( public_key: auth.public_key, device_identifier: device_identifier.clone(), access_code: auth.access_code.clone(), - r#type: AuthRequestType::Variant0, // AuthenticateAndUnlock + r#type: AuthRequestType::AuthenticateAndUnlock, }; let res = auth_requests_post(&config.api, Some(req)).await?; diff --git a/crates/bitwarden/src/auth/login/mod.rs b/crates/bitwarden/src/auth/login/mod.rs index a36d27ae9..53ea712cc 100644 --- a/crates/bitwarden/src/auth/login/mod.rs +++ b/crates/bitwarden/src/auth/login/mod.rs @@ -67,13 +67,13 @@ pub(crate) fn parse_prelogin(response: PreloginResponseModel) -> Result { let kdf = response.kdf.ok_or("KDF not found")?; Ok(match kdf { - KdfType::Variant0 => Kdf::PBKDF2 { + KdfType::PBKDF2_SHA256 => Kdf::PBKDF2 { iterations: response .kdf_iterations .and_then(|e| NonZeroU32::new(e as u32)) .unwrap_or_else(default_pbkdf2_iterations), }, - KdfType::Variant1 => Kdf::Argon2id { + KdfType::Argon2id => Kdf::Argon2id { iterations: response .kdf_iterations .and_then(|e| NonZeroU32::new(e as u32)) diff --git a/crates/bitwarden/src/auth/register.rs b/crates/bitwarden/src/auth/register.rs index 2b0c9503b..31b69c515 100644 --- a/crates/bitwarden/src/auth/register.rs +++ b/crates/bitwarden/src/auth/register.rs @@ -42,7 +42,7 @@ pub(super) async fn register(client: &mut Client, req: &RegisterRequest) -> Resu })), token: None, organization_user_id: None, - kdf: Some(bitwarden_api_identity::models::KdfType::Variant0), + kdf: Some(bitwarden_api_identity::models::KdfType::PBKDF2_SHA256), kdf_iterations: Some(default_pbkdf2_iterations().get() as i32), kdf_memory: None, kdf_parallelism: None, diff --git a/crates/bitwarden/src/vault/cipher/cipher.rs b/crates/bitwarden/src/vault/cipher/cipher.rs index bbd944871..9223462a1 100644 --- a/crates/bitwarden/src/vault/cipher/cipher.rs +++ b/crates/bitwarden/src/vault/cipher/cipher.rs @@ -385,10 +385,10 @@ impl TryFrom for Cipher { impl From for CipherType { fn from(t: bitwarden_api_api::models::CipherType) -> Self { match t { - bitwarden_api_api::models::CipherType::Variant1 => CipherType::Login, - bitwarden_api_api::models::CipherType::Variant2 => CipherType::SecureNote, - bitwarden_api_api::models::CipherType::Variant3 => CipherType::Card, - bitwarden_api_api::models::CipherType::Variant4 => CipherType::Identity, + bitwarden_api_api::models::CipherType::Login => CipherType::Login, + bitwarden_api_api::models::CipherType::SecureNote => CipherType::SecureNote, + bitwarden_api_api::models::CipherType::Card => CipherType::Card, + bitwarden_api_api::models::CipherType::Identity => CipherType::Identity, } } } @@ -396,8 +396,8 @@ impl From for CipherType { impl From for CipherRepromptType { fn from(t: bitwarden_api_api::models::CipherRepromptType) -> Self { match t { - bitwarden_api_api::models::CipherRepromptType::Variant0 => CipherRepromptType::None, - bitwarden_api_api::models::CipherRepromptType::Variant1 => CipherRepromptType::Password, + bitwarden_api_api::models::CipherRepromptType::None => CipherRepromptType::None, + bitwarden_api_api::models::CipherRepromptType::Password => CipherRepromptType::Password, } } } diff --git a/crates/bitwarden/src/vault/cipher/field.rs b/crates/bitwarden/src/vault/cipher/field.rs index bde713a05..25a318d6f 100644 --- a/crates/bitwarden/src/vault/cipher/field.rs +++ b/crates/bitwarden/src/vault/cipher/field.rs @@ -82,10 +82,10 @@ impl TryFrom for Field { impl From for FieldType { fn from(model: bitwarden_api_api::models::FieldType) -> Self { match model { - bitwarden_api_api::models::FieldType::Variant0 => FieldType::Text, - bitwarden_api_api::models::FieldType::Variant1 => FieldType::Hidden, - bitwarden_api_api::models::FieldType::Variant2 => FieldType::Boolean, - bitwarden_api_api::models::FieldType::Variant3 => FieldType::Linked, + bitwarden_api_api::models::FieldType::Text => FieldType::Text, + bitwarden_api_api::models::FieldType::Hidden => FieldType::Hidden, + bitwarden_api_api::models::FieldType::Boolean => FieldType::Boolean, + bitwarden_api_api::models::FieldType::Linked => FieldType::Linked, } } } diff --git a/crates/bitwarden/src/vault/cipher/login.rs b/crates/bitwarden/src/vault/cipher/login.rs index ea5b1f357..5e2156a83 100644 --- a/crates/bitwarden/src/vault/cipher/login.rs +++ b/crates/bitwarden/src/vault/cipher/login.rs @@ -143,12 +143,12 @@ impl TryFrom for LoginUri { impl From for UriMatchType { fn from(value: bitwarden_api_api::models::UriMatchType) -> Self { match value { - bitwarden_api_api::models::UriMatchType::Variant0 => Self::Domain, - bitwarden_api_api::models::UriMatchType::Variant1 => Self::Host, - bitwarden_api_api::models::UriMatchType::Variant2 => Self::StartsWith, - bitwarden_api_api::models::UriMatchType::Variant3 => Self::Exact, - bitwarden_api_api::models::UriMatchType::Variant4 => Self::RegularExpression, - bitwarden_api_api::models::UriMatchType::Variant5 => Self::Never, + bitwarden_api_api::models::UriMatchType::Domain => Self::Domain, + bitwarden_api_api::models::UriMatchType::Host => Self::Host, + bitwarden_api_api::models::UriMatchType::StartsWith => Self::StartsWith, + bitwarden_api_api::models::UriMatchType::Exact => Self::Exact, + bitwarden_api_api::models::UriMatchType::RegularExpression => Self::RegularExpression, + bitwarden_api_api::models::UriMatchType::Never => Self::Never, } } } diff --git a/crates/bitwarden/src/vault/cipher/secure_note.rs b/crates/bitwarden/src/vault/cipher/secure_note.rs index 2433a9c2a..eba4ea2fb 100644 --- a/crates/bitwarden/src/vault/cipher/secure_note.rs +++ b/crates/bitwarden/src/vault/cipher/secure_note.rs @@ -56,7 +56,7 @@ impl TryFrom for SecureNote { impl From for SecureNoteType { fn from(model: bitwarden_api_api::models::SecureNoteType) -> Self { match model { - bitwarden_api_api::models::SecureNoteType::Variant0 => SecureNoteType::Generic, + bitwarden_api_api::models::SecureNoteType::Generic => SecureNoteType::Generic, } } } diff --git a/crates/bitwarden/src/vault/send.rs b/crates/bitwarden/src/vault/send.rs index aba67e00c..144933899 100644 --- a/crates/bitwarden/src/vault/send.rs +++ b/crates/bitwarden/src/vault/send.rs @@ -329,8 +329,8 @@ impl TryFrom for Send { impl From for SendType { fn from(t: bitwarden_api_api::models::SendType) -> Self { match t { - bitwarden_api_api::models::SendType::Variant0 => SendType::Text, - bitwarden_api_api::models::SendType::Variant1 => SendType::File, + bitwarden_api_api::models::SendType::Text => SendType::Text, + bitwarden_api_api::models::SendType::File => SendType::File, } } } diff --git a/support/build-api.sh b/support/build-api.sh new file mode 100755 index 000000000..a668b5564 --- /dev/null +++ b/support/build-api.sh @@ -0,0 +1,26 @@ +# Delete old directory to ensure all files are updated +rm -rf crates/bitwarden-api-api/src + +# Generate new API bindings +npx openapi-generator-cli generate \ + -i ../server/api.json \ + -g rust \ + -o crates/bitwarden-api-api \ + --package-name bitwarden-api-api \ + -t ./support/openapi-template \ + --additional-properties=packageVersion=1.0.0 + +# Delete old directory to ensure all files are updated +rm -rf crates/bitwarden-api-identity/src + +# Generate new Identity bindings +npx openapi-generator-cli generate \ + -i ../server/identity.json \ + -g rust \ + -o crates/bitwarden-api-identity \ + --package-name bitwarden-api-identity \ + -t ./support/openapi-template \ + --additional-properties=packageVersion=1.0.0 + +cargo +nightly fmt +npm run prettier