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.
326 lines (319 loc) • 8.23 kB
text/typescript
/* 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';
import {
DeliverabilityExpectation,
DeliverabilityExpectationFromJSON,
DeliverabilityExpectationFromJSONTyped,
DeliverabilityExpectationToJSON,
DeliverabilitySelectorOptions,
DeliverabilitySelectorOptionsFromJSON,
DeliverabilitySelectorOptionsFromJSONTyped,
DeliverabilitySelectorOptionsToJSON,
} from './';
/**
* Deliverability test configuration and progress summary
* @export
* @interface DeliverabilityTestDto
*/
export interface DeliverabilityTestDto {
/**
*
* @type {string}
* @memberof DeliverabilityTestDto
*/
id: string;
/**
*
* @type {string}
* @memberof DeliverabilityTestDto
*/
name?: string | null;
/**
*
* @type {string}
* @memberof DeliverabilityTestDto
*/
description?: string | null;
/**
*
* @type {string}
* @memberof DeliverabilityTestDto
*/
scope: DeliverabilityTestDtoScopeEnum;
/**
*
* @type {DeliverabilitySelectorOptions}
* @memberof DeliverabilityTestDto
*/
selector: DeliverabilitySelectorOptions;
/**
*
* @type {number}
* @memberof DeliverabilityTestDto
*/
selectedEntityCount: number;
/**
*
* @type {Array<DeliverabilityExpectation>}
* @memberof DeliverabilityTestDto
*/
expectations: Array<DeliverabilityExpectation>;
/**
*
* @type {string}
* @memberof DeliverabilityTestDto
*/
status: DeliverabilityTestDtoStatusEnum;
/**
*
* @type {Date}
* @memberof DeliverabilityTestDto
*/
startAt: Date;
/**
*
* @type {Date}
* @memberof DeliverabilityTestDto
*/
startedAt?: Date | null;
/**
*
* @type {Date}
* @memberof DeliverabilityTestDto
*/
completedAt?: Date | null;
/**
*
* @type {number}
* @memberof DeliverabilityTestDto
*/
maxDurationSeconds?: number | null;
/**
*
* @type {number}
* @memberof DeliverabilityTestDto
*/
successThresholdPercent?: number | null;
/**
*
* @type {string}
* @memberof DeliverabilityTestDto
*/
thresholdStatus: DeliverabilityTestDtoThresholdStatusEnum;
/**
*
* @type {boolean}
* @memberof DeliverabilityTestDto
*/
thresholdMet?: boolean | null;
/**
*
* @type {Date}
* @memberof DeliverabilityTestDto
*/
lastEvaluatedAt?: Date | null;
/**
*
* @type {number}
* @memberof DeliverabilityTestDto
*/
totalEntities: number;
/**
*
* @type {number}
* @memberof DeliverabilityTestDto
*/
matchedEntities: number;
/**
*
* @type {number}
* @memberof DeliverabilityTestDto
*/
unmatchedEntities: number;
/**
*
* @type {number}
* @memberof DeliverabilityTestDto
*/
completionPercentage: number;
/**
*
* @type {boolean}
* @memberof DeliverabilityTestDto
*/
timedOut: boolean;
/**
*
* @type {string}
* @memberof DeliverabilityTestDto
*/
failureReason?: string | null;
/**
*
* @type {Date}
* @memberof DeliverabilityTestDto
*/
createdAt: Date;
/**
*
* @type {Date}
* @memberof DeliverabilityTestDto
*/
updatedAt: Date;
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityTestDtoScopeEnum {
INBOX = 'INBOX',
PHONE = 'PHONE',
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityTestDtoStatusEnum {
CREATED = 'CREATED',
SCHEDULED = 'SCHEDULED',
RUNNING = 'RUNNING',
PAUSED = 'PAUSED',
STOPPED = 'STOPPED',
COMPLETE = 'COMPLETE',
FAILED = 'FAILED',
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityTestDtoThresholdStatusEnum {
NOT_CONFIGURED = 'NOT_CONFIGURED',
PASSING = 'PASSING',
FAILING = 'FAILING',
}
export function DeliverabilityTestDtoFromJSON(
json: any
): DeliverabilityTestDto {
return DeliverabilityTestDtoFromJSONTyped(json, false);
}
export function DeliverabilityTestDtoFromJSONTyped(
json: any,
ignoreDiscriminator: boolean
): DeliverabilityTestDto {
if (json === undefined || json === null) {
return json;
}
return {
id: json['id'],
name: !exists(json, 'name') ? undefined : json['name'],
description: !exists(json, 'description') ? undefined : json['description'],
scope: json['scope'],
selector: DeliverabilitySelectorOptionsFromJSON(json['selector']),
selectedEntityCount: json['selectedEntityCount'],
expectations: (json['expectations'] as Array<any>).map(
DeliverabilityExpectationFromJSON
),
status: json['status'],
startAt: new Date(json['startAt']),
startedAt: !exists(json, 'startedAt')
? undefined
: json['startedAt'] === null
? null
: new Date(json['startedAt']),
completedAt: !exists(json, 'completedAt')
? undefined
: json['completedAt'] === null
? null
: new Date(json['completedAt']),
maxDurationSeconds: !exists(json, 'maxDurationSeconds')
? undefined
: json['maxDurationSeconds'],
successThresholdPercent: !exists(json, 'successThresholdPercent')
? undefined
: json['successThresholdPercent'],
thresholdStatus: json['thresholdStatus'],
thresholdMet: !exists(json, 'thresholdMet')
? undefined
: json['thresholdMet'],
lastEvaluatedAt: !exists(json, 'lastEvaluatedAt')
? undefined
: json['lastEvaluatedAt'] === null
? null
: new Date(json['lastEvaluatedAt']),
totalEntities: json['totalEntities'],
matchedEntities: json['matchedEntities'],
unmatchedEntities: json['unmatchedEntities'],
completionPercentage: json['completionPercentage'],
timedOut: json['timedOut'],
failureReason: !exists(json, 'failureReason')
? undefined
: json['failureReason'],
createdAt: new Date(json['createdAt']),
updatedAt: new Date(json['updatedAt']),
};
}
export function DeliverabilityTestDtoToJSON(
value?: DeliverabilityTestDto | null
): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
id: value.id,
name: value.name,
description: value.description,
scope: value.scope,
selector: DeliverabilitySelectorOptionsToJSON(value.selector),
selectedEntityCount: value.selectedEntityCount,
expectations: (value.expectations as Array<any>).map(
DeliverabilityExpectationToJSON
),
status: value.status,
startAt: value.startAt.toISOString(),
startedAt:
value.startedAt === undefined
? undefined
: value.startedAt === null
? null
: value.startedAt.toISOString(),
completedAt:
value.completedAt === undefined
? undefined
: value.completedAt === null
? null
: value.completedAt.toISOString(),
maxDurationSeconds: value.maxDurationSeconds,
successThresholdPercent: value.successThresholdPercent,
thresholdStatus: value.thresholdStatus,
thresholdMet: value.thresholdMet,
lastEvaluatedAt:
value.lastEvaluatedAt === undefined
? undefined
: value.lastEvaluatedAt === null
? null
: value.lastEvaluatedAt.toISOString(),
totalEntities: value.totalEntities,
matchedEntities: value.matchedEntities,
unmatchedEntities: value.unmatchedEntities,
completionPercentage: value.completionPercentage,
timedOut: value.timedOut,
failureReason: value.failureReason,
createdAt: value.createdAt.toISOString(),
updatedAt: value.updatedAt.toISOString(),
};
}