agentmail 0.5.38 → 0.5.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/apiKeys/types/ApiKeyPermissions.d.ts +12 -0
- package/dist/cjs/api/resources/calendar/errors/EventExpiredError.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/errors/EventExpiredError.js +54 -0
- package/dist/cjs/api/resources/calendar/errors/ForbiddenError.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/errors/ForbiddenError.js +54 -0
- package/dist/cjs/api/resources/calendar/errors/PayloadTooLargeError.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/errors/PayloadTooLargeError.js +54 -0
- package/dist/cjs/api/resources/calendar/errors/PreconditionFailedError.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/errors/PreconditionFailedError.js +54 -0
- package/dist/cjs/api/resources/calendar/errors/RateLimitError.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/errors/RateLimitError.js +54 -0
- package/dist/cjs/api/resources/calendar/errors/index.d.ts +5 -0
- package/dist/cjs/api/resources/calendar/errors/index.js +21 -0
- package/dist/cjs/api/resources/calendar/exports.d.ts +1 -0
- package/dist/cjs/api/resources/calendar/exports.js +18 -0
- package/dist/cjs/api/resources/calendar/index.d.ts +2 -0
- package/dist/cjs/api/resources/calendar/index.js +18 -0
- package/dist/cjs/api/resources/calendar/types/Attendee.d.ts +18 -0
- package/dist/cjs/api/resources/calendar/types/Attendee.js +3 -0
- package/dist/cjs/api/resources/calendar/types/AttendeeRole.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/types/AttendeeRole.js +9 -0
- package/dist/cjs/api/resources/calendar/types/AttendeeStatus.d.ts +8 -0
- package/dist/cjs/api/resources/calendar/types/AttendeeStatus.js +11 -0
- package/dist/cjs/api/resources/calendar/types/Calendar.d.ts +24 -0
- package/dist/cjs/api/resources/calendar/types/Calendar.js +3 -0
- package/dist/cjs/api/resources/calendar/types/CalendarConsistency.d.ts +10 -0
- package/dist/cjs/api/resources/calendar/types/CalendarConsistency.js +13 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEvent.d.ts +75 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEvent.js +3 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventId.d.ts +7 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventId.js +3 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventKind.d.ts +15 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventKind.js +18 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventMutationResponse.d.ts +5 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventMutationResponse.js +3 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventSource.d.ts +10 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventSource.js +13 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventStatus.d.ts +12 -0
- package/dist/cjs/api/resources/calendar/types/CalendarEventStatus.js +15 -0
- package/dist/cjs/api/resources/calendar/types/CalendarLimit.d.ts +4 -0
- package/dist/cjs/api/resources/calendar/types/CalendarLimit.js +3 -0
- package/dist/cjs/api/resources/calendar/types/CreateCalendarEventRequest.d.ts +46 -0
- package/dist/cjs/api/resources/calendar/types/CreateCalendarEventRequest.js +3 -0
- package/dist/cjs/api/resources/calendar/types/DeleteCalendarEventResponse.d.ts +11 -0
- package/dist/cjs/api/resources/calendar/types/DeleteCalendarEventResponse.js +3 -0
- package/dist/cjs/api/resources/calendar/types/DeletionId.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/types/DeletionId.js +3 -0
- package/dist/cjs/api/resources/calendar/types/DurationMode.d.ts +14 -0
- package/dist/cjs/api/resources/calendar/types/DurationMode.js +17 -0
- package/dist/cjs/api/resources/calendar/types/IanaTimezone.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/types/IanaTimezone.js +3 -0
- package/dist/cjs/api/resources/calendar/types/IncludeOverlapping.d.ts +5 -0
- package/dist/cjs/api/resources/calendar/types/IncludeOverlapping.js +3 -0
- package/dist/cjs/api/resources/calendar/types/InstanceMutationMode.d.ts +10 -0
- package/dist/cjs/api/resources/calendar/types/InstanceMutationMode.js +13 -0
- package/dist/cjs/api/resources/calendar/types/ListCalendarEventsResponse.d.ts +11 -0
- package/dist/cjs/api/resources/calendar/types/ListCalendarEventsResponse.js +3 -0
- package/dist/cjs/api/resources/calendar/types/OperationId.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/types/OperationId.js +3 -0
- package/dist/cjs/api/resources/calendar/types/PreconditionFailedErrorResponse.d.ts +10 -0
- package/dist/cjs/api/resources/calendar/types/PreconditionFailedErrorResponse.js +3 -0
- package/dist/cjs/api/resources/calendar/types/Recurrence.d.ts +15 -0
- package/dist/cjs/api/resources/calendar/types/Recurrence.js +3 -0
- package/dist/cjs/api/resources/calendar/types/RecurrenceDate.d.ts +5 -0
- package/dist/cjs/api/resources/calendar/types/RecurrenceDate.js +3 -0
- package/dist/cjs/api/resources/calendar/types/RecurrenceInput.d.ts +27 -0
- package/dist/cjs/api/resources/calendar/types/RecurrenceInput.js +3 -0
- package/dist/cjs/api/resources/calendar/types/RecurrencePeriod.d.ts +10 -0
- package/dist/cjs/api/resources/calendar/types/RecurrencePeriod.js +3 -0
- package/dist/cjs/api/resources/calendar/types/ResourceRevision.d.ts +5 -0
- package/dist/cjs/api/resources/calendar/types/ResourceRevision.js +3 -0
- package/dist/cjs/api/resources/calendar/types/RespondCalendarEventRequest.d.ts +12 -0
- package/dist/cjs/api/resources/calendar/types/RespondCalendarEventRequest.js +3 -0
- package/dist/cjs/api/resources/calendar/types/RespondStatus.d.ts +7 -0
- package/dist/cjs/api/resources/calendar/types/RespondStatus.js +10 -0
- package/dist/cjs/api/resources/calendar/types/UpdateCalendarEventRequest.d.ts +37 -0
- package/dist/cjs/api/resources/calendar/types/UpdateCalendarEventRequest.js +3 -0
- package/dist/cjs/api/resources/calendar/types/UpdateCalendarRequest.d.ts +5 -0
- package/dist/cjs/api/resources/calendar/types/UpdateCalendarRequest.js +3 -0
- package/dist/cjs/api/resources/calendar/types/WallTime.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/types/WallTime.js +3 -0
- package/dist/cjs/api/resources/calendar/types/WindowAfter.d.ts +5 -0
- package/dist/cjs/api/resources/calendar/types/WindowAfter.js +3 -0
- package/dist/cjs/api/resources/calendar/types/WindowBefore.d.ts +6 -0
- package/dist/cjs/api/resources/calendar/types/WindowBefore.js +3 -0
- package/dist/cjs/api/resources/calendar/types/index.d.ts +34 -0
- package/dist/cjs/api/resources/calendar/types/index.js +50 -0
- package/dist/cjs/api/resources/events/types/CalendarEventCreatedEvent.d.ts +13 -0
- package/dist/cjs/api/resources/events/types/CalendarEventCreatedEvent.js +3 -0
- package/dist/cjs/api/resources/events/types/CalendarEventDeletedEvent.d.ts +13 -0
- package/dist/cjs/api/resources/events/types/CalendarEventDeletedEvent.js +3 -0
- package/dist/cjs/api/resources/events/types/CalendarEventEndingEvent.d.ts +16 -0
- package/dist/cjs/api/resources/events/types/CalendarEventEndingEvent.js +3 -0
- package/dist/cjs/api/resources/events/types/CalendarEventPrevious.d.ts +19 -0
- package/dist/cjs/api/resources/events/types/CalendarEventPrevious.js +3 -0
- package/dist/cjs/api/resources/events/types/CalendarEventRespondedEvent.d.ts +13 -0
- package/dist/cjs/api/resources/events/types/CalendarEventRespondedEvent.js +3 -0
- package/dist/cjs/api/resources/events/types/CalendarEventStartingEvent.d.ts +19 -0
- package/dist/cjs/api/resources/events/types/CalendarEventStartingEvent.js +3 -0
- package/dist/cjs/api/resources/events/types/CalendarEventUpdatedEvent.d.ts +16 -0
- package/dist/cjs/api/resources/events/types/CalendarEventUpdatedEvent.js +3 -0
- package/dist/cjs/api/resources/events/types/EventType.d.ts +6 -0
- package/dist/cjs/api/resources/events/types/EventType.js +6 -0
- package/dist/cjs/api/resources/events/types/index.d.ts +7 -0
- package/dist/cjs/api/resources/events/types/index.js +7 -0
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +19 -14
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/Client.d.ts +423 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/Client.js +1443 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/DeleteCalendarEventRequest.d.ts +29 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/DeleteCalendarEventRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/GetCalendarAgendaRequest.d.ts +17 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/GetCalendarAgendaRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/GetCalendarEventRequest.d.ts +8 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/GetCalendarEventRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/GetCalendarRequest.d.ts +8 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/GetCalendarRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventInstancesRequest.d.ts +16 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventInstancesRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventsRequest.d.ts +11 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventsRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.d.ts +12 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.d.ts +21 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.d.ts +11 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/index.d.ts +9 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/exports.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/exports.js +21 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/calendar/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/websockets/client/Socket.d.ts +1 -1
- package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.d.ts +6 -0
- package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.js +6 -0
- package/dist/cjs/serialization/resources/calendar/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/calendar/index.js +17 -0
- package/dist/cjs/serialization/resources/calendar/types/Attendee.d.ts +16 -0
- package/dist/cjs/serialization/resources/calendar/types/Attendee.js +48 -0
- package/dist/cjs/serialization/resources/calendar/types/AttendeeRole.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/AttendeeRole.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/AttendeeStatus.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/AttendeeStatus.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/Calendar.d.ts +16 -0
- package/dist/cjs/serialization/resources/calendar/types/Calendar.js +48 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarConsistency.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarConsistency.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEvent.d.ts +49 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEvent.js +81 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventId.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventId.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventKind.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventKind.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventMutationResponse.d.ts +12 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventMutationResponse.js +44 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventSource.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventSource.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventStatus.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarEventStatus.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarLimit.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/CalendarLimit.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/CreateCalendarEventRequest.d.ts +28 -0
- package/dist/cjs/serialization/resources/calendar/types/CreateCalendarEventRequest.js +60 -0
- package/dist/cjs/serialization/resources/calendar/types/DeleteCalendarEventResponse.d.ts +14 -0
- package/dist/cjs/serialization/resources/calendar/types/DeleteCalendarEventResponse.js +46 -0
- package/dist/cjs/serialization/resources/calendar/types/DeletionId.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/DeletionId.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/DurationMode.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/DurationMode.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/IanaTimezone.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/IanaTimezone.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/IncludeOverlapping.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/IncludeOverlapping.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/InstanceMutationMode.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/InstanceMutationMode.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/ListCalendarEventsResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/calendar/types/ListCalendarEventsResponse.js +48 -0
- package/dist/cjs/serialization/resources/calendar/types/OperationId.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/OperationId.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/PreconditionFailedErrorResponse.d.ts +19 -0
- package/dist/cjs/serialization/resources/calendar/types/PreconditionFailedErrorResponse.js +51 -0
- package/dist/cjs/serialization/resources/calendar/types/Recurrence.d.ts +14 -0
- package/dist/cjs/serialization/resources/calendar/types/Recurrence.js +46 -0
- package/dist/cjs/serialization/resources/calendar/types/RecurrenceDate.d.ts +9 -0
- package/dist/cjs/serialization/resources/calendar/types/RecurrenceDate.js +41 -0
- package/dist/cjs/serialization/resources/calendar/types/RecurrenceInput.d.ts +13 -0
- package/dist/cjs/serialization/resources/calendar/types/RecurrenceInput.js +45 -0
- package/dist/cjs/serialization/resources/calendar/types/RecurrencePeriod.d.ts +12 -0
- package/dist/cjs/serialization/resources/calendar/types/RecurrencePeriod.js +44 -0
- package/dist/cjs/serialization/resources/calendar/types/ResourceRevision.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/ResourceRevision.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/RespondCalendarEventRequest.d.ts +12 -0
- package/dist/cjs/serialization/resources/calendar/types/RespondCalendarEventRequest.js +44 -0
- package/dist/cjs/serialization/resources/calendar/types/RespondStatus.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/RespondStatus.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/UpdateCalendarEventRequest.d.ts +27 -0
- package/dist/cjs/serialization/resources/calendar/types/UpdateCalendarEventRequest.js +59 -0
- package/dist/cjs/serialization/resources/calendar/types/UpdateCalendarRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/calendar/types/UpdateCalendarRequest.js +42 -0
- package/dist/cjs/serialization/resources/calendar/types/WallTime.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/WallTime.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/WindowAfter.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/WindowAfter.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/WindowBefore.d.ts +7 -0
- package/dist/cjs/serialization/resources/calendar/types/WindowBefore.js +39 -0
- package/dist/cjs/serialization/resources/calendar/types/index.d.ts +34 -0
- package/dist/cjs/serialization/resources/calendar/types/index.js +50 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventCreatedEvent.d.ts +16 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventCreatedEvent.js +48 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventDeletedEvent.d.ts +16 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventDeletedEvent.js +48 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventEndingEvent.d.ts +17 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventEndingEvent.js +49 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventPrevious.d.ts +26 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventPrevious.js +58 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventRespondedEvent.d.ts +16 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventRespondedEvent.js +48 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventStartingEvent.d.ts +17 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventStartingEvent.js +49 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventUpdatedEvent.d.ts +18 -0
- package/dist/cjs/serialization/resources/events/types/CalendarEventUpdatedEvent.js +50 -0
- package/dist/cjs/serialization/resources/events/types/EventType.d.ts +1 -1
- package/dist/cjs/serialization/resources/events/types/EventType.js +6 -0
- package/dist/cjs/serialization/resources/events/types/index.d.ts +7 -0
- package/dist/cjs/serialization/resources/events/types/index.js +7 -0
- package/dist/cjs/serialization/resources/inboxes/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/inboxes/index.js +1 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/index.js +17 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.d.ts +9 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.js +40 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.d.ts +9 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.js +40 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.d.ts +9 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.js +40 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/client/requests/index.js +9 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/inboxes/resources/calendar/index.js +17 -0
- package/dist/cjs/serialization/resources/inboxes/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/inboxes/resources/index.js +41 -0
- package/dist/cjs/serialization/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/index.js +3 -1
- package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +8 -2
- package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +12 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/apiKeys/types/ApiKeyPermissions.d.mts +12 -0
- package/dist/esm/api/resources/calendar/errors/EventExpiredError.d.mts +6 -0
- package/dist/esm/api/resources/calendar/errors/EventExpiredError.mjs +17 -0
- package/dist/esm/api/resources/calendar/errors/ForbiddenError.d.mts +6 -0
- package/dist/esm/api/resources/calendar/errors/ForbiddenError.mjs +17 -0
- package/dist/esm/api/resources/calendar/errors/PayloadTooLargeError.d.mts +6 -0
- package/dist/esm/api/resources/calendar/errors/PayloadTooLargeError.mjs +17 -0
- package/dist/esm/api/resources/calendar/errors/PreconditionFailedError.d.mts +6 -0
- package/dist/esm/api/resources/calendar/errors/PreconditionFailedError.mjs +17 -0
- package/dist/esm/api/resources/calendar/errors/RateLimitError.d.mts +6 -0
- package/dist/esm/api/resources/calendar/errors/RateLimitError.mjs +17 -0
- package/dist/esm/api/resources/calendar/errors/index.d.mts +5 -0
- package/dist/esm/api/resources/calendar/errors/index.mjs +5 -0
- package/dist/esm/api/resources/calendar/exports.d.mts +1 -0
- package/dist/esm/api/resources/calendar/exports.mjs +2 -0
- package/dist/esm/api/resources/calendar/index.d.mts +2 -0
- package/dist/esm/api/resources/calendar/index.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/Attendee.d.mts +18 -0
- package/dist/esm/api/resources/calendar/types/Attendee.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/AttendeeRole.d.mts +6 -0
- package/dist/esm/api/resources/calendar/types/AttendeeRole.mjs +6 -0
- package/dist/esm/api/resources/calendar/types/AttendeeStatus.d.mts +8 -0
- package/dist/esm/api/resources/calendar/types/AttendeeStatus.mjs +8 -0
- package/dist/esm/api/resources/calendar/types/Calendar.d.mts +24 -0
- package/dist/esm/api/resources/calendar/types/Calendar.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/CalendarConsistency.d.mts +10 -0
- package/dist/esm/api/resources/calendar/types/CalendarConsistency.mjs +10 -0
- package/dist/esm/api/resources/calendar/types/CalendarEvent.d.mts +75 -0
- package/dist/esm/api/resources/calendar/types/CalendarEvent.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventId.d.mts +7 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventId.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventKind.d.mts +15 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventKind.mjs +15 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventMutationResponse.d.mts +5 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventMutationResponse.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventSource.d.mts +10 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventSource.mjs +10 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventStatus.d.mts +12 -0
- package/dist/esm/api/resources/calendar/types/CalendarEventStatus.mjs +12 -0
- package/dist/esm/api/resources/calendar/types/CalendarLimit.d.mts +4 -0
- package/dist/esm/api/resources/calendar/types/CalendarLimit.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/CreateCalendarEventRequest.d.mts +46 -0
- package/dist/esm/api/resources/calendar/types/CreateCalendarEventRequest.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/DeleteCalendarEventResponse.d.mts +11 -0
- package/dist/esm/api/resources/calendar/types/DeleteCalendarEventResponse.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/DeletionId.d.mts +6 -0
- package/dist/esm/api/resources/calendar/types/DeletionId.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/DurationMode.d.mts +14 -0
- package/dist/esm/api/resources/calendar/types/DurationMode.mjs +14 -0
- package/dist/esm/api/resources/calendar/types/IanaTimezone.d.mts +6 -0
- package/dist/esm/api/resources/calendar/types/IanaTimezone.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/IncludeOverlapping.d.mts +5 -0
- package/dist/esm/api/resources/calendar/types/IncludeOverlapping.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/InstanceMutationMode.d.mts +10 -0
- package/dist/esm/api/resources/calendar/types/InstanceMutationMode.mjs +10 -0
- package/dist/esm/api/resources/calendar/types/ListCalendarEventsResponse.d.mts +11 -0
- package/dist/esm/api/resources/calendar/types/ListCalendarEventsResponse.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/OperationId.d.mts +6 -0
- package/dist/esm/api/resources/calendar/types/OperationId.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/PreconditionFailedErrorResponse.d.mts +10 -0
- package/dist/esm/api/resources/calendar/types/PreconditionFailedErrorResponse.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/Recurrence.d.mts +15 -0
- package/dist/esm/api/resources/calendar/types/Recurrence.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/RecurrenceDate.d.mts +5 -0
- package/dist/esm/api/resources/calendar/types/RecurrenceDate.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/RecurrenceInput.d.mts +27 -0
- package/dist/esm/api/resources/calendar/types/RecurrenceInput.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/RecurrencePeriod.d.mts +10 -0
- package/dist/esm/api/resources/calendar/types/RecurrencePeriod.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/ResourceRevision.d.mts +5 -0
- package/dist/esm/api/resources/calendar/types/ResourceRevision.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/RespondCalendarEventRequest.d.mts +12 -0
- package/dist/esm/api/resources/calendar/types/RespondCalendarEventRequest.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/RespondStatus.d.mts +7 -0
- package/dist/esm/api/resources/calendar/types/RespondStatus.mjs +7 -0
- package/dist/esm/api/resources/calendar/types/UpdateCalendarEventRequest.d.mts +37 -0
- package/dist/esm/api/resources/calendar/types/UpdateCalendarEventRequest.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/UpdateCalendarRequest.d.mts +5 -0
- package/dist/esm/api/resources/calendar/types/UpdateCalendarRequest.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/WallTime.d.mts +6 -0
- package/dist/esm/api/resources/calendar/types/WallTime.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/WindowAfter.d.mts +5 -0
- package/dist/esm/api/resources/calendar/types/WindowAfter.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/WindowBefore.d.mts +6 -0
- package/dist/esm/api/resources/calendar/types/WindowBefore.mjs +2 -0
- package/dist/esm/api/resources/calendar/types/index.d.mts +34 -0
- package/dist/esm/api/resources/calendar/types/index.mjs +34 -0
- package/dist/esm/api/resources/events/types/CalendarEventCreatedEvent.d.mts +13 -0
- package/dist/esm/api/resources/events/types/CalendarEventCreatedEvent.mjs +2 -0
- package/dist/esm/api/resources/events/types/CalendarEventDeletedEvent.d.mts +13 -0
- package/dist/esm/api/resources/events/types/CalendarEventDeletedEvent.mjs +2 -0
- package/dist/esm/api/resources/events/types/CalendarEventEndingEvent.d.mts +16 -0
- package/dist/esm/api/resources/events/types/CalendarEventEndingEvent.mjs +2 -0
- package/dist/esm/api/resources/events/types/CalendarEventPrevious.d.mts +19 -0
- package/dist/esm/api/resources/events/types/CalendarEventPrevious.mjs +2 -0
- package/dist/esm/api/resources/events/types/CalendarEventRespondedEvent.d.mts +13 -0
- package/dist/esm/api/resources/events/types/CalendarEventRespondedEvent.mjs +2 -0
- package/dist/esm/api/resources/events/types/CalendarEventStartingEvent.d.mts +19 -0
- package/dist/esm/api/resources/events/types/CalendarEventStartingEvent.mjs +2 -0
- package/dist/esm/api/resources/events/types/CalendarEventUpdatedEvent.d.mts +16 -0
- package/dist/esm/api/resources/events/types/CalendarEventUpdatedEvent.mjs +2 -0
- package/dist/esm/api/resources/events/types/EventType.d.mts +6 -0
- package/dist/esm/api/resources/events/types/EventType.mjs +6 -0
- package/dist/esm/api/resources/events/types/index.d.mts +7 -0
- package/dist/esm/api/resources/events/types/index.mjs +7 -0
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/Client.d.mts +423 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/Client.mjs +1406 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/DeleteCalendarEventRequest.d.mts +29 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/DeleteCalendarEventRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/GetCalendarAgendaRequest.d.mts +17 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/GetCalendarAgendaRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/GetCalendarEventRequest.d.mts +8 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/GetCalendarEventRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/GetCalendarRequest.d.mts +8 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/GetCalendarRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventInstancesRequest.d.mts +16 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventInstancesRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventsRequest.d.mts +11 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/ListCalendarEventsRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.d.mts +12 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.d.mts +21 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.d.mts +11 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/index.d.mts +9 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/exports.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/exports.mjs +3 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/calendar/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/websockets/client/Socket.d.mts +1 -1
- package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.d.mts +6 -0
- package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.mjs +6 -0
- package/dist/esm/serialization/resources/calendar/index.d.mts +1 -0
- package/dist/esm/serialization/resources/calendar/index.mjs +1 -0
- package/dist/esm/serialization/resources/calendar/types/Attendee.d.mts +16 -0
- package/dist/esm/serialization/resources/calendar/types/Attendee.mjs +12 -0
- package/dist/esm/serialization/resources/calendar/types/AttendeeRole.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/AttendeeRole.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/AttendeeStatus.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/AttendeeStatus.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/Calendar.d.mts +16 -0
- package/dist/esm/serialization/resources/calendar/types/Calendar.mjs +12 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarConsistency.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarConsistency.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEvent.d.mts +49 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEvent.mjs +45 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventId.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventId.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventKind.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventKind.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventMutationResponse.d.mts +12 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventMutationResponse.mjs +8 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventSource.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventSource.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventStatus.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarEventStatus.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarLimit.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/CalendarLimit.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/CreateCalendarEventRequest.d.mts +28 -0
- package/dist/esm/serialization/resources/calendar/types/CreateCalendarEventRequest.mjs +24 -0
- package/dist/esm/serialization/resources/calendar/types/DeleteCalendarEventResponse.d.mts +14 -0
- package/dist/esm/serialization/resources/calendar/types/DeleteCalendarEventResponse.mjs +10 -0
- package/dist/esm/serialization/resources/calendar/types/DeletionId.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/DeletionId.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/DurationMode.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/DurationMode.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/IanaTimezone.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/IanaTimezone.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/IncludeOverlapping.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/IncludeOverlapping.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/InstanceMutationMode.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/InstanceMutationMode.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/ListCalendarEventsResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/calendar/types/ListCalendarEventsResponse.mjs +12 -0
- package/dist/esm/serialization/resources/calendar/types/OperationId.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/OperationId.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/PreconditionFailedErrorResponse.d.mts +19 -0
- package/dist/esm/serialization/resources/calendar/types/PreconditionFailedErrorResponse.mjs +15 -0
- package/dist/esm/serialization/resources/calendar/types/Recurrence.d.mts +14 -0
- package/dist/esm/serialization/resources/calendar/types/Recurrence.mjs +10 -0
- package/dist/esm/serialization/resources/calendar/types/RecurrenceDate.d.mts +9 -0
- package/dist/esm/serialization/resources/calendar/types/RecurrenceDate.mjs +5 -0
- package/dist/esm/serialization/resources/calendar/types/RecurrenceInput.d.mts +13 -0
- package/dist/esm/serialization/resources/calendar/types/RecurrenceInput.mjs +9 -0
- package/dist/esm/serialization/resources/calendar/types/RecurrencePeriod.d.mts +12 -0
- package/dist/esm/serialization/resources/calendar/types/RecurrencePeriod.mjs +8 -0
- package/dist/esm/serialization/resources/calendar/types/ResourceRevision.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/ResourceRevision.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/RespondCalendarEventRequest.d.mts +12 -0
- package/dist/esm/serialization/resources/calendar/types/RespondCalendarEventRequest.mjs +8 -0
- package/dist/esm/serialization/resources/calendar/types/RespondStatus.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/RespondStatus.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/UpdateCalendarEventRequest.d.mts +27 -0
- package/dist/esm/serialization/resources/calendar/types/UpdateCalendarEventRequest.mjs +23 -0
- package/dist/esm/serialization/resources/calendar/types/UpdateCalendarRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/calendar/types/UpdateCalendarRequest.mjs +6 -0
- package/dist/esm/serialization/resources/calendar/types/WallTime.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/WallTime.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/WindowAfter.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/WindowAfter.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/WindowBefore.d.mts +7 -0
- package/dist/esm/serialization/resources/calendar/types/WindowBefore.mjs +3 -0
- package/dist/esm/serialization/resources/calendar/types/index.d.mts +34 -0
- package/dist/esm/serialization/resources/calendar/types/index.mjs +34 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventCreatedEvent.d.mts +16 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventCreatedEvent.mjs +12 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventDeletedEvent.d.mts +16 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventDeletedEvent.mjs +12 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventEndingEvent.d.mts +17 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventEndingEvent.mjs +13 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventPrevious.d.mts +26 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventPrevious.mjs +22 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventRespondedEvent.d.mts +16 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventRespondedEvent.mjs +12 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventStartingEvent.d.mts +17 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventStartingEvent.mjs +13 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventUpdatedEvent.d.mts +18 -0
- package/dist/esm/serialization/resources/events/types/CalendarEventUpdatedEvent.mjs +14 -0
- package/dist/esm/serialization/resources/events/types/EventType.d.mts +1 -1
- package/dist/esm/serialization/resources/events/types/EventType.mjs +6 -0
- package/dist/esm/serialization/resources/events/types/index.d.mts +7 -0
- package/dist/esm/serialization/resources/events/types/index.mjs +7 -0
- package/dist/esm/serialization/resources/inboxes/index.d.mts +1 -0
- package/dist/esm/serialization/resources/inboxes/index.mjs +1 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/index.d.mts +1 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/index.mjs +1 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.d.mts +9 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/RespondCalendarEventRequestWrapper.mjs +4 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.d.mts +9 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarEventRequestWrapper.mjs +4 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.d.mts +9 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/UpdateCalendarRequestWrapper.mjs +4 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/index.d.mts +3 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/client/requests/index.mjs +3 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/index.d.mts +1 -0
- package/dist/esm/serialization/resources/inboxes/resources/calendar/index.mjs +1 -0
- package/dist/esm/serialization/resources/inboxes/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/inboxes/resources/index.mjs +2 -0
- package/dist/esm/serialization/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/index.mjs +2 -0
- package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.mts +8 -2
- package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.mjs +12 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +927 -0
|
@@ -0,0 +1,1406 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
28
|
+
import * as serializers from "../../../../../../serialization/index.mjs";
|
|
29
|
+
import * as AgentMail from "../../../../../index.mjs";
|
|
30
|
+
export class CalendarClient {
|
|
31
|
+
constructor(options = {}) {
|
|
32
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @beta This endpoint is in pre-release and may change.
|
|
36
|
+
*
|
|
37
|
+
* Gets the inbox's calendar. Every inbox has one calendar, so this works before any event is
|
|
38
|
+
* created. Its `etag` (also the `ETag` response header) is the value to send in `If-Match` to
|
|
39
|
+
* make an update conditional.
|
|
40
|
+
*
|
|
41
|
+
* Requires the `calendar_read` permission. Calendar is in private beta: organizations without
|
|
42
|
+
* access receive a `403`.
|
|
43
|
+
*
|
|
44
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
45
|
+
* @param {AgentMail.inboxes.GetCalendarRequest} request
|
|
46
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
48
|
+
* @throws {@link AgentMail.ValidationError}
|
|
49
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
50
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* await client.inboxes.calendar.get("scheduler@agentmail.to")
|
|
54
|
+
*/
|
|
55
|
+
get(inbox_id, request = {}, requestOptions) {
|
|
56
|
+
return core.HttpResponsePromise.fromPromise(this.__get(inbox_id, request, requestOptions));
|
|
57
|
+
}
|
|
58
|
+
__get(inbox_id_1) {
|
|
59
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
60
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
61
|
+
const { consistency } = request;
|
|
62
|
+
const _queryParams = {
|
|
63
|
+
consistency: consistency != null
|
|
64
|
+
? serializers.CalendarConsistency.jsonOrThrow(consistency, {
|
|
65
|
+
unrecognizedObjectKeys: "strip",
|
|
66
|
+
omitUndefined: true,
|
|
67
|
+
})
|
|
68
|
+
: undefined,
|
|
69
|
+
};
|
|
70
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
71
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
72
|
+
const _response = yield core.fetcher({
|
|
73
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
74
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar`),
|
|
75
|
+
method: "GET",
|
|
76
|
+
headers: _headers,
|
|
77
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
78
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
79
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
80
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
81
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
82
|
+
logging: this._options.logging,
|
|
83
|
+
});
|
|
84
|
+
if (_response.ok) {
|
|
85
|
+
return {
|
|
86
|
+
data: serializers.Calendar.parseOrThrow(_response.body, {
|
|
87
|
+
unrecognizedObjectKeys: "passthrough",
|
|
88
|
+
allowUnrecognizedUnionMembers: true,
|
|
89
|
+
allowUnrecognizedEnumValues: true,
|
|
90
|
+
skipValidation: true,
|
|
91
|
+
breadcrumbsPrefix: ["response"],
|
|
92
|
+
}),
|
|
93
|
+
rawResponse: _response.rawResponse,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (_response.error.reason === "status-code") {
|
|
97
|
+
switch (_response.error.statusCode) {
|
|
98
|
+
case 400:
|
|
99
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
100
|
+
unrecognizedObjectKeys: "passthrough",
|
|
101
|
+
allowUnrecognizedUnionMembers: true,
|
|
102
|
+
allowUnrecognizedEnumValues: true,
|
|
103
|
+
skipValidation: true,
|
|
104
|
+
breadcrumbsPrefix: ["response"],
|
|
105
|
+
}), _response.rawResponse);
|
|
106
|
+
case 403:
|
|
107
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
108
|
+
unrecognizedObjectKeys: "passthrough",
|
|
109
|
+
allowUnrecognizedUnionMembers: true,
|
|
110
|
+
allowUnrecognizedEnumValues: true,
|
|
111
|
+
skipValidation: true,
|
|
112
|
+
breadcrumbsPrefix: ["response"],
|
|
113
|
+
}), _response.rawResponse);
|
|
114
|
+
case 404:
|
|
115
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
116
|
+
unrecognizedObjectKeys: "passthrough",
|
|
117
|
+
allowUnrecognizedUnionMembers: true,
|
|
118
|
+
allowUnrecognizedEnumValues: true,
|
|
119
|
+
skipValidation: true,
|
|
120
|
+
breadcrumbsPrefix: ["response"],
|
|
121
|
+
}), _response.rawResponse);
|
|
122
|
+
default:
|
|
123
|
+
throw new errors.AgentMailError({
|
|
124
|
+
statusCode: _response.error.statusCode,
|
|
125
|
+
body: _response.error.body,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/calendar");
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @beta This endpoint is in pre-release and may change.
|
|
135
|
+
*
|
|
136
|
+
* Updates the calendar's default time zone. Existing events keep their own `timezone`; only
|
|
137
|
+
* events created later without a `timezone` use the new default.
|
|
138
|
+
*
|
|
139
|
+
* Requires the `calendar_update` permission. To make the update conditional, send the
|
|
140
|
+
* calendar's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the
|
|
141
|
+
* update applies to the calendar as it is.
|
|
142
|
+
*
|
|
143
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
144
|
+
*
|
|
145
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
146
|
+
* @param {AgentMail.inboxes.UpdateCalendarRequestWrapper} request
|
|
147
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
148
|
+
*
|
|
149
|
+
* @throws {@link AgentMail.ValidationError}
|
|
150
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
151
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
152
|
+
* @throws {@link AgentMail.ConflictError}
|
|
153
|
+
* @throws {@link AgentMail.PreconditionFailedError}
|
|
154
|
+
* @throws {@link AgentMail.PayloadTooLargeError}
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* await client.inboxes.calendar.update("scheduler@agentmail.to", {
|
|
158
|
+
* timezone: "America/New_York"
|
|
159
|
+
* })
|
|
160
|
+
*/
|
|
161
|
+
update(inbox_id, request, requestOptions) {
|
|
162
|
+
return core.HttpResponsePromise.fromPromise(this.__update(inbox_id, request, requestOptions));
|
|
163
|
+
}
|
|
164
|
+
__update(inbox_id, request, requestOptions) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
167
|
+
const { ifMatch } = request, _body = __rest(request, ["ifMatch"]);
|
|
168
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
169
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "If-Match": ifMatch }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
170
|
+
const _response = yield core.fetcher({
|
|
171
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
172
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar`),
|
|
173
|
+
method: "PATCH",
|
|
174
|
+
headers: _headers,
|
|
175
|
+
contentType: "application/json",
|
|
176
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
177
|
+
requestType: "json",
|
|
178
|
+
body: serializers.inboxes.UpdateCalendarRequestWrapper.jsonOrThrow(_body, {
|
|
179
|
+
unrecognizedObjectKeys: "strip",
|
|
180
|
+
omitUndefined: true,
|
|
181
|
+
}),
|
|
182
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
183
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
184
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
185
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
186
|
+
logging: this._options.logging,
|
|
187
|
+
});
|
|
188
|
+
if (_response.ok) {
|
|
189
|
+
return {
|
|
190
|
+
data: serializers.Calendar.parseOrThrow(_response.body, {
|
|
191
|
+
unrecognizedObjectKeys: "passthrough",
|
|
192
|
+
allowUnrecognizedUnionMembers: true,
|
|
193
|
+
allowUnrecognizedEnumValues: true,
|
|
194
|
+
skipValidation: true,
|
|
195
|
+
breadcrumbsPrefix: ["response"],
|
|
196
|
+
}),
|
|
197
|
+
rawResponse: _response.rawResponse,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (_response.error.reason === "status-code") {
|
|
201
|
+
switch (_response.error.statusCode) {
|
|
202
|
+
case 400:
|
|
203
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
204
|
+
unrecognizedObjectKeys: "passthrough",
|
|
205
|
+
allowUnrecognizedUnionMembers: true,
|
|
206
|
+
allowUnrecognizedEnumValues: true,
|
|
207
|
+
skipValidation: true,
|
|
208
|
+
breadcrumbsPrefix: ["response"],
|
|
209
|
+
}), _response.rawResponse);
|
|
210
|
+
case 403:
|
|
211
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
212
|
+
unrecognizedObjectKeys: "passthrough",
|
|
213
|
+
allowUnrecognizedUnionMembers: true,
|
|
214
|
+
allowUnrecognizedEnumValues: true,
|
|
215
|
+
skipValidation: true,
|
|
216
|
+
breadcrumbsPrefix: ["response"],
|
|
217
|
+
}), _response.rawResponse);
|
|
218
|
+
case 404:
|
|
219
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
220
|
+
unrecognizedObjectKeys: "passthrough",
|
|
221
|
+
allowUnrecognizedUnionMembers: true,
|
|
222
|
+
allowUnrecognizedEnumValues: true,
|
|
223
|
+
skipValidation: true,
|
|
224
|
+
breadcrumbsPrefix: ["response"],
|
|
225
|
+
}), _response.rawResponse);
|
|
226
|
+
case 409:
|
|
227
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
228
|
+
unrecognizedObjectKeys: "passthrough",
|
|
229
|
+
allowUnrecognizedUnionMembers: true,
|
|
230
|
+
allowUnrecognizedEnumValues: true,
|
|
231
|
+
skipValidation: true,
|
|
232
|
+
breadcrumbsPrefix: ["response"],
|
|
233
|
+
}), _response.rawResponse);
|
|
234
|
+
case 412:
|
|
235
|
+
throw new AgentMail.PreconditionFailedError(serializers.PreconditionFailedErrorResponse.parseOrThrow(_response.error.body, {
|
|
236
|
+
unrecognizedObjectKeys: "passthrough",
|
|
237
|
+
allowUnrecognizedUnionMembers: true,
|
|
238
|
+
allowUnrecognizedEnumValues: true,
|
|
239
|
+
skipValidation: true,
|
|
240
|
+
breadcrumbsPrefix: ["response"],
|
|
241
|
+
}), _response.rawResponse);
|
|
242
|
+
case 413:
|
|
243
|
+
throw new AgentMail.PayloadTooLargeError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
244
|
+
unrecognizedObjectKeys: "passthrough",
|
|
245
|
+
allowUnrecognizedUnionMembers: true,
|
|
246
|
+
allowUnrecognizedEnumValues: true,
|
|
247
|
+
skipValidation: true,
|
|
248
|
+
breadcrumbsPrefix: ["response"],
|
|
249
|
+
}), _response.rawResponse);
|
|
250
|
+
default:
|
|
251
|
+
throw new errors.AgentMailError({
|
|
252
|
+
statusCode: _response.error.statusCode,
|
|
253
|
+
body: _response.error.body,
|
|
254
|
+
rawResponse: _response.rawResponse,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/calendar");
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* @beta This endpoint is in pre-release and may change.
|
|
263
|
+
*
|
|
264
|
+
* Lists the events stored on the calendar: one item per one-off or recurring event, plus one
|
|
265
|
+
* item for each edited date of a recurring event (as that dated event, with
|
|
266
|
+
* `is_exception: true`). Ordered by most recently updated, and cancelled events are included.
|
|
267
|
+
* Use it to sync or manage what you created. To see what is on the calendar in a time window,
|
|
268
|
+
* use Get Agenda.
|
|
269
|
+
*
|
|
270
|
+
* The list is always read in the region that serves the request, so it can trail a change made
|
|
271
|
+
* moments earlier by a few seconds. Requires the `calendar_event_read` permission.
|
|
272
|
+
*
|
|
273
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
274
|
+
*
|
|
275
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
276
|
+
* @param {AgentMail.inboxes.ListCalendarEventsRequest} request
|
|
277
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
278
|
+
*
|
|
279
|
+
* @throws {@link AgentMail.ValidationError}
|
|
280
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
281
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* await client.inboxes.calendar.listEvents("scheduler@agentmail.to", {
|
|
285
|
+
* limit: 50
|
|
286
|
+
* })
|
|
287
|
+
*/
|
|
288
|
+
listEvents(inbox_id, request = {}, requestOptions) {
|
|
289
|
+
return core.HttpResponsePromise.fromPromise(this.__listEvents(inbox_id, request, requestOptions));
|
|
290
|
+
}
|
|
291
|
+
__listEvents(inbox_id_1) {
|
|
292
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
293
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
294
|
+
const { limit, pageToken } = request;
|
|
295
|
+
const _queryParams = {
|
|
296
|
+
limit,
|
|
297
|
+
page_token: pageToken,
|
|
298
|
+
};
|
|
299
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
300
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
301
|
+
const _response = yield core.fetcher({
|
|
302
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
303
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/events`),
|
|
304
|
+
method: "GET",
|
|
305
|
+
headers: _headers,
|
|
306
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
307
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
308
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
309
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
310
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
311
|
+
logging: this._options.logging,
|
|
312
|
+
});
|
|
313
|
+
if (_response.ok) {
|
|
314
|
+
return {
|
|
315
|
+
data: serializers.ListCalendarEventsResponse.parseOrThrow(_response.body, {
|
|
316
|
+
unrecognizedObjectKeys: "passthrough",
|
|
317
|
+
allowUnrecognizedUnionMembers: true,
|
|
318
|
+
allowUnrecognizedEnumValues: true,
|
|
319
|
+
skipValidation: true,
|
|
320
|
+
breadcrumbsPrefix: ["response"],
|
|
321
|
+
}),
|
|
322
|
+
rawResponse: _response.rawResponse,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
if (_response.error.reason === "status-code") {
|
|
326
|
+
switch (_response.error.statusCode) {
|
|
327
|
+
case 400:
|
|
328
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
329
|
+
unrecognizedObjectKeys: "passthrough",
|
|
330
|
+
allowUnrecognizedUnionMembers: true,
|
|
331
|
+
allowUnrecognizedEnumValues: true,
|
|
332
|
+
skipValidation: true,
|
|
333
|
+
breadcrumbsPrefix: ["response"],
|
|
334
|
+
}), _response.rawResponse);
|
|
335
|
+
case 403:
|
|
336
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
337
|
+
unrecognizedObjectKeys: "passthrough",
|
|
338
|
+
allowUnrecognizedUnionMembers: true,
|
|
339
|
+
allowUnrecognizedEnumValues: true,
|
|
340
|
+
skipValidation: true,
|
|
341
|
+
breadcrumbsPrefix: ["response"],
|
|
342
|
+
}), _response.rawResponse);
|
|
343
|
+
case 404:
|
|
344
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
345
|
+
unrecognizedObjectKeys: "passthrough",
|
|
346
|
+
allowUnrecognizedUnionMembers: true,
|
|
347
|
+
allowUnrecognizedEnumValues: true,
|
|
348
|
+
skipValidation: true,
|
|
349
|
+
breadcrumbsPrefix: ["response"],
|
|
350
|
+
}), _response.rawResponse);
|
|
351
|
+
default:
|
|
352
|
+
throw new errors.AgentMailError({
|
|
353
|
+
statusCode: _response.error.statusCode,
|
|
354
|
+
body: _response.error.body,
|
|
355
|
+
rawResponse: _response.rawResponse,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/calendar/events");
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @beta This endpoint is in pre-release and may change.
|
|
364
|
+
*
|
|
365
|
+
* Lists every date on the calendar in a time window, ordered by start time: one-off events,
|
|
366
|
+
* and recurring events expanded into their individual dates, with cancelled dates left out.
|
|
367
|
+
* Use it to answer "what is on the calendar".
|
|
368
|
+
*
|
|
369
|
+
* The window defaults to now through 90 days from now and can be at most 366 days. Items omit
|
|
370
|
+
* `description`, `metadata` and `attendees`; get an event by ID for the full object. Dates of
|
|
371
|
+
* recurring events appear only up to about 90 days from now; use List Event Instances for a
|
|
372
|
+
* recurring event's later dates. While a recurring event's dates are being regenerated after a
|
|
373
|
+
* schedule change, which takes a few seconds, the agenda can briefly leave out some of them;
|
|
374
|
+
* dates that have already started or ended stay as they ran.
|
|
375
|
+
*
|
|
376
|
+
* The agenda is read in the region that serves the request, so it can trail a change made
|
|
377
|
+
* moments earlier by a few seconds. Pass `consistency=primary` to read your own change right
|
|
378
|
+
* away. Requires the `calendar_event_read` permission.
|
|
379
|
+
*
|
|
380
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
381
|
+
*
|
|
382
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
383
|
+
* @param {AgentMail.inboxes.GetCalendarAgendaRequest} request
|
|
384
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
385
|
+
*
|
|
386
|
+
* @throws {@link AgentMail.ValidationError}
|
|
387
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
388
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* await client.inboxes.calendar.getAgenda("scheduler@agentmail.to", {
|
|
392
|
+
* after: new Date("2026-10-07T00:00:00.000Z"),
|
|
393
|
+
* before: new Date("2026-10-16T00:00:00.000Z"),
|
|
394
|
+
* limit: 3
|
|
395
|
+
* })
|
|
396
|
+
*/
|
|
397
|
+
getAgenda(inbox_id, request = {}, requestOptions) {
|
|
398
|
+
return core.HttpResponsePromise.fromPromise(this.__getAgenda(inbox_id, request, requestOptions));
|
|
399
|
+
}
|
|
400
|
+
__getAgenda(inbox_id_1) {
|
|
401
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
402
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
403
|
+
const { consistency, after, before, includeOverlapping, limit, pageToken } = request;
|
|
404
|
+
const _queryParams = {
|
|
405
|
+
consistency: consistency != null
|
|
406
|
+
? serializers.CalendarConsistency.jsonOrThrow(consistency, {
|
|
407
|
+
unrecognizedObjectKeys: "strip",
|
|
408
|
+
omitUndefined: true,
|
|
409
|
+
})
|
|
410
|
+
: undefined,
|
|
411
|
+
after: after != null
|
|
412
|
+
? serializers.WindowAfter.jsonOrThrow(after, {
|
|
413
|
+
unrecognizedObjectKeys: "strip",
|
|
414
|
+
omitUndefined: true,
|
|
415
|
+
})
|
|
416
|
+
: undefined,
|
|
417
|
+
before: before != null
|
|
418
|
+
? serializers.WindowBefore.jsonOrThrow(before, {
|
|
419
|
+
unrecognizedObjectKeys: "strip",
|
|
420
|
+
omitUndefined: true,
|
|
421
|
+
})
|
|
422
|
+
: undefined,
|
|
423
|
+
include_overlapping: includeOverlapping,
|
|
424
|
+
limit,
|
|
425
|
+
page_token: pageToken,
|
|
426
|
+
};
|
|
427
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
428
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
429
|
+
const _response = yield core.fetcher({
|
|
430
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
431
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/agenda`),
|
|
432
|
+
method: "GET",
|
|
433
|
+
headers: _headers,
|
|
434
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
435
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
436
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
437
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
438
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
439
|
+
logging: this._options.logging,
|
|
440
|
+
});
|
|
441
|
+
if (_response.ok) {
|
|
442
|
+
return {
|
|
443
|
+
data: serializers.ListCalendarEventsResponse.parseOrThrow(_response.body, {
|
|
444
|
+
unrecognizedObjectKeys: "passthrough",
|
|
445
|
+
allowUnrecognizedUnionMembers: true,
|
|
446
|
+
allowUnrecognizedEnumValues: true,
|
|
447
|
+
skipValidation: true,
|
|
448
|
+
breadcrumbsPrefix: ["response"],
|
|
449
|
+
}),
|
|
450
|
+
rawResponse: _response.rawResponse,
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
if (_response.error.reason === "status-code") {
|
|
454
|
+
switch (_response.error.statusCode) {
|
|
455
|
+
case 400:
|
|
456
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
457
|
+
unrecognizedObjectKeys: "passthrough",
|
|
458
|
+
allowUnrecognizedUnionMembers: true,
|
|
459
|
+
allowUnrecognizedEnumValues: true,
|
|
460
|
+
skipValidation: true,
|
|
461
|
+
breadcrumbsPrefix: ["response"],
|
|
462
|
+
}), _response.rawResponse);
|
|
463
|
+
case 403:
|
|
464
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
465
|
+
unrecognizedObjectKeys: "passthrough",
|
|
466
|
+
allowUnrecognizedUnionMembers: true,
|
|
467
|
+
allowUnrecognizedEnumValues: true,
|
|
468
|
+
skipValidation: true,
|
|
469
|
+
breadcrumbsPrefix: ["response"],
|
|
470
|
+
}), _response.rawResponse);
|
|
471
|
+
case 404:
|
|
472
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
473
|
+
unrecognizedObjectKeys: "passthrough",
|
|
474
|
+
allowUnrecognizedUnionMembers: true,
|
|
475
|
+
allowUnrecognizedEnumValues: true,
|
|
476
|
+
skipValidation: true,
|
|
477
|
+
breadcrumbsPrefix: ["response"],
|
|
478
|
+
}), _response.rawResponse);
|
|
479
|
+
default:
|
|
480
|
+
throw new errors.AgentMailError({
|
|
481
|
+
statusCode: _response.error.statusCode,
|
|
482
|
+
body: _response.error.body,
|
|
483
|
+
rawResponse: _response.rawResponse,
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/calendar/agenda");
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* @beta This endpoint is in pre-release and may change.
|
|
492
|
+
*
|
|
493
|
+
* Creates a one-off or recurring event on the inbox's calendar. Times are wall-clock values in
|
|
494
|
+
* `timezone` (the calendar's default time zone if omitted); the response also gives each
|
|
495
|
+
* boundary as a UTC instant in `start_at` and `end_at`.
|
|
496
|
+
*
|
|
497
|
+
* `calendar.event.created` is sent once the event is stored, then `calendar.event.starting`
|
|
498
|
+
* and `calendar.event.ending` as each date begins and ends. With `send_invites: true` the
|
|
499
|
+
* inbox also emails an invitation to every attendee.
|
|
500
|
+
*
|
|
501
|
+
* Pass `client_id` to make retries safe: repeating the request with the same `client_id` and
|
|
502
|
+
* body returns the original event with status `200` instead of `201`, for as long as the event
|
|
503
|
+
* exists.
|
|
504
|
+
*
|
|
505
|
+
* With `send_invites: true`, each attendee counts as one send against the organization, pod
|
|
506
|
+
* and inbox send limits, charged before the event is stored. An over-limit request returns
|
|
507
|
+
* `429` `rate_limit_exceeded` and creates nothing. A replay of an earlier create is not
|
|
508
|
+
* charged again.
|
|
509
|
+
*
|
|
510
|
+
* The event's `etag` is the value to send in `If-Match` to make a later update or delete
|
|
511
|
+
* conditional. Requires the `calendar_event_create` permission.
|
|
512
|
+
*
|
|
513
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
514
|
+
*
|
|
515
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
516
|
+
* @param {AgentMail.CreateCalendarEventRequest} request
|
|
517
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
518
|
+
*
|
|
519
|
+
* @throws {@link AgentMail.ValidationError}
|
|
520
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
521
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
522
|
+
* @throws {@link AgentMail.ConflictError}
|
|
523
|
+
* @throws {@link AgentMail.PayloadTooLargeError}
|
|
524
|
+
* @throws {@link AgentMail.RateLimitError}
|
|
525
|
+
*
|
|
526
|
+
* @example
|
|
527
|
+
* await client.inboxes.calendar.createEvent("scheduler@agentmail.to", {
|
|
528
|
+
* clientId: "intro-acme-2026-10-15",
|
|
529
|
+
* title: "Intro call with Acme",
|
|
530
|
+
* description: "Walk Jane through the onboarding plan.",
|
|
531
|
+
* location: "https://meet.example.com/acme-intro",
|
|
532
|
+
* metadata: {
|
|
533
|
+
* "crm_deal_id": "D-1042"
|
|
534
|
+
* },
|
|
535
|
+
* start: "2026-10-15T14:00:00",
|
|
536
|
+
* end: "2026-10-15T14:30:00",
|
|
537
|
+
* timezone: "America/New_York",
|
|
538
|
+
* attendees: [{
|
|
539
|
+
* email: "jane@acme.com",
|
|
540
|
+
* name: "Jane Doe"
|
|
541
|
+
* }],
|
|
542
|
+
* sendInvites: true
|
|
543
|
+
* })
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
* await client.inboxes.calendar.createEvent("scheduler@agentmail.to", {
|
|
547
|
+
* title: "Team standup",
|
|
548
|
+
* location: "https://meet.example.com/standup",
|
|
549
|
+
* start: "2026-10-05T09:00:00",
|
|
550
|
+
* end: "2026-10-05T09:15:00",
|
|
551
|
+
* timezone: "America/New_York",
|
|
552
|
+
* recurrence: {
|
|
553
|
+
* rule: "FREQ=WEEKLY;BYDAY=MO,WE,FR"
|
|
554
|
+
* }
|
|
555
|
+
* })
|
|
556
|
+
*/
|
|
557
|
+
createEvent(inbox_id, request, requestOptions) {
|
|
558
|
+
return core.HttpResponsePromise.fromPromise(this.__createEvent(inbox_id, request, requestOptions));
|
|
559
|
+
}
|
|
560
|
+
__createEvent(inbox_id, request, requestOptions) {
|
|
561
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
563
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
564
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
565
|
+
const _response = yield core.fetcher({
|
|
566
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
567
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/events`),
|
|
568
|
+
method: "POST",
|
|
569
|
+
headers: _headers,
|
|
570
|
+
contentType: "application/json",
|
|
571
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
572
|
+
requestType: "json",
|
|
573
|
+
body: serializers.CreateCalendarEventRequest.jsonOrThrow(request, {
|
|
574
|
+
unrecognizedObjectKeys: "strip",
|
|
575
|
+
omitUndefined: true,
|
|
576
|
+
}),
|
|
577
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
578
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
579
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
580
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
581
|
+
logging: this._options.logging,
|
|
582
|
+
});
|
|
583
|
+
if (_response.ok) {
|
|
584
|
+
return {
|
|
585
|
+
data: serializers.CalendarEventMutationResponse.parseOrThrow(_response.body, {
|
|
586
|
+
unrecognizedObjectKeys: "passthrough",
|
|
587
|
+
allowUnrecognizedUnionMembers: true,
|
|
588
|
+
allowUnrecognizedEnumValues: true,
|
|
589
|
+
skipValidation: true,
|
|
590
|
+
breadcrumbsPrefix: ["response"],
|
|
591
|
+
}),
|
|
592
|
+
rawResponse: _response.rawResponse,
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
if (_response.error.reason === "status-code") {
|
|
596
|
+
switch (_response.error.statusCode) {
|
|
597
|
+
case 400:
|
|
598
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
599
|
+
unrecognizedObjectKeys: "passthrough",
|
|
600
|
+
allowUnrecognizedUnionMembers: true,
|
|
601
|
+
allowUnrecognizedEnumValues: true,
|
|
602
|
+
skipValidation: true,
|
|
603
|
+
breadcrumbsPrefix: ["response"],
|
|
604
|
+
}), _response.rawResponse);
|
|
605
|
+
case 403:
|
|
606
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
607
|
+
unrecognizedObjectKeys: "passthrough",
|
|
608
|
+
allowUnrecognizedUnionMembers: true,
|
|
609
|
+
allowUnrecognizedEnumValues: true,
|
|
610
|
+
skipValidation: true,
|
|
611
|
+
breadcrumbsPrefix: ["response"],
|
|
612
|
+
}), _response.rawResponse);
|
|
613
|
+
case 404:
|
|
614
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
615
|
+
unrecognizedObjectKeys: "passthrough",
|
|
616
|
+
allowUnrecognizedUnionMembers: true,
|
|
617
|
+
allowUnrecognizedEnumValues: true,
|
|
618
|
+
skipValidation: true,
|
|
619
|
+
breadcrumbsPrefix: ["response"],
|
|
620
|
+
}), _response.rawResponse);
|
|
621
|
+
case 409:
|
|
622
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
623
|
+
unrecognizedObjectKeys: "passthrough",
|
|
624
|
+
allowUnrecognizedUnionMembers: true,
|
|
625
|
+
allowUnrecognizedEnumValues: true,
|
|
626
|
+
skipValidation: true,
|
|
627
|
+
breadcrumbsPrefix: ["response"],
|
|
628
|
+
}), _response.rawResponse);
|
|
629
|
+
case 413:
|
|
630
|
+
throw new AgentMail.PayloadTooLargeError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
631
|
+
unrecognizedObjectKeys: "passthrough",
|
|
632
|
+
allowUnrecognizedUnionMembers: true,
|
|
633
|
+
allowUnrecognizedEnumValues: true,
|
|
634
|
+
skipValidation: true,
|
|
635
|
+
breadcrumbsPrefix: ["response"],
|
|
636
|
+
}), _response.rawResponse);
|
|
637
|
+
case 429:
|
|
638
|
+
throw new AgentMail.RateLimitError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
639
|
+
unrecognizedObjectKeys: "passthrough",
|
|
640
|
+
allowUnrecognizedUnionMembers: true,
|
|
641
|
+
allowUnrecognizedEnumValues: true,
|
|
642
|
+
skipValidation: true,
|
|
643
|
+
breadcrumbsPrefix: ["response"],
|
|
644
|
+
}), _response.rawResponse);
|
|
645
|
+
default:
|
|
646
|
+
throw new errors.AgentMailError({
|
|
647
|
+
statusCode: _response.error.statusCode,
|
|
648
|
+
body: _response.error.body,
|
|
649
|
+
rawResponse: _response.rawResponse,
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/calendar/events");
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* @beta This endpoint is in pre-release and may change.
|
|
658
|
+
*
|
|
659
|
+
* Gets an event by its UUID, or one date of a recurring event by its dated ID
|
|
660
|
+
* (`<uuid>_<slot>`). A dated ID returns the date as it currently stands, including any edit
|
|
661
|
+
* to it, with `kind: instance`.
|
|
662
|
+
*
|
|
663
|
+
* The response's `etag` (also the `ETag` header) is the value to send in `If-Match` to make an
|
|
664
|
+
* update, delete or response to this event or date conditional. Treat it as opaque.
|
|
665
|
+
*
|
|
666
|
+
* Reads can trail a change made moments earlier by a few seconds; pass `consistency=primary`
|
|
667
|
+
* to read the latest state of an event or a date. A date that has already started or ended
|
|
668
|
+
* reads back as it ran, even if a later change to the series no longer produces it. Requires
|
|
669
|
+
* the `calendar_event_read` permission.
|
|
670
|
+
*
|
|
671
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
672
|
+
*
|
|
673
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
674
|
+
* @param {AgentMail.CalendarEventId} event_id
|
|
675
|
+
* @param {AgentMail.inboxes.GetCalendarEventRequest} request
|
|
676
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
677
|
+
*
|
|
678
|
+
* @throws {@link AgentMail.ValidationError}
|
|
679
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
680
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
681
|
+
* @throws {@link AgentMail.EventExpiredError}
|
|
682
|
+
*
|
|
683
|
+
* @example
|
|
684
|
+
* await client.inboxes.calendar.getEvent("scheduler@agentmail.to", "3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36")
|
|
685
|
+
*
|
|
686
|
+
* @example
|
|
687
|
+
* await client.inboxes.calendar.getEvent("scheduler@agentmail.to", "7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000")
|
|
688
|
+
*/
|
|
689
|
+
getEvent(inbox_id, event_id, request = {}, requestOptions) {
|
|
690
|
+
return core.HttpResponsePromise.fromPromise(this.__getEvent(inbox_id, event_id, request, requestOptions));
|
|
691
|
+
}
|
|
692
|
+
__getEvent(inbox_id_1, event_id_1) {
|
|
693
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, event_id, request = {}, requestOptions) {
|
|
694
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
695
|
+
const { consistency } = request;
|
|
696
|
+
const _queryParams = {
|
|
697
|
+
consistency: consistency != null
|
|
698
|
+
? serializers.CalendarConsistency.jsonOrThrow(consistency, {
|
|
699
|
+
unrecognizedObjectKeys: "strip",
|
|
700
|
+
omitUndefined: true,
|
|
701
|
+
})
|
|
702
|
+
: undefined,
|
|
703
|
+
};
|
|
704
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
705
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
706
|
+
const _response = yield core.fetcher({
|
|
707
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
708
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/events/${core.url.encodePathParam(serializers.CalendarEventId.jsonOrThrow(event_id, { omitUndefined: true }))}`),
|
|
709
|
+
method: "GET",
|
|
710
|
+
headers: _headers,
|
|
711
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
712
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
713
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
714
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
715
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
716
|
+
logging: this._options.logging,
|
|
717
|
+
});
|
|
718
|
+
if (_response.ok) {
|
|
719
|
+
return {
|
|
720
|
+
data: serializers.CalendarEvent.parseOrThrow(_response.body, {
|
|
721
|
+
unrecognizedObjectKeys: "passthrough",
|
|
722
|
+
allowUnrecognizedUnionMembers: true,
|
|
723
|
+
allowUnrecognizedEnumValues: true,
|
|
724
|
+
skipValidation: true,
|
|
725
|
+
breadcrumbsPrefix: ["response"],
|
|
726
|
+
}),
|
|
727
|
+
rawResponse: _response.rawResponse,
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
if (_response.error.reason === "status-code") {
|
|
731
|
+
switch (_response.error.statusCode) {
|
|
732
|
+
case 400:
|
|
733
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
734
|
+
unrecognizedObjectKeys: "passthrough",
|
|
735
|
+
allowUnrecognizedUnionMembers: true,
|
|
736
|
+
allowUnrecognizedEnumValues: true,
|
|
737
|
+
skipValidation: true,
|
|
738
|
+
breadcrumbsPrefix: ["response"],
|
|
739
|
+
}), _response.rawResponse);
|
|
740
|
+
case 403:
|
|
741
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
742
|
+
unrecognizedObjectKeys: "passthrough",
|
|
743
|
+
allowUnrecognizedUnionMembers: true,
|
|
744
|
+
allowUnrecognizedEnumValues: true,
|
|
745
|
+
skipValidation: true,
|
|
746
|
+
breadcrumbsPrefix: ["response"],
|
|
747
|
+
}), _response.rawResponse);
|
|
748
|
+
case 404:
|
|
749
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
750
|
+
unrecognizedObjectKeys: "passthrough",
|
|
751
|
+
allowUnrecognizedUnionMembers: true,
|
|
752
|
+
allowUnrecognizedEnumValues: true,
|
|
753
|
+
skipValidation: true,
|
|
754
|
+
breadcrumbsPrefix: ["response"],
|
|
755
|
+
}), _response.rawResponse);
|
|
756
|
+
case 410:
|
|
757
|
+
throw new AgentMail.EventExpiredError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
758
|
+
unrecognizedObjectKeys: "passthrough",
|
|
759
|
+
allowUnrecognizedUnionMembers: true,
|
|
760
|
+
allowUnrecognizedEnumValues: true,
|
|
761
|
+
skipValidation: true,
|
|
762
|
+
breadcrumbsPrefix: ["response"],
|
|
763
|
+
}), _response.rawResponse);
|
|
764
|
+
default:
|
|
765
|
+
throw new errors.AgentMailError({
|
|
766
|
+
statusCode: _response.error.statusCode,
|
|
767
|
+
body: _response.error.body,
|
|
768
|
+
rawResponse: _response.rawResponse,
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/calendar/events/{event_id}");
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* @beta This endpoint is in pre-release and may change.
|
|
777
|
+
*
|
|
778
|
+
* Updates an event. Send only the fields to change. To make the update conditional, send the
|
|
779
|
+
* event's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the
|
|
780
|
+
* update applies to the event as it is; a change that lands while it runs returns `409`
|
|
781
|
+
* `race_condition`, so retry. Send `If-Match` when replacing `attendees`, so you don't
|
|
782
|
+
* overwrite a response that arrived in the meantime.
|
|
783
|
+
*
|
|
784
|
+
* - **One-off or series UUID:** changes the event itself. For a series, the change applies to
|
|
785
|
+
* every date that has not been edited individually.
|
|
786
|
+
* - **Dated ID (`<uuid>_<slot>`):** changes one date (`mode=single`, the default) or that date
|
|
787
|
+
* and every later date (`mode=future`). `all_day`, `timezone` and `recurrence` cannot be sent
|
|
788
|
+
* for a dated ID.
|
|
789
|
+
*
|
|
790
|
+
* Once a date has started, its start can no longer change (409 `event_already_started`), but
|
|
791
|
+
* its end and status can; for a one-off or series UUID, send the unchanged `start` with the new
|
|
792
|
+
* `end`. Once it has ended, only `title`, `description`, `location`,
|
|
793
|
+
* `metadata` and `attendees` can change. During the few seconds a date is starting, schedule
|
|
794
|
+
* changes return 409 `event_starting`; retry shortly.
|
|
795
|
+
*
|
|
796
|
+
* Sends `calendar.event.updated`. With `send_invites: true` the organizer inbox also emails the
|
|
797
|
+
* updated invitation to every attendee. Requires the `calendar_event_update` permission.
|
|
798
|
+
*
|
|
799
|
+
* Emailing attendees counts one send per attendee against the organization, pod and inbox
|
|
800
|
+
* send limits, charged before the change is saved; an over-limit request returns `429`
|
|
801
|
+
* `rate_limit_exceeded` and changes nothing.
|
|
802
|
+
*
|
|
803
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
804
|
+
*
|
|
805
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
806
|
+
* @param {AgentMail.CalendarEventId} event_id
|
|
807
|
+
* @param {AgentMail.inboxes.UpdateCalendarEventRequestWrapper} request
|
|
808
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
809
|
+
*
|
|
810
|
+
* @throws {@link AgentMail.ValidationError}
|
|
811
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
812
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
813
|
+
* @throws {@link AgentMail.ConflictError}
|
|
814
|
+
* @throws {@link AgentMail.EventExpiredError}
|
|
815
|
+
* @throws {@link AgentMail.PreconditionFailedError}
|
|
816
|
+
* @throws {@link AgentMail.PayloadTooLargeError}
|
|
817
|
+
* @throws {@link AgentMail.RateLimitError}
|
|
818
|
+
*
|
|
819
|
+
* @example
|
|
820
|
+
* await client.inboxes.calendar.updateEvent("scheduler@agentmail.to", "3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36", {
|
|
821
|
+
* start: "2026-10-15T15:00:00",
|
|
822
|
+
* end: "2026-10-15T15:30:00",
|
|
823
|
+
* sendInvites: true
|
|
824
|
+
* })
|
|
825
|
+
*
|
|
826
|
+
* @example
|
|
827
|
+
* await client.inboxes.calendar.updateEvent("scheduler@agentmail.to", "7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000", {
|
|
828
|
+
* mode: "single",
|
|
829
|
+
* start: "2026-10-07T10:00:00",
|
|
830
|
+
* end: "2026-10-07T10:15:00"
|
|
831
|
+
* })
|
|
832
|
+
*/
|
|
833
|
+
updateEvent(inbox_id, event_id, request = {}, requestOptions) {
|
|
834
|
+
return core.HttpResponsePromise.fromPromise(this.__updateEvent(inbox_id, event_id, request, requestOptions));
|
|
835
|
+
}
|
|
836
|
+
__updateEvent(inbox_id_1, event_id_1) {
|
|
837
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, event_id, request = {}, requestOptions) {
|
|
838
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
839
|
+
const { mode, ifMatch } = request, _body = __rest(request, ["mode", "ifMatch"]);
|
|
840
|
+
const _queryParams = {
|
|
841
|
+
mode: mode != null
|
|
842
|
+
? serializers.InstanceMutationMode.jsonOrThrow(mode, {
|
|
843
|
+
unrecognizedObjectKeys: "strip",
|
|
844
|
+
omitUndefined: true,
|
|
845
|
+
})
|
|
846
|
+
: undefined,
|
|
847
|
+
};
|
|
848
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
849
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "If-Match": ifMatch }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
850
|
+
const _response = yield core.fetcher({
|
|
851
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
852
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/events/${core.url.encodePathParam(serializers.CalendarEventId.jsonOrThrow(event_id, { omitUndefined: true }))}`),
|
|
853
|
+
method: "PATCH",
|
|
854
|
+
headers: _headers,
|
|
855
|
+
contentType: "application/json",
|
|
856
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
857
|
+
requestType: "json",
|
|
858
|
+
body: serializers.inboxes.UpdateCalendarEventRequestWrapper.jsonOrThrow(_body, {
|
|
859
|
+
unrecognizedObjectKeys: "strip",
|
|
860
|
+
omitUndefined: true,
|
|
861
|
+
}),
|
|
862
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
863
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
864
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
865
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
866
|
+
logging: this._options.logging,
|
|
867
|
+
});
|
|
868
|
+
if (_response.ok) {
|
|
869
|
+
return {
|
|
870
|
+
data: serializers.CalendarEventMutationResponse.parseOrThrow(_response.body, {
|
|
871
|
+
unrecognizedObjectKeys: "passthrough",
|
|
872
|
+
allowUnrecognizedUnionMembers: true,
|
|
873
|
+
allowUnrecognizedEnumValues: true,
|
|
874
|
+
skipValidation: true,
|
|
875
|
+
breadcrumbsPrefix: ["response"],
|
|
876
|
+
}),
|
|
877
|
+
rawResponse: _response.rawResponse,
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
if (_response.error.reason === "status-code") {
|
|
881
|
+
switch (_response.error.statusCode) {
|
|
882
|
+
case 400:
|
|
883
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
884
|
+
unrecognizedObjectKeys: "passthrough",
|
|
885
|
+
allowUnrecognizedUnionMembers: true,
|
|
886
|
+
allowUnrecognizedEnumValues: true,
|
|
887
|
+
skipValidation: true,
|
|
888
|
+
breadcrumbsPrefix: ["response"],
|
|
889
|
+
}), _response.rawResponse);
|
|
890
|
+
case 403:
|
|
891
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
892
|
+
unrecognizedObjectKeys: "passthrough",
|
|
893
|
+
allowUnrecognizedUnionMembers: true,
|
|
894
|
+
allowUnrecognizedEnumValues: true,
|
|
895
|
+
skipValidation: true,
|
|
896
|
+
breadcrumbsPrefix: ["response"],
|
|
897
|
+
}), _response.rawResponse);
|
|
898
|
+
case 404:
|
|
899
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
900
|
+
unrecognizedObjectKeys: "passthrough",
|
|
901
|
+
allowUnrecognizedUnionMembers: true,
|
|
902
|
+
allowUnrecognizedEnumValues: true,
|
|
903
|
+
skipValidation: true,
|
|
904
|
+
breadcrumbsPrefix: ["response"],
|
|
905
|
+
}), _response.rawResponse);
|
|
906
|
+
case 409:
|
|
907
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
908
|
+
unrecognizedObjectKeys: "passthrough",
|
|
909
|
+
allowUnrecognizedUnionMembers: true,
|
|
910
|
+
allowUnrecognizedEnumValues: true,
|
|
911
|
+
skipValidation: true,
|
|
912
|
+
breadcrumbsPrefix: ["response"],
|
|
913
|
+
}), _response.rawResponse);
|
|
914
|
+
case 410:
|
|
915
|
+
throw new AgentMail.EventExpiredError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
916
|
+
unrecognizedObjectKeys: "passthrough",
|
|
917
|
+
allowUnrecognizedUnionMembers: true,
|
|
918
|
+
allowUnrecognizedEnumValues: true,
|
|
919
|
+
skipValidation: true,
|
|
920
|
+
breadcrumbsPrefix: ["response"],
|
|
921
|
+
}), _response.rawResponse);
|
|
922
|
+
case 412:
|
|
923
|
+
throw new AgentMail.PreconditionFailedError(serializers.PreconditionFailedErrorResponse.parseOrThrow(_response.error.body, {
|
|
924
|
+
unrecognizedObjectKeys: "passthrough",
|
|
925
|
+
allowUnrecognizedUnionMembers: true,
|
|
926
|
+
allowUnrecognizedEnumValues: true,
|
|
927
|
+
skipValidation: true,
|
|
928
|
+
breadcrumbsPrefix: ["response"],
|
|
929
|
+
}), _response.rawResponse);
|
|
930
|
+
case 413:
|
|
931
|
+
throw new AgentMail.PayloadTooLargeError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
932
|
+
unrecognizedObjectKeys: "passthrough",
|
|
933
|
+
allowUnrecognizedUnionMembers: true,
|
|
934
|
+
allowUnrecognizedEnumValues: true,
|
|
935
|
+
skipValidation: true,
|
|
936
|
+
breadcrumbsPrefix: ["response"],
|
|
937
|
+
}), _response.rawResponse);
|
|
938
|
+
case 429:
|
|
939
|
+
throw new AgentMail.RateLimitError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
940
|
+
unrecognizedObjectKeys: "passthrough",
|
|
941
|
+
allowUnrecognizedUnionMembers: true,
|
|
942
|
+
allowUnrecognizedEnumValues: true,
|
|
943
|
+
skipValidation: true,
|
|
944
|
+
breadcrumbsPrefix: ["response"],
|
|
945
|
+
}), _response.rawResponse);
|
|
946
|
+
default:
|
|
947
|
+
throw new errors.AgentMailError({
|
|
948
|
+
statusCode: _response.error.statusCode,
|
|
949
|
+
body: _response.error.body,
|
|
950
|
+
rawResponse: _response.rawResponse,
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/calendar/events/{event_id}");
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* @beta This endpoint is in pre-release and may change.
|
|
959
|
+
*
|
|
960
|
+
* Deletes an event, or cancels dates of a recurring event.
|
|
961
|
+
*
|
|
962
|
+
* - **One-off or series UUID:** deletes the event and every date of it. The event disappears
|
|
963
|
+
* from reads immediately and is removed in the background; the response is `202` with a
|
|
964
|
+
* `deletion_id`. A retry returns the same `deletion_id` while removal runs (send the same
|
|
965
|
+
* `Idempotency-Key`, or none and the same `send_invites`); once it has finished, the event
|
|
966
|
+
* no longer exists and a retry returns `404`. No `calendar.event.starting` or
|
|
967
|
+
* `calendar.event.ending` webhook is sent for the event after the delete is accepted.
|
|
968
|
+
* - **Dated ID (`<uuid>_<slot>`):** cancels that date (`mode=single`, the default) or that date
|
|
969
|
+
* and every later date (`mode=future`). Returns `202` with the cancelled date. A `mode=future`
|
|
970
|
+
* delete from the first date deletes the whole series and returns a `deletion_id` instead.
|
|
971
|
+
* A date that is already running still gets its `calendar.event.ending`.
|
|
972
|
+
*
|
|
973
|
+
* Deleting a one-off or series event sends `calendar.event.deleted`. Cancelling dates sends
|
|
974
|
+
* `calendar.event.updated` with the cancelled date. With `send_invites=true` the organizer
|
|
975
|
+
* inbox also emails a cancellation to every attendee. Requires the `calendar_event_delete`
|
|
976
|
+
* permission. To make the delete conditional, send the current `etag` in `If-Match`.
|
|
977
|
+
*
|
|
978
|
+
* Emailing cancellations counts one send per attendee against the organization, pod and inbox
|
|
979
|
+
* send limits, charged before the delete; an over-limit request returns `429`
|
|
980
|
+
* `rate_limit_exceeded` and deletes nothing.
|
|
981
|
+
*
|
|
982
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
983
|
+
*
|
|
984
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
985
|
+
* @param {AgentMail.CalendarEventId} event_id
|
|
986
|
+
* @param {AgentMail.inboxes.DeleteCalendarEventRequest} request
|
|
987
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
988
|
+
*
|
|
989
|
+
* @throws {@link AgentMail.ValidationError}
|
|
990
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
991
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
992
|
+
* @throws {@link AgentMail.ConflictError}
|
|
993
|
+
* @throws {@link AgentMail.EventExpiredError}
|
|
994
|
+
* @throws {@link AgentMail.PreconditionFailedError}
|
|
995
|
+
* @throws {@link AgentMail.RateLimitError}
|
|
996
|
+
*
|
|
997
|
+
* @example
|
|
998
|
+
* await client.inboxes.calendar.deleteEvent("scheduler@agentmail.to", "3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36", {
|
|
999
|
+
* idempotencyKey: "delete-intro-acme",
|
|
1000
|
+
* sendInvites: true
|
|
1001
|
+
* })
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* await client.inboxes.calendar.deleteEvent("scheduler@agentmail.to", "7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000", {
|
|
1005
|
+
* mode: "single"
|
|
1006
|
+
* })
|
|
1007
|
+
*/
|
|
1008
|
+
deleteEvent(inbox_id, event_id, request = {}, requestOptions) {
|
|
1009
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteEvent(inbox_id, event_id, request, requestOptions));
|
|
1010
|
+
}
|
|
1011
|
+
__deleteEvent(inbox_id_1, event_id_1) {
|
|
1012
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, event_id, request = {}, requestOptions) {
|
|
1013
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1014
|
+
const { mode, sendInvites, ifMatch, idempotencyKey } = request;
|
|
1015
|
+
const _queryParams = {
|
|
1016
|
+
mode: mode != null
|
|
1017
|
+
? serializers.InstanceMutationMode.jsonOrThrow(mode, {
|
|
1018
|
+
unrecognizedObjectKeys: "strip",
|
|
1019
|
+
omitUndefined: true,
|
|
1020
|
+
})
|
|
1021
|
+
: undefined,
|
|
1022
|
+
send_invites: sendInvites,
|
|
1023
|
+
};
|
|
1024
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1025
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "If-Match": ifMatch, "Idempotency-Key": idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1026
|
+
const _response = yield core.fetcher({
|
|
1027
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
1028
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/events/${core.url.encodePathParam(serializers.CalendarEventId.jsonOrThrow(event_id, { omitUndefined: true }))}`),
|
|
1029
|
+
method: "DELETE",
|
|
1030
|
+
headers: _headers,
|
|
1031
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1032
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1033
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1034
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1035
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1036
|
+
logging: this._options.logging,
|
|
1037
|
+
});
|
|
1038
|
+
if (_response.ok) {
|
|
1039
|
+
return {
|
|
1040
|
+
data: serializers.DeleteCalendarEventResponse.parseOrThrow(_response.body, {
|
|
1041
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1042
|
+
allowUnrecognizedUnionMembers: true,
|
|
1043
|
+
allowUnrecognizedEnumValues: true,
|
|
1044
|
+
skipValidation: true,
|
|
1045
|
+
breadcrumbsPrefix: ["response"],
|
|
1046
|
+
}),
|
|
1047
|
+
rawResponse: _response.rawResponse,
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
if (_response.error.reason === "status-code") {
|
|
1051
|
+
switch (_response.error.statusCode) {
|
|
1052
|
+
case 400:
|
|
1053
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
1054
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1055
|
+
allowUnrecognizedUnionMembers: true,
|
|
1056
|
+
allowUnrecognizedEnumValues: true,
|
|
1057
|
+
skipValidation: true,
|
|
1058
|
+
breadcrumbsPrefix: ["response"],
|
|
1059
|
+
}), _response.rawResponse);
|
|
1060
|
+
case 403:
|
|
1061
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1062
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1063
|
+
allowUnrecognizedUnionMembers: true,
|
|
1064
|
+
allowUnrecognizedEnumValues: true,
|
|
1065
|
+
skipValidation: true,
|
|
1066
|
+
breadcrumbsPrefix: ["response"],
|
|
1067
|
+
}), _response.rawResponse);
|
|
1068
|
+
case 404:
|
|
1069
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1070
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1071
|
+
allowUnrecognizedUnionMembers: true,
|
|
1072
|
+
allowUnrecognizedEnumValues: true,
|
|
1073
|
+
skipValidation: true,
|
|
1074
|
+
breadcrumbsPrefix: ["response"],
|
|
1075
|
+
}), _response.rawResponse);
|
|
1076
|
+
case 409:
|
|
1077
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1078
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1079
|
+
allowUnrecognizedUnionMembers: true,
|
|
1080
|
+
allowUnrecognizedEnumValues: true,
|
|
1081
|
+
skipValidation: true,
|
|
1082
|
+
breadcrumbsPrefix: ["response"],
|
|
1083
|
+
}), _response.rawResponse);
|
|
1084
|
+
case 410:
|
|
1085
|
+
throw new AgentMail.EventExpiredError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1086
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1087
|
+
allowUnrecognizedUnionMembers: true,
|
|
1088
|
+
allowUnrecognizedEnumValues: true,
|
|
1089
|
+
skipValidation: true,
|
|
1090
|
+
breadcrumbsPrefix: ["response"],
|
|
1091
|
+
}), _response.rawResponse);
|
|
1092
|
+
case 412:
|
|
1093
|
+
throw new AgentMail.PreconditionFailedError(serializers.PreconditionFailedErrorResponse.parseOrThrow(_response.error.body, {
|
|
1094
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1095
|
+
allowUnrecognizedUnionMembers: true,
|
|
1096
|
+
allowUnrecognizedEnumValues: true,
|
|
1097
|
+
skipValidation: true,
|
|
1098
|
+
breadcrumbsPrefix: ["response"],
|
|
1099
|
+
}), _response.rawResponse);
|
|
1100
|
+
case 429:
|
|
1101
|
+
throw new AgentMail.RateLimitError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1102
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1103
|
+
allowUnrecognizedUnionMembers: true,
|
|
1104
|
+
allowUnrecognizedEnumValues: true,
|
|
1105
|
+
skipValidation: true,
|
|
1106
|
+
breadcrumbsPrefix: ["response"],
|
|
1107
|
+
}), _response.rawResponse);
|
|
1108
|
+
default:
|
|
1109
|
+
throw new errors.AgentMailError({
|
|
1110
|
+
statusCode: _response.error.statusCode,
|
|
1111
|
+
body: _response.error.body,
|
|
1112
|
+
rawResponse: _response.rawResponse,
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/calendar/events/{event_id}");
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* @beta This endpoint is in pre-release and may change.
|
|
1121
|
+
*
|
|
1122
|
+
* Lists the dates of one recurring event in a time window, in start order, with each date's
|
|
1123
|
+
* edits applied. Dates are computed from the rule, so this works for any window up to 366
|
|
1124
|
+
* days, including dates far in the future. Cancelled dates are left out.
|
|
1125
|
+
*
|
|
1126
|
+
* The window defaults to now through 90 days from now. Items omit `description`, `metadata`
|
|
1127
|
+
* and `attendees`; get a date by its ID for the full object. Like other reads, the list can
|
|
1128
|
+
* trail a change made moments earlier by a few seconds; pass `consistency=primary` to read
|
|
1129
|
+
* your own change right away. Requires the `calendar_event_read` permission.
|
|
1130
|
+
*
|
|
1131
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
1132
|
+
*
|
|
1133
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
1134
|
+
* @param {string} event_id - UUID of the recurring event.
|
|
1135
|
+
* @param {AgentMail.inboxes.ListCalendarEventInstancesRequest} request
|
|
1136
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1137
|
+
*
|
|
1138
|
+
* @throws {@link AgentMail.ValidationError}
|
|
1139
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
1140
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
1141
|
+
* @throws {@link AgentMail.ConflictError}
|
|
1142
|
+
*
|
|
1143
|
+
* @example
|
|
1144
|
+
* await client.inboxes.calendar.listEventInstances("scheduler@agentmail.to", "7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47", {
|
|
1145
|
+
* after: new Date("2026-10-05T00:00:00.000Z"),
|
|
1146
|
+
* before: new Date("2026-10-10T00:00:00.000Z")
|
|
1147
|
+
* })
|
|
1148
|
+
*/
|
|
1149
|
+
listEventInstances(inbox_id, event_id, request = {}, requestOptions) {
|
|
1150
|
+
return core.HttpResponsePromise.fromPromise(this.__listEventInstances(inbox_id, event_id, request, requestOptions));
|
|
1151
|
+
}
|
|
1152
|
+
__listEventInstances(inbox_id_1, event_id_1) {
|
|
1153
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, event_id, request = {}, requestOptions) {
|
|
1154
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1155
|
+
const { consistency, after, before, includeOverlapping, limit, pageToken } = request;
|
|
1156
|
+
const _queryParams = {
|
|
1157
|
+
consistency: consistency != null
|
|
1158
|
+
? serializers.CalendarConsistency.jsonOrThrow(consistency, {
|
|
1159
|
+
unrecognizedObjectKeys: "strip",
|
|
1160
|
+
omitUndefined: true,
|
|
1161
|
+
})
|
|
1162
|
+
: undefined,
|
|
1163
|
+
after: after != null
|
|
1164
|
+
? serializers.WindowAfter.jsonOrThrow(after, {
|
|
1165
|
+
unrecognizedObjectKeys: "strip",
|
|
1166
|
+
omitUndefined: true,
|
|
1167
|
+
})
|
|
1168
|
+
: undefined,
|
|
1169
|
+
before: before != null
|
|
1170
|
+
? serializers.WindowBefore.jsonOrThrow(before, {
|
|
1171
|
+
unrecognizedObjectKeys: "strip",
|
|
1172
|
+
omitUndefined: true,
|
|
1173
|
+
})
|
|
1174
|
+
: undefined,
|
|
1175
|
+
include_overlapping: includeOverlapping,
|
|
1176
|
+
limit,
|
|
1177
|
+
page_token: pageToken,
|
|
1178
|
+
};
|
|
1179
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1180
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1181
|
+
const _response = yield core.fetcher({
|
|
1182
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
1183
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/events/${core.url.encodePathParam(event_id)}/instances`),
|
|
1184
|
+
method: "GET",
|
|
1185
|
+
headers: _headers,
|
|
1186
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1187
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1188
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1189
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1190
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1191
|
+
logging: this._options.logging,
|
|
1192
|
+
});
|
|
1193
|
+
if (_response.ok) {
|
|
1194
|
+
return {
|
|
1195
|
+
data: serializers.ListCalendarEventsResponse.parseOrThrow(_response.body, {
|
|
1196
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1197
|
+
allowUnrecognizedUnionMembers: true,
|
|
1198
|
+
allowUnrecognizedEnumValues: true,
|
|
1199
|
+
skipValidation: true,
|
|
1200
|
+
breadcrumbsPrefix: ["response"],
|
|
1201
|
+
}),
|
|
1202
|
+
rawResponse: _response.rawResponse,
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
if (_response.error.reason === "status-code") {
|
|
1206
|
+
switch (_response.error.statusCode) {
|
|
1207
|
+
case 400:
|
|
1208
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
1209
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1210
|
+
allowUnrecognizedUnionMembers: true,
|
|
1211
|
+
allowUnrecognizedEnumValues: true,
|
|
1212
|
+
skipValidation: true,
|
|
1213
|
+
breadcrumbsPrefix: ["response"],
|
|
1214
|
+
}), _response.rawResponse);
|
|
1215
|
+
case 403:
|
|
1216
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1217
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1218
|
+
allowUnrecognizedUnionMembers: true,
|
|
1219
|
+
allowUnrecognizedEnumValues: true,
|
|
1220
|
+
skipValidation: true,
|
|
1221
|
+
breadcrumbsPrefix: ["response"],
|
|
1222
|
+
}), _response.rawResponse);
|
|
1223
|
+
case 404:
|
|
1224
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1225
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1226
|
+
allowUnrecognizedUnionMembers: true,
|
|
1227
|
+
allowUnrecognizedEnumValues: true,
|
|
1228
|
+
skipValidation: true,
|
|
1229
|
+
breadcrumbsPrefix: ["response"],
|
|
1230
|
+
}), _response.rawResponse);
|
|
1231
|
+
case 409:
|
|
1232
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1233
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1234
|
+
allowUnrecognizedUnionMembers: true,
|
|
1235
|
+
allowUnrecognizedEnumValues: true,
|
|
1236
|
+
skipValidation: true,
|
|
1237
|
+
breadcrumbsPrefix: ["response"],
|
|
1238
|
+
}), _response.rawResponse);
|
|
1239
|
+
default:
|
|
1240
|
+
throw new errors.AgentMailError({
|
|
1241
|
+
statusCode: _response.error.statusCode,
|
|
1242
|
+
body: _response.error.body,
|
|
1243
|
+
rawResponse: _response.rawResponse,
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/calendar/events/{event_id}/instances");
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* @beta This endpoint is in pre-release and may change.
|
|
1252
|
+
*
|
|
1253
|
+
* Accepts, declines or tentatively accepts an invitation the inbox received by email. Pass the
|
|
1254
|
+
* event's UUID to respond for every date, or a dated ID to respond for one date only.
|
|
1255
|
+
*
|
|
1256
|
+
* Only works on `email` events where the inbox is an attendee; anything else returns 409
|
|
1257
|
+
* `calendar_response_invalid`. Updates the inbox's attendee entry and sends
|
|
1258
|
+
* `calendar.event.responded`. With `send_reply` (default `true`) the inbox emails the response
|
|
1259
|
+
* to the organizer.
|
|
1260
|
+
*
|
|
1261
|
+
* Requires the `calendar_event_update` permission. To make the response conditional, send the
|
|
1262
|
+
* current `etag` in `If-Match`.
|
|
1263
|
+
*
|
|
1264
|
+
* A reply email counts as one send against the organization, pod and inbox send limits,
|
|
1265
|
+
* charged before the response is saved; an over-limit request returns `429`
|
|
1266
|
+
* `rate_limit_exceeded` and changes nothing.
|
|
1267
|
+
*
|
|
1268
|
+
* Calendar is in private beta: organizations without access receive a `403`.
|
|
1269
|
+
*
|
|
1270
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
1271
|
+
* @param {AgentMail.CalendarEventId} event_id
|
|
1272
|
+
* @param {AgentMail.inboxes.RespondCalendarEventRequestWrapper} request
|
|
1273
|
+
* @param {CalendarClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1274
|
+
*
|
|
1275
|
+
* @throws {@link AgentMail.ValidationError}
|
|
1276
|
+
* @throws {@link AgentMail.ForbiddenError}
|
|
1277
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
1278
|
+
* @throws {@link AgentMail.ConflictError}
|
|
1279
|
+
* @throws {@link AgentMail.EventExpiredError}
|
|
1280
|
+
* @throws {@link AgentMail.PreconditionFailedError}
|
|
1281
|
+
* @throws {@link AgentMail.PayloadTooLargeError}
|
|
1282
|
+
* @throws {@link AgentMail.RateLimitError}
|
|
1283
|
+
*
|
|
1284
|
+
* @example
|
|
1285
|
+
* await client.inboxes.calendar.respondToEvent("scheduler@agentmail.to", "a1d5c7e9-2b4f-4c6a-9e8d-3f7b1c5a9d20", {
|
|
1286
|
+
* status: "accepted",
|
|
1287
|
+
* comment: "See you there."
|
|
1288
|
+
* })
|
|
1289
|
+
*/
|
|
1290
|
+
respondToEvent(inbox_id, event_id, request, requestOptions) {
|
|
1291
|
+
return core.HttpResponsePromise.fromPromise(this.__respondToEvent(inbox_id, event_id, request, requestOptions));
|
|
1292
|
+
}
|
|
1293
|
+
__respondToEvent(inbox_id, event_id, request, requestOptions) {
|
|
1294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1295
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1296
|
+
const { ifMatch } = request, _body = __rest(request, ["ifMatch"]);
|
|
1297
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1298
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "If-Match": ifMatch }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1299
|
+
const _response = yield core.fetcher({
|
|
1300
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
1301
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/calendar/events/${core.url.encodePathParam(serializers.CalendarEventId.jsonOrThrow(event_id, { omitUndefined: true }))}/respond`),
|
|
1302
|
+
method: "POST",
|
|
1303
|
+
headers: _headers,
|
|
1304
|
+
contentType: "application/json",
|
|
1305
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1306
|
+
requestType: "json",
|
|
1307
|
+
body: serializers.inboxes.RespondCalendarEventRequestWrapper.jsonOrThrow(_body, {
|
|
1308
|
+
unrecognizedObjectKeys: "strip",
|
|
1309
|
+
omitUndefined: true,
|
|
1310
|
+
}),
|
|
1311
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1312
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1313
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1314
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
1315
|
+
logging: this._options.logging,
|
|
1316
|
+
});
|
|
1317
|
+
if (_response.ok) {
|
|
1318
|
+
return {
|
|
1319
|
+
data: serializers.CalendarEventMutationResponse.parseOrThrow(_response.body, {
|
|
1320
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1321
|
+
allowUnrecognizedUnionMembers: true,
|
|
1322
|
+
allowUnrecognizedEnumValues: true,
|
|
1323
|
+
skipValidation: true,
|
|
1324
|
+
breadcrumbsPrefix: ["response"],
|
|
1325
|
+
}),
|
|
1326
|
+
rawResponse: _response.rawResponse,
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
if (_response.error.reason === "status-code") {
|
|
1330
|
+
switch (_response.error.statusCode) {
|
|
1331
|
+
case 400:
|
|
1332
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
1333
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1334
|
+
allowUnrecognizedUnionMembers: true,
|
|
1335
|
+
allowUnrecognizedEnumValues: true,
|
|
1336
|
+
skipValidation: true,
|
|
1337
|
+
breadcrumbsPrefix: ["response"],
|
|
1338
|
+
}), _response.rawResponse);
|
|
1339
|
+
case 403:
|
|
1340
|
+
throw new AgentMail.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1341
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1342
|
+
allowUnrecognizedUnionMembers: true,
|
|
1343
|
+
allowUnrecognizedEnumValues: true,
|
|
1344
|
+
skipValidation: true,
|
|
1345
|
+
breadcrumbsPrefix: ["response"],
|
|
1346
|
+
}), _response.rawResponse);
|
|
1347
|
+
case 404:
|
|
1348
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1349
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1350
|
+
allowUnrecognizedUnionMembers: true,
|
|
1351
|
+
allowUnrecognizedEnumValues: true,
|
|
1352
|
+
skipValidation: true,
|
|
1353
|
+
breadcrumbsPrefix: ["response"],
|
|
1354
|
+
}), _response.rawResponse);
|
|
1355
|
+
case 409:
|
|
1356
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1357
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1358
|
+
allowUnrecognizedUnionMembers: true,
|
|
1359
|
+
allowUnrecognizedEnumValues: true,
|
|
1360
|
+
skipValidation: true,
|
|
1361
|
+
breadcrumbsPrefix: ["response"],
|
|
1362
|
+
}), _response.rawResponse);
|
|
1363
|
+
case 410:
|
|
1364
|
+
throw new AgentMail.EventExpiredError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1365
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1366
|
+
allowUnrecognizedUnionMembers: true,
|
|
1367
|
+
allowUnrecognizedEnumValues: true,
|
|
1368
|
+
skipValidation: true,
|
|
1369
|
+
breadcrumbsPrefix: ["response"],
|
|
1370
|
+
}), _response.rawResponse);
|
|
1371
|
+
case 412:
|
|
1372
|
+
throw new AgentMail.PreconditionFailedError(serializers.PreconditionFailedErrorResponse.parseOrThrow(_response.error.body, {
|
|
1373
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1374
|
+
allowUnrecognizedUnionMembers: true,
|
|
1375
|
+
allowUnrecognizedEnumValues: true,
|
|
1376
|
+
skipValidation: true,
|
|
1377
|
+
breadcrumbsPrefix: ["response"],
|
|
1378
|
+
}), _response.rawResponse);
|
|
1379
|
+
case 413:
|
|
1380
|
+
throw new AgentMail.PayloadTooLargeError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1381
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1382
|
+
allowUnrecognizedUnionMembers: true,
|
|
1383
|
+
allowUnrecognizedEnumValues: true,
|
|
1384
|
+
skipValidation: true,
|
|
1385
|
+
breadcrumbsPrefix: ["response"],
|
|
1386
|
+
}), _response.rawResponse);
|
|
1387
|
+
case 429:
|
|
1388
|
+
throw new AgentMail.RateLimitError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
1389
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1390
|
+
allowUnrecognizedUnionMembers: true,
|
|
1391
|
+
allowUnrecognizedEnumValues: true,
|
|
1392
|
+
skipValidation: true,
|
|
1393
|
+
breadcrumbsPrefix: ["response"],
|
|
1394
|
+
}), _response.rawResponse);
|
|
1395
|
+
default:
|
|
1396
|
+
throw new errors.AgentMailError({
|
|
1397
|
+
statusCode: _response.error.statusCode,
|
|
1398
|
+
body: _response.error.body,
|
|
1399
|
+
rawResponse: _response.rawResponse,
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/calendar/events/{event_id}/respond");
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
}
|