> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.toolkits.google calendar toolkit

<a id="camel.toolkits.google_calendar_toolkit" />

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit" />

## GoogleCalendarToolkit

```python theme={"system"}
class GoogleCalendarToolkit(BaseToolkit):
```

A class representing a toolkit for Google Calendar operations.

This class provides methods for creating events, retrieving events,
updating events, and deleting events from a Google Calendar.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit.__init__" />

### **init**

```python theme={"system"}
def __init__(self, timeout: Optional[float] = None):
```

Initializes a new instance of the GoogleCalendarToolkit class.

**Parameters:**

* **timeout** (Optional\[float]): The timeout value for API requests in seconds. If None, no timeout is applied. (default: :obj:`None`)

**Note:**

Before using this toolkit, make sure to:

1. Set the required environment variables: GOOGLE\_CLIENT\_ID and
   GOOGLE\_CLIENT\_SECRET
2. Configure the redirect URI in Google Cloud Console to
   [http://localhost/](http://localhost/)

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit.create_event" />

### create\_event

```python theme={"system"}
def create_event(
    self,
    event_title: str,
    start_time: str,
    end_time: str,
    description: str = '',
    location: str = '',
    attendees_email: Optional[List[str]] = None,
    timezone: str = 'UTC'
):
```

Creates an event in the user's primary Google Calendar.

**Parameters:**

* **event\_title** (str): Title of the event.
* **start\_time** (str): Start time in ISO format (YYYY-MM-DDTHH:MM:SS).
* **end\_time** (str): End time in ISO format (YYYY-MM-DDTHH:MM:SS).
* **description** (str, optional): Description of the event.
* **location** (str, optional): Location of the event.
* **attendees\_email** (List\[str], optional): List of email addresses. (default: :obj:`None`)
* **timezone** (str, optional): Timezone for the event. (default: :obj:`UTC`)

**Returns:**

dict: A dictionary containing details of the created event.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit.get_events" />

### get\_events

```python theme={"system"}
def get_events(self, max_results: int = 10, time_min: Optional[str] = None):
```

Retrieves upcoming events from the user's primary Google Calendar.

**Parameters:**

* **max\_results** (int, optional): Maximum number of events to retrieve. (default: :obj:`10`)
* **time\_min** (str, optional): The minimum time to fetch events from. If not provided, defaults to the current time. (default: :obj:`None`)

**Returns:**

Union\[List\[Dict\[str, Any]], Dict\[str, Any]]: A list of
dictionaries, each containing details of an event, or a
dictionary with an error message.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit.update_event" />

### update\_event

```python theme={"system"}
def update_event(
    self,
    event_id: str,
    event_title: Optional[str] = None,
    start_time: Optional[str] = None,
    end_time: Optional[str] = None,
    description: Optional[str] = None,
    location: Optional[str] = None,
    attendees_email: Optional[List[str]] = None
):
```

Updates an existing event in the user's primary Google Calendar.

**Parameters:**

* **event\_id** (str): The ID of the event to update.
* **event\_title** (Optional\[str]): New title of the event. (default: :obj:`None`)
* **start\_time** (Optional\[str]): New start time in ISO format (YYYY-MM-DDTHH:MM:SSZ). (default: :obj:`None`)
* **end\_time** (Optional\[str]): New end time in ISO format (YYYY-MM-DDTHH:MM:SSZ). (default: :obj:`None`)
* **description** (Optional\[str]): New description of the event. (default: :obj:`None`)
* **location** (Optional\[str]): New location of the event. (default: :obj:`None`)
* **attendees\_email** (Optional\[List\[str]]): List of email addresses. (default: :obj:`None`)

**Returns:**

Dict\[str, Any]: A dictionary containing details of the updated
event.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit.delete_event" />

### delete\_event

```python theme={"system"}
def delete_event(self, event_id: str):
```

Deletes an event from the user's primary Google Calendar.

**Parameters:**

* **event\_id** (str): The ID of the event to delete.

**Returns:**

str: A message indicating the result of the deletion.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit.get_calendar_details" />

### get\_calendar\_details

```python theme={"system"}
def get_calendar_details(self):
```

**Returns:**

dict: A dictionary containing details about the calendar.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit._get_calendar_service" />

### \_get\_calendar\_service

```python theme={"system"}
def _get_calendar_service(self):
```

**Returns:**

Resource: A Google Calendar API service object.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit._authenticate" />

### \_authenticate

```python theme={"system"}
def _authenticate(self):
```

**Returns:**

Credentials: A Google OAuth2 credentials object.

<a id="camel.toolkits.google_calendar_toolkit.GoogleCalendarToolkit.get_tools" />

### get\_tools

```python theme={"system"}
def get_tools(self):
```

**Returns:**

List\[FunctionTool]: A list of FunctionTool objects
representing the functions in the toolkit.
