Google workspace API client
This crate is an unofficial opinionated library that unifies the Google Workspace API clients. The current workspace crate landscape is highly fragmented, with each API employing a distinct approach. This library aims to provide a unified interface for all Google Workspace APIs.
Current supported APIs include: Google Tasks, Google Calendar, and Gmail.
Example
// If the last parameter is set to true the client
// will automatically refresh the access token if it expires
// The access token is retrieved by the Google auth callback
// See the axum_calendar_example.rs example for a full example
let new_client = new;
// Insert a task
match new
.insert_task
.set_task_title
.set_task_notes
.request
.await;
//Get a list of events from the primary calendar
let events = new
.get_events
.single_events
.event_type
.max_results
.order_by
//To avoid retrieving past events we set the time_min to now
.time_min
//Since we retrieve single events add all birthdays for the next year
.time_max
.request
.await
.unwrap;
Supported APIs
I'm currently working on the following APIs (more will be added soon):
Auth
- Get OAuth url
- Get Access token
- Refresh token
Calendar
For the API documentation, see the Calender API documentation.
The actions that are currently supported by this crate are:
Events (calendar API)
- Get
- List
- Patch
- Delete
Tasks
For the API documentation, see the Tasks API documentation.
The actions that are currently supported by this crate are:
Tasks
- Insert
- List
- Delete
- Patch
Tasklists
- Get
Gmail
For the API documentation, see the Gmail API documentation.
The actions that are currently supported by this crate are:
User messages (emails)
- Get
- List
- Delete
- Trash
- Untrash
Patch (tasks API)
- Complete a task
Features
To include the correct API client,
you need to define the feature in your Cargo.toml file:
= { "1.2", features = ["calendar", "tasks", "gmail"] }