/* 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 './'; /** * Create a new deliverability/load test * @export * @interface CreateDeliverabilityTestOptions */ export interface CreateDeliverabilityTestOptions { /** * Optional name for the test * @type {string} * @memberof CreateDeliverabilityTestOptions */ name?: string | null; /** * Optional description * @type {string} * @memberof CreateDeliverabilityTestOptions */ description?: string | null; /** * Entity scope to evaluate * @type {string} * @memberof CreateDeliverabilityTestOptions */ scope: CreateDeliverabilityTestOptionsScopeEnum; /** * UTC instant when the receive window starts. Defaults to now if omitted. * @type {Date} * @memberof CreateDeliverabilityTestOptions */ startAt?: Date | null; /** * Optional timeout in seconds after startAt. If not all entities match before timeout the test transitions to FAILED. * @type {number} * @memberof CreateDeliverabilityTestOptions */ maxDurationSeconds?: number | null; /** * Optional acceptable success threshold percentage (0,100]. If set, a timed-out test can complete successfully when matchedEntities/totalEntities reaches this percentage. * @type {number} * @memberof CreateDeliverabilityTestOptions */ successThresholdPercent?: number | null; /** * * @type {DeliverabilitySelectorOptions} * @memberof CreateDeliverabilityTestOptions */ selector: DeliverabilitySelectorOptions; /** * One or more expectations to evaluate for each entity * @type {Array} * @memberof CreateDeliverabilityTestOptions */ expectations: Array; } /** * @export * @enum {string} */ export enum CreateDeliverabilityTestOptionsScopeEnum { INBOX = 'INBOX', PHONE = 'PHONE', } export function CreateDeliverabilityTestOptionsFromJSON( json: any ): CreateDeliverabilityTestOptions { return CreateDeliverabilityTestOptionsFromJSONTyped(json, false); } export function CreateDeliverabilityTestOptionsFromJSONTyped( json: any, ignoreDiscriminator: boolean ): CreateDeliverabilityTestOptions { if (json === undefined || json === null) { return json; } return { name: !exists(json, 'name') ? undefined : json['name'], description: !exists(json, 'description') ? undefined : json['description'], scope: json['scope'], startAt: !exists(json, 'startAt') ? undefined : json['startAt'] === null ? null : new Date(json['startAt']), maxDurationSeconds: !exists(json, 'maxDurationSeconds') ? undefined : json['maxDurationSeconds'], successThresholdPercent: !exists(json, 'successThresholdPercent') ? undefined : json['successThresholdPercent'], selector: DeliverabilitySelectorOptionsFromJSON(json['selector']), expectations: (json['expectations'] as Array).map( DeliverabilityExpectationFromJSON ), }; } export function CreateDeliverabilityTestOptionsToJSON( value?: CreateDeliverabilityTestOptions | null ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { name: value.name, description: value.description, scope: value.scope, startAt: value.startAt === undefined ? undefined : value.startAt === null ? null : value.startAt.toISOString(), maxDurationSeconds: value.maxDurationSeconds, successThresholdPercent: value.successThresholdPercent, selector: DeliverabilitySelectorOptionsToJSON(value.selector), expectations: (value.expectations as Array).map( DeliverabilityExpectationToJSON ), }; }