Skip to content

calendars

Calendar dataclass

Class representation of a Nylas Calendar object.

Attributes:

Name Type Description
id str

Globally unique object identifier.

grant_id str

Grant ID representing the user's account.

name str

Name of the Calendar.

timezone str

IANA time zone database-formatted string (for example, "America/New_York").

read_only bool

If the event participants are able to edit the Event.

is_owned_by_user bool

If the Calendar is owned by the user account.

object str

The type of object.

description Optional[str]

Description of the Calendar.

location Optional[str]

Geographic location of the Calendar as free-form text.

hex_color Optional[str]

The background color of the calendar in the hexadecimal format (for example, "#0099EE"). If not defined, the default color is used.

hex_foreground_color Optional[str]

The background color of the calendar in the hexadecimal format (for example, "#0099EE"). If not defined, the default color is used (Google only).

is_primary Optional[bool]

If the Calendar is the account's primary calendar.

metadata Optional[Dict[str, Any]]

A list of key-value pairs storing additional data.

Source code in nylas/models/calendars.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@dataclass_json
@dataclass
class Calendar:
    """
    Class representation of a Nylas Calendar object.

    Attributes:
        id: Globally unique object identifier.
        grant_id: Grant ID representing the user's account.
        name: Name of the Calendar.
        timezone: IANA time zone database-formatted string (for example, "America/New_York").
        read_only: If the event participants are able to edit the Event.
        is_owned_by_user: If the Calendar is owned by the user account.
        object: The type of object.
        description: Description of the Calendar.
        location: Geographic location of the Calendar as free-form text.
        hex_color: The background color of the calendar in the hexadecimal format (for example, "#0099EE").
            If not defined, the default color is used.
        hex_foreground_color: The background color of the calendar in the hexadecimal format (for example, "#0099EE").
            If not defined, the default color is used (Google only).
        is_primary: If the Calendar is the account's primary calendar.
        metadata: A list of key-value pairs storing additional data.
    """

    id: str
    grant_id: str
    name: str
    timezone: str
    read_only: bool
    is_owned_by_user: bool
    object: str = "calendar"
    description: Optional[str] = None
    location: Optional[str] = None
    hex_color: Optional[str] = None
    hex_foreground_color: Optional[str] = None
    is_primary: Optional[bool] = None
    metadata: Optional[Dict[str, Any]] = None

CreateCalendarRequest

Bases: TypedDict

Interface of a Nylas create calendar request

Attributes:

Name Type Description
name str

Name of the Calendar.

description NotRequired[str]

Description of the calendar.

location NotRequired[str]

Geographic location of the calendar as free-form text.

timezone NotRequired[str]

IANA time zone database formatted string (e.g. America/New_York).

metadata NotRequired[Dict[str, str]]

A list of key-value pairs storing additional data.

Source code in nylas/models/calendars.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class CreateCalendarRequest(TypedDict):
    """
    Interface of a Nylas create calendar request

    Attributes:
        name: Name of the Calendar.
        description: Description of the calendar.
        location: Geographic location of the calendar as free-form text.
        timezone: IANA time zone database formatted string (e.g. America/New_York).
        metadata: A list of key-value pairs storing additional data.
    """

    name: str
    description: NotRequired[str]
    location: NotRequired[str]
    timezone: NotRequired[str]
    metadata: NotRequired[Dict[str, str]]

ListCalendersQueryParams

Bases: ListQueryParams

Interface of the query parameters for listing calendars.

Attributes:

Name Type Description
limit NotRequired[int]

The maximum number of objects to return. This field defaults to 50. The maximum allowed value is 200.

page_token NotRequired[str]

An identifier that specifies which page of data to return. This value should be taken from a ListResponse object's next_cursor parameter.

metadata_pair NotRequired[Dict[str, str]]

Pass in your metadata key-value pair to search for metadata.

Source code in nylas/models/calendars.py
49
50
51
52
53
54
55
56
57
58
59
60
61
class ListCalendersQueryParams(ListQueryParams):
    """
    Interface of the query parameters for listing calendars.

    Attributes:
        limit (NotRequired[int]): The maximum number of objects to return.
            This field defaults to 50. The maximum allowed value is 200.
        page_token (NotRequired[str]): An identifier that specifies which page of data to return.
            This value should be taken from a ListResponse object's next_cursor parameter.
        metadata_pair: Pass in your metadata key-value pair to search for metadata.
    """

    metadata_pair: NotRequired[Dict[str, str]]

UpdateCalendarRequest

Bases: CreateCalendarRequest

Interface of a Nylas update calendar request

Attributes:

Name Type Description
hexColor NotRequired[str]

The background color of the calendar in the hexadecimal format (e.g. #0099EE). Empty indicates default color.

hexForegroundColor NotRequired[str]

The background color of the calendar in the hexadecimal format (e.g. #0099EE). Empty indicates default color. (Google only)

Source code in nylas/models/calendars.py
83
84
85
86
87
88
89
90
91
92
93
94
95
class UpdateCalendarRequest(CreateCalendarRequest):
    """
    Interface of a Nylas update calendar request

    Attributes:
        hexColor: The background color of the calendar in the hexadecimal format (e.g. #0099EE).
            Empty indicates default color.
        hexForegroundColor: The background color of the calendar in the hexadecimal format (e.g. #0099EE).
            Empty indicates default color. (Google only)
    """

    hexColor: NotRequired[str]
    hexForegroundColor: NotRequired[str]