Skip to content

folders

CreateFolderRequest

Bases: TypedDict

Class representation of the Nylas folder creation request.

Attributes:

Name Type Description
name str

The name of the folder.

parent_id NotRequired[str]

The parent ID of the folder. (Microsoft only)

background_color NotRequired[str]

The background color of the folder. (Google only)

text_color NotRequired[str]

The text color of the folder. (Google only)

Source code in nylas/models/folders.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class CreateFolderRequest(TypedDict):
    """
    Class representation of the Nylas folder creation request.

    Attributes:
        name: The name of the folder.
        parent_id: The parent ID of the folder. (Microsoft only)
        background_color: The background color of the folder. (Google only)
        text_color: The text color of the folder. (Google only)
    """

    name: str
    parent_id: NotRequired[str]
    background_color: NotRequired[str]
    text_color: NotRequired[str]

Folder dataclass

Class representing a Nylas folder.

Attributes:

Name Type Description
id str

A globally unique object identifier.

grant_id str

A Grant ID of the Nylas account.

name str

Folder name

object str

The type of object.

parent_id Optional[str]

ID of the parent folder. (Microsoft only)

background_color Optional[str]

Folder background color. (Google only)

text_color Optional[str]

Folder text color. (Google only)

system_folder Optional[bool]

Indicates if the folder is user created or system created. (Google Only)

child_count Optional[int]

The number of immediate child folders in the current folder. (Microsoft only)

unread_count Optional[int]

The number of unread items inside of a folder.

total_count Optional[int]

The number of items inside of a folder.

attributes Optional[str]

Common attribute descriptors shared by system folders across providers. For example, Sent email folders have the ["\Sent"] attribute. For IMAP grants, IMAP providers provide the attributes. For Google and Microsoft Graph, Nylas matches system folders to a set of common attributes.

Source code in nylas/models/folders.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
@dataclass_json
@dataclass
class Folder:
    """
    Class representing a Nylas folder.

    Attributes:
        id: A globally unique object identifier.
        grant_id: A Grant ID of the Nylas account.
        name: Folder name
        object: The type of object.
        parent_id: ID of the parent folder. (Microsoft only)
        background_color: Folder background color. (Google only)
        text_color: Folder text color. (Google only)
        system_folder: Indicates if the folder is user created or system created. (Google Only)
        child_count: The number of immediate child folders in the current folder. (Microsoft only)
        unread_count: The number of unread items inside of a folder.
        total_count: The number of items inside of a folder.
        attributes: Common attribute descriptors shared by system folders across providers.
            For example, Sent email folders have the `["\\Sent"]` attribute.
            For IMAP grants, IMAP providers provide the attributes.
            For Google and Microsoft Graph, Nylas matches system folders to a set of common attributes.
    """

    id: str
    grant_id: str
    name: str
    object: str = "folder"
    parent_id: Optional[str] = None
    background_color: Optional[str] = None
    text_color: Optional[str] = None
    system_folder: Optional[bool] = None
    child_count: Optional[int] = None
    unread_count: Optional[int] = None
    total_count: Optional[int] = None
    attributes: Optional[str] = None

ListFolderQueryParams

Bases: ListQueryParams

Interface representing the query parameters for listing folders.

Attributes:

Name Type Description
parent_id NotRequired[str]

(Microsoft and EWS only.) Use the ID of a folder to find all child folders it contains.

Source code in nylas/models/folders.py
82
83
84
85
86
87
88
89
90
class ListFolderQueryParams(ListQueryParams):
    """
    Interface representing the query parameters for listing folders.

    Attributes:
        parent_id: (Microsoft and EWS only.) Use the ID of a folder to find all child folders it contains.
    """

    parent_id: NotRequired[str]

UpdateFolderRequest

Bases: TypedDict

Class representation of the Nylas folder update request.

Attributes:

Name Type Description
name NotRequired[str]

The name of the folder.

parent_id NotRequired[str]

The parent ID of the folder. (Microsoft only)

background_color NotRequired[str]

The background color of the folder. (Google only)

text_color NotRequired[str]

The text color of the folder. (Google only)

Source code in nylas/models/folders.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
class UpdateFolderRequest(TypedDict):
    """
    Class representation of the Nylas folder update request.

    Attributes:
        name: The name of the folder.
        parent_id: The parent ID of the folder. (Microsoft only)
        background_color: The background color of the folder. (Google only)
        text_color: The text color of the folder. (Google only)
    """

    name: NotRequired[str]
    parent_id: NotRequired[str]
    background_color: NotRequired[str]
    text_color: NotRequired[str]