pub async fn list_calendars(&self) -> Result<Vec<Calendar>, APIError> {
        // Build the request.
        let request = self.request(CALENDAR_ENDPOINT, Method::GET, "users/me/calendarList", (), Some(&[("maxResults", "250")]));

        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                });
            }
        };

        // Try to deserialize the response.
        let value: Calendars = resp.json().await.unwrap();

        Ok(value.items)
    }
/// List calendars for a user.
List calendars for a user.
List calendars for a user .
pub async fn list_calendars(&self) -> Result<Vec<Calendar>, APIError> {
        // Build the request.
        let request = self.request(CALENDAR_ENDPOINT, Method::GET, "users/me/calendarList", (), Some(&[("maxResults", "250")]));
        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                });
            }
        };
        // Try to deserialize the response.
        let value: Calendars = resp.json().await.unwrap();
        Ok(value.items)
    }
pub async fn list_calendars ( & self ) -> Result < Vec < Calendar > , APIError > { // Build the request. let request = self . request ( CALENDAR_ENDPOINT , Method :: GET , " " , ( ) , Some ( & [ ( " " , " " ) ] ) ) ; let resp = self . client . execute ( request ) . await . unwrap ( ) ; match resp . status ( ) { StatusCode :: OK => ( ) , s => { return Err ( APIError { status_code : s , body : resp . text ( ) . await . unwrap ( ) , } ) ; } } ; // Try to deserialize the response. let value : Calendars = resp . json ( ) . await . unwrap ( ) ; Ok ( value . items ) }
List calendars for a user.
List calendars for a user .
&self
&self