/* 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 { PostmasterIpReputationDto, PostmasterIpReputationDtoFromJSON, PostmasterIpReputationDtoFromJSONTyped, PostmasterIpReputationDtoToJSON, } from './'; /** * * @export * @interface PostmasterTrafficStatsDto */ export interface PostmasterTrafficStatsDto { /** * * @type {string} * @memberof PostmasterTrafficStatsDto */ name?: string | null; /** * * @type {string} * @memberof PostmasterTrafficStatsDto */ domain: string; /** * * @type {Date} * @memberof PostmasterTrafficStatsDto */ reportDate?: Date | null; /** * * @type {number} * @memberof PostmasterTrafficStatsDto */ userReportedSpamRatio?: number | null; /** * * @type {string} * @memberof PostmasterTrafficStatsDto */ domainReputation?: string | null; /** * * @type {Array} * @memberof PostmasterTrafficStatsDto */ ipReputations: Array; /** * * @type {number} * @memberof PostmasterTrafficStatsDto */ spfSuccessRatio?: number | null; /** * * @type {number} * @memberof PostmasterTrafficStatsDto */ dkimSuccessRatio?: number | null; /** * * @type {number} * @memberof PostmasterTrafficStatsDto */ dmarcSuccessRatio?: number | null; /** * * @type {number} * @memberof PostmasterTrafficStatsDto */ outboundEncryptionRatio?: number | null; /** * * @type {number} * @memberof PostmasterTrafficStatsDto */ inboundEncryptionRatio?: number | null; /** * * @type {object} * @memberof PostmasterTrafficStatsDto */ payload: object; } export function PostmasterTrafficStatsDtoFromJSON( json: any ): PostmasterTrafficStatsDto { return PostmasterTrafficStatsDtoFromJSONTyped(json, false); } export function PostmasterTrafficStatsDtoFromJSONTyped( json: any, ignoreDiscriminator: boolean ): PostmasterTrafficStatsDto { if (json === undefined || json === null) { return json; } return { name: !exists(json, 'name') ? undefined : json['name'], domain: json['domain'], reportDate: !exists(json, 'reportDate') ? undefined : json['reportDate'] === null ? null : new Date(json['reportDate']), userReportedSpamRatio: !exists(json, 'userReportedSpamRatio') ? undefined : json['userReportedSpamRatio'], domainReputation: !exists(json, 'domainReputation') ? undefined : json['domainReputation'], ipReputations: (json['ipReputations'] as Array).map( PostmasterIpReputationDtoFromJSON ), spfSuccessRatio: !exists(json, 'spfSuccessRatio') ? undefined : json['spfSuccessRatio'], dkimSuccessRatio: !exists(json, 'dkimSuccessRatio') ? undefined : json['dkimSuccessRatio'], dmarcSuccessRatio: !exists(json, 'dmarcSuccessRatio') ? undefined : json['dmarcSuccessRatio'], outboundEncryptionRatio: !exists(json, 'outboundEncryptionRatio') ? undefined : json['outboundEncryptionRatio'], inboundEncryptionRatio: !exists(json, 'inboundEncryptionRatio') ? undefined : json['inboundEncryptionRatio'], payload: json['payload'], }; } export function PostmasterTrafficStatsDtoToJSON( value?: PostmasterTrafficStatsDto | null ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { name: value.name, domain: value.domain, reportDate: value.reportDate === undefined ? undefined : value.reportDate === null ? null : value.reportDate.toISOString().substr(0, 10), userReportedSpamRatio: value.userReportedSpamRatio, domainReputation: value.domainReputation, ipReputations: (value.ipReputations as Array).map( PostmasterIpReputationDtoToJSON ), spfSuccessRatio: value.spfSuccessRatio, dkimSuccessRatio: value.dkimSuccessRatio, dmarcSuccessRatio: value.dmarcSuccessRatio, outboundEncryptionRatio: value.outboundEncryptionRatio, inboundEncryptionRatio: value.inboundEncryptionRatio, payload: value.payload, }; }