/* tslint:disable */ /* eslint-disable */ /** * MailSlurp API * MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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'; /** * * @export * @interface PostmasterConnectionDto */ export interface PostmasterConnectionDto { /** * * @type {string} * @memberof PostmasterConnectionDto */ id: string; /** * * @type {string} * @memberof PostmasterConnectionDto */ userId: string; /** * * @type {string} * @memberof PostmasterConnectionDto */ status: PostmasterConnectionDtoStatusEnum; /** * * @type {string} * @memberof PostmasterConnectionDto */ connectedEmail?: string | null; /** * * @type {string} * @memberof PostmasterConnectionDto */ scope?: string | null; /** * * @type {Date} * @memberof PostmasterConnectionDto */ expiresAt: Date; /** * * @type {Date} * @memberof PostmasterConnectionDto */ lastSyncedAt?: Date | null; /** * * @type {string} * @memberof PostmasterConnectionDto */ lastError?: string | null; /** * * @type {Date} * @memberof PostmasterConnectionDto */ createdAt: Date; /** * * @type {Date} * @memberof PostmasterConnectionDto */ updatedAt: Date; } /** * @export * @enum {string} */ export enum PostmasterConnectionDtoStatusEnum { CONNECTED = 'CONNECTED', DISCONNECTED = 'DISCONNECTED', ERROR = 'ERROR', } export function PostmasterConnectionDtoFromJSON( json: any ): PostmasterConnectionDto { return PostmasterConnectionDtoFromJSONTyped(json, false); } export function PostmasterConnectionDtoFromJSONTyped( json: any, ignoreDiscriminator: boolean ): PostmasterConnectionDto { if (json === undefined || json === null) { return json; } return { id: json['id'], userId: json['userId'], status: json['status'], connectedEmail: !exists(json, 'connectedEmail') ? undefined : json['connectedEmail'], scope: !exists(json, 'scope') ? undefined : json['scope'], expiresAt: new Date(json['expiresAt']), lastSyncedAt: !exists(json, 'lastSyncedAt') ? undefined : json['lastSyncedAt'] === null ? null : new Date(json['lastSyncedAt']), lastError: !exists(json, 'lastError') ? undefined : json['lastError'], createdAt: new Date(json['createdAt']), updatedAt: new Date(json['updatedAt']), }; } export function PostmasterConnectionDtoToJSON( value?: PostmasterConnectionDto | null ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { id: value.id, userId: value.userId, status: value.status, connectedEmail: value.connectedEmail, scope: value.scope, expiresAt: value.expiresAt.toISOString(), lastSyncedAt: value.lastSyncedAt === undefined ? undefined : value.lastSyncedAt === null ? null : value.lastSyncedAt.toISOString(), lastError: value.lastError, createdAt: value.createdAt.toISOString(), updatedAt: value.updatedAt.toISOString(), }; }