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.
93 lines (87 loc) • 2.62 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';
/**
* Options for matching emails in an inbox. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `SUBJECT` should `CONTAIN` value.
* @export
* @interface MatchOption
*/
export interface MatchOption {
/**
* Fields of an email object that can be used to filter results
* @type {string}
* @memberof MatchOption
*/
field: MatchOptionFieldEnum;
/**
* How the value of the email field specified should be compared to the value given in the match options.
* @type {string}
* @memberof MatchOption
*/
should: MatchOptionShouldEnum;
/**
* The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.
* @type {string}
* @memberof MatchOption
*/
value: string;
}
/**
* @export
* @enum {string}
*/
export enum MatchOptionFieldEnum {
SUBJECT = 'SUBJECT',
TO = 'TO',
BCC = 'BCC',
CC = 'CC',
FROM = 'FROM',
}
/**
* @export
* @enum {string}
*/
export enum MatchOptionShouldEnum {
CONTAIN = 'CONTAIN',
EQUAL = 'EQUAL',
}
export function MatchOptionFromJSON(json: any): MatchOption {
return MatchOptionFromJSONTyped(json, false);
}
export function MatchOptionFromJSONTyped(
json: any,
ignoreDiscriminator: boolean
): MatchOption {
if (json === undefined || json === null) {
return json;
}
return {
field: json['field'],
should: json['should'],
value: json['value'],
};
}
export function MatchOptionToJSON(value?: MatchOption | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
field: value.field,
should: value.should,
value: value.value,
};
}