Googlecalendar¶
flowtask.interfaces.GoogleCalendar
¶
GoogleCalendarClient
¶
Bases: GoogleClient, ABC
Google Calendar Client for managing calendar events.
check_event_start_time
async
¶
Check if the current time has reached or passed the event's start time and trigger an action if so.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_start_time
|
datetime
|
The start time of the event to check. |
required |
create_event
async
¶
Create an event in the specified Google Calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The ID of the calendar to add the event to. |
required |
event
|
dict
|
The event details. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict
|
Details of the created event. |
create_subscription
async
¶
Create a subscription to receive notifications when events are created, updated, or deleted in the calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
webhook_url
|
str
|
The webhook URL that will receive the notifications. |
required |
client_state
|
str
|
A client secret string for verifying notifications. |
'secret_string'
|
expiration_hours
|
int
|
Duration for which the subscription should be valid (maximum is 4230 minutes or 7 days). |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The response from Microsoft Graph API with subscription details. |
delete_event
async
¶
Delete an event from the specified calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The ID of the calendar. |
required |
event_id
|
str
|
The ID of the event to delete. |
required |
get_event
async
¶
Retrieve details of a specific event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The ID of the calendar. |
required |
event_id
|
str
|
The ID of the event. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict
|
Details of the event. |
list_events
async
¶
List events in a specified time range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The ID of the calendar to list events from. |
required |
time_min
|
datetime
|
Start time to retrieve events. |
required |
time_max
|
datetime
|
End time to retrieve events. |
required |
max_results
|
int
|
Maximum number of events to retrieve (default is 10). |
10
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
List[Dict]
|
List of events within the time range. |
setup_watch
async
¶
Sets up a watch on the specified calendar to receive notifications when events are created, updated, or deleted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The ID of the calendar to monitor. |
required |
webhook_url
|
str
|
The URL of the webhook endpoint to receive notifications. |
required |
channel_id
|
str
|
Unique ID for this notification channel. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict
|
The response from the Google Calendar API containing the channel information. |
update_event
async
¶
Update an existing event in the calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The ID of the calendar containing the event. |
required |
event_id
|
str
|
The ID of the event to update. |
required |
updated_event
|
dict
|
The updated event details. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict
|
Details of the updated event. |