-
Hey there, I'm failing to fetch some events from my calendar. The error is It happens only when using Here's my code. My usage seems pretty vanilla, what am I doing wrong? use google_calendar3::Error;
use google_calendar3::{api::Scope, CalendarHub};
pub async fn fetch_events() -> () {
let secret = yup_oauth2::read_application_secret(std::path::Path::new("./secret.json"))
.await
.expect("./secret.json");
let auth = yup_oauth2::DeviceFlowAuthenticator::builder(secret)
.build()
.await
.unwrap();
let hub = CalendarHub::new(
hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()),
auth,
);
let result = hub
.events()
.list("primary")
.add_scope(Scope::EventReadonly)
.doit()
.await;
match result {
Err(e) => match e {
Error::HttpError(_)
| Error::Io(_)
| Error::MissingAPIKey
| Error::MissingToken(_)
| Error::Cancelled
| Error::UploadSizeLimitExceeded(_, _)
| Error::Failure(_)
| Error::BadRequest(_)
| Error::FieldClash(_)
| Error::JsonDecodeError(_, _) => println!("{}", e),
},
Ok(res) => println!("Success: {:?}", res),
}
} Thank you very much for your time and this library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Admittedly I have absolutely no idea, the way Google flows work is beyond me unfortunately. The one who might be able to help is the maintainer of yup-oauth2 - I do recommend asking the general question there. |
Beta Was this translation helpful? Give feedback.
Admittedly I have absolutely no idea, the way Google flows work is beyond me unfortunately. The one who might be able to help is the maintainer of yup-oauth2 - I do recommend asking the general question there.