|
38 | 38 | //! |
39 | 39 | //! Login into a new session async: |
40 | 40 | //! ``` |
41 | | -//! use proton_api_rs::{http, Session, SessionType}; |
| 41 | +//! use proton_api_rs::{http, DefaultSession, SessionType}; |
42 | 42 | //! async fn example<T:http::ClientAsync>() { |
43 | 43 | //! let client = http::ClientBuilder::new() |
44 | 44 | //! .user_agent("MyUserAgent/0.0.0") |
45 | 45 | //! .base_url("server_url") |
46 | 46 | //! .app_version("MyApp@0.1.1") |
47 | 47 | //! .build::<T>().unwrap(); |
48 | 48 | //! |
49 | | -//! let session = match Session::login_async(&client, "my_address@proton.me", "my_proton_password").await.unwrap(){ |
| 49 | +//! let session = match DefaultSession::login_async(&client, "my_address@proton.me", "my_proton_password").await.unwrap(){ |
50 | 50 | //! // Session is authenticated, no 2FA verifications necessary. |
51 | 51 | //! SessionType::Authenticated(c) => c, |
52 | 52 | //! // Session needs 2FA TOTP auth. |
|
64 | 64 | //! |
65 | 65 | //! Login into a new session sync: |
66 | 66 | //! ``` |
67 | | -//! use proton_api_rs::{http, Session, SessionType}; |
| 67 | +//! use proton_api_rs::{DefaultSession, http, Session, SessionType}; |
68 | 68 | //! fn example<T:http::ClientSync>() { |
69 | 69 | //! let client = http::ClientBuilder::new() |
70 | 70 | //! .user_agent("MyUserAgent/0.0.0") |
71 | 71 | //! .base_url("server_url") |
72 | 72 | //! .app_version("MyApp@0.1.1") |
73 | 73 | //! .build::<T>().unwrap(); |
74 | 74 | //! |
75 | | -//! let session = match Session::login(&client, "my_address@proton.me", "my_proton_password").unwrap(){ |
| 75 | +//! let session = match DefaultSession::login(&client, "my_address@proton.me", "my_proton_password").unwrap(){ |
76 | 76 | //! // Session is authenticated, no 2FA verifications necessary. |
77 | 77 | //! SessionType::Authenticated(c) => c, |
78 | 78 | //! // Session needs 2FA TOTP auth. |
|
90 | 90 | //! |
91 | 91 | //! Login using a previous sessions token. |
92 | 92 | //! ``` |
93 | | -//! use proton_api_rs::{http, Session, SessionType}; |
| 93 | +//! use proton_api_rs::{http, DefaultSession, SessionType}; |
94 | 94 | //! use proton_api_rs::domain::UserUid; |
95 | 95 | //! |
96 | 96 | //! async fn example<T:http::ClientAsync>() { |
|
102 | 102 | //! .app_version("MyApp@0.1.1") |
103 | 103 | //! .build::<T>().unwrap(); |
104 | 104 | //! |
105 | | -//! let session = Session::refresh_async(&client, &user_uid, &user_refresh_token).await.unwrap(); |
| 105 | +//! let session = DefaultSession::refresh_async(&client, &user_uid, &user_refresh_token).await.unwrap(); |
106 | 106 | //! |
107 | 107 | //! // session is now authenticated and can access the rest of the API. |
108 | 108 | //! // ... |
|
0 commit comments