1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#![warn(clippy::all)]
#![warn(rust_2018_idioms)]
#[macro_use(Deserialize, Serialize)]
extern crate serde;
#[cfg(feature = "v1")]
mod v1;
#[cfg(feature = "v1")]
pub use crate::v1::*;
pub mod error;
mod response;
pub mod signed_url;
pub mod signing;
pub mod types;
pub mod util;
pub use http;
pub use error::Error;
pub use response::{ApiResponse, Response};
pub use types::{BucketName, ObjectId, ObjectName};
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Scopes {
ReadOnly,
ReadWrite,
FullControl,
CloudPlatformReadOnly,
CloudPlatform,
}
impl AsRef<str> for Scopes {
fn as_ref(&self) -> &str {
match *self {
Scopes::ReadOnly => "https://www.googleapis.com/auth/devstorage.read_only",
Scopes::ReadWrite => "https://www.googleapis.com/auth/devstorage.read_write",
Scopes::FullControl => "https://www.googleapis.com/auth/devstorage.full_control",
Scopes::CloudPlatformReadOnly => {
"https://www.googleapis.com/auth/cloud-platform.read-only"
}
Scopes::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
}
}
}