#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[allow(non_camel_case_types, deprecated)]
pub enum Scopes {
Drive,
DriveAppdata,
DriveAppsReadonly,
DriveFile,
DriveMeetReadonly,
DriveMetadata,
DriveMetadataReadonly,
DrivePhotosReadonly,
DriveReadonly,
DriveScripts,
}
impl ::core::fmt::Display for Scopes {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
::std::write!(f, "{:?}", self)
}
}
impl ::core::str::FromStr for Scopes {
type Err = ::alloc::string::String;
fn from_str(s: &::core::primitive::str) -> ::core::result::Result<Self, Self::Err> {
match s {
"https://www.googleapis.com/auth/drive" => {
crate::StdResult::Ok(Scopes::Drive)
}
"https://www.googleapis.com/auth/drive.appdata" => {
crate::StdResult::Ok(Scopes::DriveAppdata)
}
"https://www.googleapis.com/auth/drive.apps.readonly" => {
crate::StdResult::Ok(Scopes::DriveAppsReadonly)
}
"https://www.googleapis.com/auth/drive.file" => {
crate::StdResult::Ok(Scopes::DriveFile)
}
"https://www.googleapis.com/auth/drive.meet.readonly" => {
crate::StdResult::Ok(Scopes::DriveMeetReadonly)
}
"https://www.googleapis.com/auth/drive.metadata" => {
crate::StdResult::Ok(Scopes::DriveMetadata)
}
"https://www.googleapis.com/auth/drive.metadata.readonly" => {
crate::StdResult::Ok(Scopes::DriveMetadataReadonly)
}
"https://www.googleapis.com/auth/drive.photos.readonly" => {
crate::StdResult::Ok(Scopes::DrivePhotosReadonly)
}
"https://www.googleapis.com/auth/drive.readonly" => {
crate::StdResult::Ok(Scopes::DriveReadonly)
}
"https://www.googleapis.com/auth/drive.scripts" => {
crate::StdResult::Ok(Scopes::DriveScripts)
}
_ => {
::core::result::Result::Err(
::alloc::format!("{s} is not a valid variant of {}", "Scopes"),
)
}
}
}
}
impl ::core::convert::AsRef<::core::primitive::str> for Scopes {
fn as_ref(&self) -> &::core::primitive::str {
match self {
Scopes::Drive => "https://www.googleapis.com/auth/drive",
Scopes::DriveAppdata => "https://www.googleapis.com/auth/drive.appdata",
Scopes::DriveAppsReadonly => {
"https://www.googleapis.com/auth/drive.apps.readonly"
}
Scopes::DriveFile => "https://www.googleapis.com/auth/drive.file",
Scopes::DriveMeetReadonly => {
"https://www.googleapis.com/auth/drive.meet.readonly"
}
Scopes::DriveMetadata => "https://www.googleapis.com/auth/drive.metadata",
Scopes::DriveMetadataReadonly => {
"https://www.googleapis.com/auth/drive.metadata.readonly"
}
Scopes::DrivePhotosReadonly => {
"https://www.googleapis.com/auth/drive.photos.readonly"
}
Scopes::DriveReadonly => "https://www.googleapis.com/auth/drive.readonly",
Scopes::DriveScripts => "https://www.googleapis.com/auth/drive.scripts",
}
}
}