Skip to content

events_batch

BatchEventOperation = Union[BatchCreateEventOperation, BatchUpdateEventOperation, BatchDeleteEventOperation] module-attribute

Union type representing the operations that a batch request can run.

BatchCreateEventOperation

Bases: TypedDict

Interface representing a batch operation that creates an event.

Attributes:

Name Type Description
method Literal['create']

The operation to run. Always "create".

body CreateEventRequest

The values to create the event with.

Source code in nylas/models/events_batch.py
16
17
18
19
20
21
22
23
24
25
26
class BatchCreateEventOperation(TypedDict):
    """
    Interface representing a batch operation that creates an event.

    Attributes:
        method: The operation to run. Always "create".
        body: The values to create the event with.
    """

    method: Literal["create"]
    body: CreateEventRequest

BatchDeleteEventOperation

Bases: TypedDict

Interface representing a batch operation that deletes an event.

Attributes:

Name Type Description
method Literal['delete']

The operation to run. Always "delete".

event_id str

The ID of the event to delete.

Source code in nylas/models/events_batch.py
44
45
46
47
48
49
50
51
52
53
54
class BatchDeleteEventOperation(TypedDict):
    """
    Interface representing a batch operation that deletes an event.

    Attributes:
        method: The operation to run. Always "delete".
        event_id: The ID of the event to delete.
    """

    method: Literal["delete"]
    event_id: str

BatchEventResult dataclass

Class representation of the result of one operation in a batch.

Attributes:

Name Type Description
status int

The HTTP status code of the operation.

data Optional[Event]

The created or updated event. Not set for delete operations or for failed operations.

error Optional[NylasApiErrorResponseData]

The error details. Only set if the operation failed.

retry_after Optional[int]

The number of seconds to wait before retrying the operation. Can be 0. Only set on failed operations, when the provider throttled the request.

provider_event_created Optional[bool]

True if the provider created the event before a later step failed. Retrying the operation would create a duplicate event.

Source code in nylas/models/events_batch.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@dataclass_json
@dataclass
class BatchEventResult:
    """
    Class representation of the result of one operation in a batch.

    Attributes:
        status: The HTTP status code of the operation.
        data: The created or updated event. Not set for delete operations or for failed operations.
        error: The error details. Only set if the operation failed.
        retry_after: The number of seconds to wait before retrying the operation. Can be 0.
            Only set on failed operations, when the provider throttled the request.
        provider_event_created: True if the provider created the event before a later step failed.
            Retrying the operation would create a duplicate event.
    """

    status: int
    data: Optional[Event] = None
    error: Optional[NylasApiErrorResponseData] = None
    retry_after: Optional[int] = None
    provider_event_created: Optional[bool] = None

BatchEventsQueryParams

Bases: CreateEventQueryParams

Interface representing the query parameters for a batch of event operations. The query parameters apply to every operation in the batch.

Attributes:

Name Type Description
calendar_id

The ID of the calendar that every operation in the batch acts on.

notify_participants

Whether to send email notifications containing the calendar event to all event participants. Defaults to true. Microsoft does not support setting this to false.

tentative_as_busy

When set to false, treats tentative calendar events as busy:false. Only applicable for Microsoft calendars. Defaults to true.

grant_email NotRequired[str]

The email address of the grant. Create operations default to the grant's email address.

select NotRequired[str]

Comma-separated list of fields to return in the event data of each result.

Source code in nylas/models/events_batch.py
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class BatchEventsQueryParams(CreateEventQueryParams):
    """
    Interface representing the query parameters for a batch of event operations.
    The query parameters apply to every operation in the batch.

    Attributes:
        calendar_id: The ID of the calendar that every operation in the batch acts on.
        notify_participants: Whether to send email notifications containing the calendar event to all
            event participants. Defaults to true. Microsoft does not support setting this to false.
        tentative_as_busy: When set to false, treats tentative calendar events as busy:false.
            Only applicable for Microsoft calendars. Defaults to true.
        grant_email: The email address of the grant. Create operations default to the grant's email address.
        select: Comma-separated list of fields to return in the event data of each result.
    """

    grant_email: NotRequired[str]
    select: NotRequired[str]

BatchEventsRequest

Bases: TypedDict

Interface representing a request to run a batch of event operations.

Attributes:

Name Type Description
operations List[BatchEventOperation]

The operations to run.

Source code in nylas/models/events_batch.py
63
64
65
66
67
68
69
70
71
class BatchEventsRequest(TypedDict):
    """
    Interface representing a request to run a batch of event operations.

    Attributes:
        operations: The operations to run.
    """

    operations: List[BatchEventOperation]

BatchUpdateEventOperation

Bases: TypedDict

Interface representing a batch operation that updates an event.

Attributes:

Name Type Description
method Literal['update']

The operation to run. Always "update".

event_id str

The ID of the event to update.

body UpdateEventRequest

The values to update the event with.

Source code in nylas/models/events_batch.py
29
30
31
32
33
34
35
36
37
38
39
40
41
class BatchUpdateEventOperation(TypedDict):
    """
    Interface representing a batch operation that updates an event.

    Attributes:
        method: The operation to run. Always "update".
        event_id: The ID of the event to update.
        body: The values to update the event with.
    """

    method: Literal["update"]
    event_id: str
    body: UpdateEventRequest