@bitblit/ratchet-misc
Version:
Ratchet miscellaneous tooling that requires smallish dependant libraries
121 lines • 5.87 kB
JavaScript
import { exists } from '../runtime.js';
import { GetCampaignRecipientsFromJSON, GetCampaignRecipientsToJSON } from './GetCampaignRecipients.js';
import { GetExtendedCampaignOverviewAllOfSenderFromJSON, GetExtendedCampaignOverviewAllOfSenderToJSON, } from './GetExtendedCampaignOverviewAllOfSender.js';
import { GetExtendedCampaignStatsFromJSON, GetExtendedCampaignStatsToJSON } from './GetExtendedCampaignStats.js';
export var GetEmailCampaignTypeEnum;
(function (GetEmailCampaignTypeEnum) {
GetEmailCampaignTypeEnum["Classic"] = "classic";
GetEmailCampaignTypeEnum["Trigger"] = "trigger";
})(GetEmailCampaignTypeEnum || (GetEmailCampaignTypeEnum = {}));
export var GetEmailCampaignStatusEnum;
(function (GetEmailCampaignStatusEnum) {
GetEmailCampaignStatusEnum["Draft"] = "draft";
GetEmailCampaignStatusEnum["Sent"] = "sent";
GetEmailCampaignStatusEnum["Archive"] = "archive";
GetEmailCampaignStatusEnum["Queued"] = "queued";
GetEmailCampaignStatusEnum["Suspended"] = "suspended";
GetEmailCampaignStatusEnum["InProcess"] = "in_process";
})(GetEmailCampaignStatusEnum || (GetEmailCampaignStatusEnum = {}));
export function instanceOfGetEmailCampaign(value) {
let isInstance = true;
isInstance = isInstance && 'id' in value;
isInstance = isInstance && 'name' in value;
isInstance = isInstance && 'type' in value;
isInstance = isInstance && 'status' in value;
isInstance = isInstance && 'testSent' in value;
isInstance = isInstance && 'header' in value;
isInstance = isInstance && 'footer' in value;
isInstance = isInstance && 'sender' in value;
isInstance = isInstance && 'replyTo' in value;
isInstance = isInstance && 'toField' in value;
isInstance = isInstance && 'htmlContent' in value;
isInstance = isInstance && 'tag' in value;
isInstance = isInstance && 'createdAt' in value;
isInstance = isInstance && 'modifiedAt' in value;
isInstance = isInstance && 'recipients' in value;
isInstance = isInstance && 'statistics' in value;
return isInstance;
}
export function GetEmailCampaignFromJSON(json) {
return GetEmailCampaignFromJSONTyped(json, false);
}
export function GetEmailCampaignFromJSONTyped(json, ignoreDiscriminator) {
if (json === undefined || json === null) {
return json;
}
return {
id: json['id'],
name: json['name'],
subject: !exists(json, 'subject') ? undefined : json['subject'],
type: json['type'],
status: json['status'],
scheduledAt: !exists(json, 'scheduledAt') ? undefined : new Date(json['scheduledAt']),
abTesting: !exists(json, 'abTesting') ? undefined : json['abTesting'],
subjectA: !exists(json, 'subjectA') ? undefined : json['subjectA'],
subjectB: !exists(json, 'subjectB') ? undefined : json['subjectB'],
splitRule: !exists(json, 'splitRule') ? undefined : json['splitRule'],
winnerCriteria: !exists(json, 'winnerCriteria') ? undefined : json['winnerCriteria'],
winnerDelay: !exists(json, 'winnerDelay') ? undefined : json['winnerDelay'],
sendAtBestTime: !exists(json, 'sendAtBestTime') ? undefined : json['sendAtBestTime'],
testSent: json['testSent'],
header: json['header'],
footer: json['footer'],
sender: GetExtendedCampaignOverviewAllOfSenderFromJSON(json['sender']),
replyTo: json['replyTo'],
toField: json['toField'],
htmlContent: json['htmlContent'],
shareLink: !exists(json, 'shareLink') ? undefined : json['shareLink'],
tag: json['tag'],
createdAt: new Date(json['createdAt']),
modifiedAt: new Date(json['modifiedAt']),
inlineImageActivation: !exists(json, 'inlineImageActivation') ? undefined : json['inlineImageActivation'],
mirrorActive: !exists(json, 'mirrorActive') ? undefined : json['mirrorActive'],
recurring: !exists(json, 'recurring') ? undefined : json['recurring'],
sentDate: !exists(json, 'sentDate') ? undefined : new Date(json['sentDate']),
returnBounce: !exists(json, 'returnBounce') ? undefined : json['returnBounce'],
recipients: GetCampaignRecipientsFromJSON(json['recipients']),
statistics: GetExtendedCampaignStatsFromJSON(json['statistics']),
};
}
export function GetEmailCampaignToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
id: value.id,
name: value.name,
subject: value.subject,
type: value.type,
status: value.status,
scheduledAt: value.scheduledAt === undefined ? undefined : value.scheduledAt.toISOString(),
abTesting: value.abTesting,
subjectA: value.subjectA,
subjectB: value.subjectB,
splitRule: value.splitRule,
winnerCriteria: value.winnerCriteria,
winnerDelay: value.winnerDelay,
sendAtBestTime: value.sendAtBestTime,
testSent: value.testSent,
header: value.header,
footer: value.footer,
sender: GetExtendedCampaignOverviewAllOfSenderToJSON(value.sender),
replyTo: value.replyTo,
toField: value.toField,
htmlContent: value.htmlContent,
shareLink: value.shareLink,
tag: value.tag,
createdAt: value.createdAt.toISOString(),
modifiedAt: value.modifiedAt.toISOString(),
inlineImageActivation: value.inlineImageActivation,
mirrorActive: value.mirrorActive,
recurring: value.recurring,
sentDate: value.sentDate === undefined ? undefined : value.sentDate.toISOString(),
returnBounce: value.returnBounce,
recipients: GetCampaignRecipientsToJSON(value.recipients),
statistics: GetExtendedCampaignStatsToJSON(value.statistics),
};
}
//# sourceMappingURL=GetEmailCampaign.js.map