Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.
Close httplib2 connections.
Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.
Returns metadata for a calendar.
Creates a secondary calendar.
Updates metadata for a calendar. This method supports patch semantics.
transferOwnership(calendarId, newDataOwner, useAdminAccess)
Transfers a secondary calendar between users within a Google Workspace organization. Requires user authentication with Manage Calendars administrator privilege, and one of the following authorization scopes:
Updates metadata for a calendar.
clear(calendarId)
Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. Args: calendarId: string, Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. (required)
close()
Close httplib2 connections.
delete(calendarId)
Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. Args: calendarId: string, Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. (required)
get(calendarId)
Returns metadata for a calendar.
Args:
calendarId: string, Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. (required)
Returns:
An object of the form:
{
"autoAcceptInvitations": True or False, # Whether this calendar automatically accepts invitations. Only valid for resource calendars.
"conferenceProperties": { # Conferencing properties for this calendar, for example what types of conferences are allowed.
"allowedConferenceSolutionTypes": [ # The types of conference solutions that are supported for this calendar.
# The possible values are:
# - "eventHangout"
# - "eventNamedHangout"
# - "hangoutsMeet" Optional.
"A String",
],
},
"dataOwner": "A String", # The email of the owner of the calendar. Set only for secondary calendars. Read-only.
"description": "A String", # Description of the calendar. Optional.
"etag": "A String", # ETag of the resource.
"id": "A String", # Identifier of the calendar. To retrieve IDs call the calendarList.list() method.
"kind": "calendar#calendar", # Type of the resource ("calendar#calendar").
"labelProperties": { # Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged.
"eventLabels": [ # Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels.
# Extend the list to add a new event label, and remove entities from the list to delete a label from calendar.
# Each calendar can have a maximum of 200 labels.
{
"backgroundColor": "A String", # Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required.
"id": "A String", # The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label.
# If provided, the ID must be unique within the calendar and follow UUID format.
"name": "A String", # Name of the label. Optional.
# If provided this must have at most 50 characters.
},
],
},
"location": "A String", # Geographic location of the calendar as free-form text. Optional.
"summary": "A String", # Title of the calendar.
"timeZone": "A String", # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional.
}
insert(body=None)
Creates a secondary calendar.
The authenticated user for the request is made the data owner of the new calendar.
Note: We recommend to authenticate as the intended data owner of the calendar. You can use domain-wide delegation of authority to allow applications to act on behalf of a specific user. Don't use a service account for authentication. If you use a service account for authentication, the service account is the data owner, which can lead to unexpected behavior. For example, if a service account is the data owner, data ownership cannot be transferred.
Args:
body: object, The request body.
The object takes the form of:
{
"autoAcceptInvitations": True or False, # Whether this calendar automatically accepts invitations. Only valid for resource calendars.
"conferenceProperties": { # Conferencing properties for this calendar, for example what types of conferences are allowed.
"allowedConferenceSolutionTypes": [ # The types of conference solutions that are supported for this calendar.
# The possible values are:
# - "eventHangout"
# - "eventNamedHangout"
# - "hangoutsMeet" Optional.
"A String",
],
},
"dataOwner": "A String", # The email of the owner of the calendar. Set only for secondary calendars. Read-only.
"description": "A String", # Description of the calendar. Optional.
"etag": "A String", # ETag of the resource.
"id": "A String", # Identifier of the calendar. To retrieve IDs call the calendarList.list() method.
"kind": "calendar#calendar", # Type of the resource ("calendar#calendar").
"labelProperties": { # Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged.
"eventLabels": [ # Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels.
# Extend the list to add a new event label, and remove entities from the list to delete a label from calendar.
# Each calendar can have a maximum of 200 labels.
{
"backgroundColor": "A String", # Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required.
"id": "A String", # The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label.
# If provided, the ID must be unique within the calendar and follow UUID format.
"name": "A String", # Name of the label. Optional.
# If provided this must have at most 50 characters.
},
],
},
"location": "A String", # Geographic location of the calendar as free-form text. Optional.
"summary": "A String", # Title of the calendar.
"timeZone": "A String", # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional.
}
Returns:
An object of the form:
{
"autoAcceptInvitations": True or False, # Whether this calendar automatically accepts invitations. Only valid for resource calendars.
"conferenceProperties": { # Conferencing properties for this calendar, for example what types of conferences are allowed.
"allowedConferenceSolutionTypes": [ # The types of conference solutions that are supported for this calendar.
# The possible values are:
# - "eventHangout"
# - "eventNamedHangout"
# - "hangoutsMeet" Optional.
"A String",
],
},
"dataOwner": "A String", # The email of the owner of the calendar. Set only for secondary calendars. Read-only.
"description": "A String", # Description of the calendar. Optional.
"etag": "A String", # ETag of the resource.
"id": "A String", # Identifier of the calendar. To retrieve IDs call the calendarList.list() method.
"kind": "calendar#calendar", # Type of the resource ("calendar#calendar").
"labelProperties": { # Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged.
"eventLabels": [ # Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels.
# Extend the list to add a new event label, and remove entities from the list to delete a label from calendar.
# Each calendar can have a maximum of 200 labels.
{
"backgroundColor": "A String", # Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required.
"id": "A String", # The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label.
# If provided, the ID must be unique within the calendar and follow UUID format.
"name": "A String", # Name of the label. Optional.
# If provided this must have at most 50 characters.
},
],
},
"location": "A String", # Geographic location of the calendar as free-form text. Optional.
"summary": "A String", # Title of the calendar.
"timeZone": "A String", # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional.
}
patch(calendarId, body=None)
Updates metadata for a calendar. This method supports patch semantics.
Args:
calendarId: string, Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. (required)
body: object, The request body.
The object takes the form of:
{
"autoAcceptInvitations": True or False, # Whether this calendar automatically accepts invitations. Only valid for resource calendars.
"conferenceProperties": { # Conferencing properties for this calendar, for example what types of conferences are allowed.
"allowedConferenceSolutionTypes": [ # The types of conference solutions that are supported for this calendar.
# The possible values are:
# - "eventHangout"
# - "eventNamedHangout"
# - "hangoutsMeet" Optional.
"A String",
],
},
"dataOwner": "A String", # The email of the owner of the calendar. Set only for secondary calendars. Read-only.
"description": "A String", # Description of the calendar. Optional.
"etag": "A String", # ETag of the resource.
"id": "A String", # Identifier of the calendar. To retrieve IDs call the calendarList.list() method.
"kind": "calendar#calendar", # Type of the resource ("calendar#calendar").
"labelProperties": { # Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged.
"eventLabels": [ # Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels.
# Extend the list to add a new event label, and remove entities from the list to delete a label from calendar.
# Each calendar can have a maximum of 200 labels.
{
"backgroundColor": "A String", # Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required.
"id": "A String", # The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label.
# If provided, the ID must be unique within the calendar and follow UUID format.
"name": "A String", # Name of the label. Optional.
# If provided this must have at most 50 characters.
},
],
},
"location": "A String", # Geographic location of the calendar as free-form text. Optional.
"summary": "A String", # Title of the calendar.
"timeZone": "A String", # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional.
}
Returns:
An object of the form:
{
"autoAcceptInvitations": True or False, # Whether this calendar automatically accepts invitations. Only valid for resource calendars.
"conferenceProperties": { # Conferencing properties for this calendar, for example what types of conferences are allowed.
"allowedConferenceSolutionTypes": [ # The types of conference solutions that are supported for this calendar.
# The possible values are:
# - "eventHangout"
# - "eventNamedHangout"
# - "hangoutsMeet" Optional.
"A String",
],
},
"dataOwner": "A String", # The email of the owner of the calendar. Set only for secondary calendars. Read-only.
"description": "A String", # Description of the calendar. Optional.
"etag": "A String", # ETag of the resource.
"id": "A String", # Identifier of the calendar. To retrieve IDs call the calendarList.list() method.
"kind": "calendar#calendar", # Type of the resource ("calendar#calendar").
"labelProperties": { # Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged.
"eventLabels": [ # Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels.
# Extend the list to add a new event label, and remove entities from the list to delete a label from calendar.
# Each calendar can have a maximum of 200 labels.
{
"backgroundColor": "A String", # Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required.
"id": "A String", # The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label.
# If provided, the ID must be unique within the calendar and follow UUID format.
"name": "A String", # Name of the label. Optional.
# If provided this must have at most 50 characters.
},
],
},
"location": "A String", # Geographic location of the calendar as free-form text. Optional.
"summary": "A String", # Title of the calendar.
"timeZone": "A String", # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional.
}
transferOwnership(calendarId, newDataOwner, useAdminAccess)
Transfers a secondary calendar between users within a Google Workspace organization. Requires user authentication with Manage Calendars administrator privilege, and one of the following authorization scopes: - https://www.googleapis.com/auth/calendar - https://www.googleapis.com/auth/calendar.calendars In the request, set useAdminAccess to true. The secondary calendar must be active to be transferred. Transferring disabled or deleted calendars isn't supported. Args: calendarId: string, Calendar identifier. To retrieve calendar IDs, call the calendarList.list method. (required) newDataOwner: string, The email address of a user who will become the data owner of the calendar. (required) useAdminAccess: boolean, When true, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the Manage Calendars privilege. This method currently only supports admin access, thus only true is accepted for this field. (required)
update(calendarId, body=None)
Updates metadata for a calendar.
Args:
calendarId: string, Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. (required)
body: object, The request body.
The object takes the form of:
{
"autoAcceptInvitations": True or False, # Whether this calendar automatically accepts invitations. Only valid for resource calendars.
"conferenceProperties": { # Conferencing properties for this calendar, for example what types of conferences are allowed.
"allowedConferenceSolutionTypes": [ # The types of conference solutions that are supported for this calendar.
# The possible values are:
# - "eventHangout"
# - "eventNamedHangout"
# - "hangoutsMeet" Optional.
"A String",
],
},
"dataOwner": "A String", # The email of the owner of the calendar. Set only for secondary calendars. Read-only.
"description": "A String", # Description of the calendar. Optional.
"etag": "A String", # ETag of the resource.
"id": "A String", # Identifier of the calendar. To retrieve IDs call the calendarList.list() method.
"kind": "calendar#calendar", # Type of the resource ("calendar#calendar").
"labelProperties": { # Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged.
"eventLabels": [ # Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels.
# Extend the list to add a new event label, and remove entities from the list to delete a label from calendar.
# Each calendar can have a maximum of 200 labels.
{
"backgroundColor": "A String", # Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required.
"id": "A String", # The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label.
# If provided, the ID must be unique within the calendar and follow UUID format.
"name": "A String", # Name of the label. Optional.
# If provided this must have at most 50 characters.
},
],
},
"location": "A String", # Geographic location of the calendar as free-form text. Optional.
"summary": "A String", # Title of the calendar.
"timeZone": "A String", # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional.
}
Returns:
An object of the form:
{
"autoAcceptInvitations": True or False, # Whether this calendar automatically accepts invitations. Only valid for resource calendars.
"conferenceProperties": { # Conferencing properties for this calendar, for example what types of conferences are allowed.
"allowedConferenceSolutionTypes": [ # The types of conference solutions that are supported for this calendar.
# The possible values are:
# - "eventHangout"
# - "eventNamedHangout"
# - "hangoutsMeet" Optional.
"A String",
],
},
"dataOwner": "A String", # The email of the owner of the calendar. Set only for secondary calendars. Read-only.
"description": "A String", # Description of the calendar. Optional.
"etag": "A String", # ETag of the resource.
"id": "A String", # Identifier of the calendar. To retrieve IDs call the calendarList.list() method.
"kind": "calendar#calendar", # Type of the resource ("calendar#calendar").
"labelProperties": { # Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged.
"eventLabels": [ # Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels.
# Extend the list to add a new event label, and remove entities from the list to delete a label from calendar.
# Each calendar can have a maximum of 200 labels.
{
"backgroundColor": "A String", # Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required.
"id": "A String", # The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label.
# If provided, the ID must be unique within the calendar and follow UUID format.
"name": "A String", # Name of the label. Optional.
# If provided this must have at most 50 characters.
},
],
},
"location": "A String", # Geographic location of the calendar as free-form text. Optional.
"summary": "A String", # Title of the calendar.
"timeZone": "A String", # The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional.
}