struct
pub struct Google {
/* private fields */
}Google's APIs (Sheets, YouTube, Calendar, Places, Maps), with an API key or an OAuth access token.
Methods
with_key
pub fn with_key(api_key: &str) -> GoogleRequests authorised with an API key (for public data).
with_token
pub fn with_token(access_token: &str) -> GoogleRequests authorised with an OAuth access token (for a user's data).
get
pub fn get(&self, url: &str, params: &[(&str, &str)]) -> RequestA GET to any Google API URL, authorised.
sheet_values
pub fn sheet_values(&self, spreadsheet_id: &str, range: &str) -> RequestCell values of a range ("Sheet1!A1:D20", or a sheet name). The sheet must be shared "anyone with the link" for API-key access.
sheet_append
pub fn sheet_append(&self, spreadsheet_id: &str, range: &str, rows: &[Vec<String>]) -> RequestAppend rows to a sheet (OAuth token with the Sheets scope required).
youtube_search
pub fn youtube_search(&self, query: &str, max: usize) -> RequestYouTube videos matching query, at most max.
youtube_playlist
pub fn youtube_playlist(&self, playlist_id: &str, max: usize) -> RequestThe videos in a YouTube playlist, at most max.
youtube_videos
pub fn youtube_videos(&self, ids: &[&str]) -> RequestDetails of the YouTube videos with ids.
calendar_events
pub fn calendar_events(&self, calendar_id: &str, time_min: &str, max: usize) -> RequestUpcoming events of a (public) calendar, from time_min (RFC 3339).
places_search
pub fn places_search(&self, text: &str, max: usize) -> RequestPlaces API (New) text search: "coffee near Fitzroy".
maps_embed_url
pub fn maps_embed_url(&self, mode: &str, query: &str) -> StringA Maps Embed API URL for an iframe (mode: place, search, …).
static_map_url
pub fn static_map_url(&self, center: &str, zoom: u8, width: u32, height: u32, markers: &[&str]) -> StringA Maps Static API image URL.