Skip to content

Commit

Permalink
Update bindings with enum names
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Feb 8, 2024
1 parent 9399346 commit 091275b
Show file tree
Hide file tree
Showing 43 changed files with 768 additions and 846 deletions.
50 changes: 25 additions & 25 deletions crates/bitwarden-api-api/src/models/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
14 changes: 7 additions & 7 deletions crates/bitwarden-api-api/src/models/auth_request_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
10 changes: 5 additions & 5 deletions crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
18 changes: 9 additions & 9 deletions crates/bitwarden-api-api/src/models/cipher_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
106 changes: 53 additions & 53 deletions crates/bitwarden-api-api/src/models/device_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
22 changes: 11 additions & 11 deletions crates/bitwarden-api-api/src/models/emergency_access_status_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
10 changes: 5 additions & 5 deletions crates/bitwarden-api-api/src/models/emergency_access_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
10 changes: 5 additions & 5 deletions crates/bitwarden-api-api/src/models/event_system_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Loading

0 comments on commit 091275b

Please sign in to comment.