mailslurp-client
Version:
Official client for MailSlurp Email and SMS API. Create email addresses and phone numbers in Javascript without a mail server. Send and receive real emails in applications or tests.
134 lines (128 loc) • 3.92 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* MailSlurp API
* MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It\'s designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
*
* The version of the OpenAPI document: 6.5.2
* Contact: contact@mailslurp.dev
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* EMAIL_READ webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is read. This happens when an email is requested in full from the API or a user views the email in the dashboard.
* @export
* @interface WebhookEmailReadPayload
*/
export interface WebhookEmailReadPayload {
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @type {string}
* @memberof WebhookEmailReadPayload
*/
messageId: string;
/**
* ID of webhook entity being triggered
* @type {string}
* @memberof WebhookEmailReadPayload
*/
webhookId: string;
/**
* Name of the event type webhook is being triggered for.
* @type {string}
* @memberof WebhookEmailReadPayload
*/
eventName: WebhookEmailReadPayloadEventNameEnum;
/**
* Name of the webhook being triggered
* @type {string}
* @memberof WebhookEmailReadPayload
*/
webhookName?: string | null;
/**
* ID of the email that was received. Use this ID for fetching the email with the `EmailController`.
* @type {string}
* @memberof WebhookEmailReadPayload
*/
emailId: string;
/**
* Id of the inbox
* @type {string}
* @memberof WebhookEmailReadPayload
*/
inboxId: string;
/**
* Is the email read
* @type {boolean}
* @memberof WebhookEmailReadPayload
*/
emailIsRead: boolean;
/**
* Date time of event creation
* @type {Date}
* @memberof WebhookEmailReadPayload
*/
createdAt: Date;
}
/**
* @export
* @enum {string}
*/
export enum WebhookEmailReadPayloadEventNameEnum {
EMAIL_RECEIVED = 'EMAIL_RECEIVED',
NEW_EMAIL = 'NEW_EMAIL',
NEW_CONTACT = 'NEW_CONTACT',
NEW_ATTACHMENT = 'NEW_ATTACHMENT',
EMAIL_OPENED = 'EMAIL_OPENED',
EMAIL_READ = 'EMAIL_READ',
DELIVERY_STATUS = 'DELIVERY_STATUS',
BOUNCE = 'BOUNCE',
BOUNCE_RECIPIENT = 'BOUNCE_RECIPIENT',
NEW_SMS = 'NEW_SMS',
}
export function WebhookEmailReadPayloadFromJSON(
json: any
): WebhookEmailReadPayload {
return WebhookEmailReadPayloadFromJSONTyped(json, false);
}
export function WebhookEmailReadPayloadFromJSONTyped(
json: any,
ignoreDiscriminator: boolean
): WebhookEmailReadPayload {
if (json === undefined || json === null) {
return json;
}
return {
messageId: json['messageId'],
webhookId: json['webhookId'],
eventName: json['eventName'],
webhookName: !exists(json, 'webhookName') ? undefined : json['webhookName'],
emailId: json['emailId'],
inboxId: json['inboxId'],
emailIsRead: json['emailIsRead'],
createdAt: new Date(json['createdAt']),
};
}
export function WebhookEmailReadPayloadToJSON(
value?: WebhookEmailReadPayload | null
): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
messageId: value.messageId,
webhookId: value.webhookId,
eventName: value.eventName,
webhookName: value.webhookName,
emailId: value.emailId,
inboxId: value.inboxId,
emailIsRead: value.emailIsRead,
createdAt: value.createdAt.toISOString(),
};
}