bitwarden_core/client/
client_settings.rsuse schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, JsonSchema)]
#[serde(default, rename_all = "camelCase", deny_unknown_fields)]
#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
#[cfg_attr(
feature = "wasm",
derive(tsify_next::Tsify),
tsify(into_wasm_abi, from_wasm_abi)
)]
pub struct ClientSettings {
pub identity_url: String,
pub api_url: String,
pub user_agent: String,
pub device_type: DeviceType,
}
impl Default for ClientSettings {
fn default() -> Self {
Self {
identity_url: "https://identity.bitwarden.com".into(),
api_url: "https://api.bitwarden.com".into(),
user_agent: "Bitwarden Rust-SDK".into(),
device_type: DeviceType::SDK,
}
}
}
#[allow(non_camel_case_types)]
#[derive(Serialize, Deserialize, Copy, Clone, Debug, JsonSchema)]
#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]
#[cfg_attr(
feature = "wasm",
derive(tsify_next::Tsify),
tsify(into_wasm_abi, from_wasm_abi)
)]
pub enum DeviceType {
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,
}