@asposecloud/aspose-email-cloud
Version:
Aspose.Email Cloud Node.js SDK
540 lines (536 loc) • 15.1 kB
JavaScript
"use strict";
/*
* MIT License
* Copyright (c) 2018-2020 Aspose Pty Ltd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmailDtoBuilder = exports.EmailDto = void 0;
/**
* Email message representation.
*/
class EmailDto {
/**
* Email message representation.
* @param alternateViews Collection of alternate views of message.
* @param attachments Email message attachments.
* @param bcc BCC recipients.
* @param body Email message body as plain text.
* @param bodyEncoding Body encoding.
* @param bodyType The content type of message body. Enum, available values: PlainText, Html, Rtf
* @param cc CC recipients.
* @param date Message date.
* @param deliveryNotificationOptions Delivery notifications.
* @param from From address.
* @param headers Document headers.
* @param htmlBody HTML body.
* @param htmlBodyText Html body as plain text. Read only.
* @param isBodyHtml Indicates whether the message body is in Html.
* @param isDraft Indicates whether or not a message has been sent.
* @param isEncrypted Indicates whether the message is encrypted. Read only.
* @param isSigned Indicates whether the message is signed. Read only.
* @param linkedResources Linked resources of message.
* @param messageId Message id.
* @param originalIsTnef Indicates whether original EML message is in TNEF format. Read only.
* @param preferredTextEncoding Preferred encoding.
* @param priority Email priority status. Enum, available values: High, Low, Normal
* @param readReceiptTo Read receipt addresses.
* @param replyToList The list of addresses to reply to for the mail message.
* @param reversePath ReversePath address.
* @param sender Sender address.
* @param sensitivity Specifies the sensitivity of a MailMessage. Enum, available values: None, Normal, Personal, Private, CompanyConfidential
* @param subject Message subject.
* @param subjectEncoding Subject encoding.
* @param timeZoneOffset Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC represented as count of ticks (10 000 per millisecond).
* @param to The address collection that contains the recipients of message.
* @param xMailer The X-Mailer the software that created the e-mail message.
* @param epilogue Gets or sets an epilogue text. It is located after the last boundary.
* @param preamble Gets or sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.
*/
constructor(alternateViews, attachments, bcc, body, bodyEncoding, bodyType, cc, date, deliveryNotificationOptions, from, headers, htmlBody, htmlBodyText, isBodyHtml, isDraft, isEncrypted, isSigned, linkedResources, messageId, originalIsTnef, preferredTextEncoding, priority, readReceiptTo, replyToList, reversePath, sender, sensitivity, subject, subjectEncoding, timeZoneOffset, to, xMailer, epilogue, preamble) {
this.alternateViews = alternateViews;
this.attachments = attachments;
this.bcc = bcc;
this.body = body;
this.bodyEncoding = bodyEncoding;
this.bodyType = bodyType;
this.cc = cc;
this.date = date;
this.deliveryNotificationOptions = deliveryNotificationOptions;
this.from = from;
this.headers = headers;
this.htmlBody = htmlBody;
this.htmlBodyText = htmlBodyText;
this.isBodyHtml = isBodyHtml;
this.isDraft = isDraft;
this.isEncrypted = isEncrypted;
this.isSigned = isSigned;
this.linkedResources = linkedResources;
this.messageId = messageId;
this.originalIsTnef = originalIsTnef;
this.preferredTextEncoding = preferredTextEncoding;
this.priority = priority;
this.readReceiptTo = readReceiptTo;
this.replyToList = replyToList;
this.reversePath = reversePath;
this.sender = sender;
this.sensitivity = sensitivity;
this.subject = subject;
this.subjectEncoding = subjectEncoding;
this.timeZoneOffset = timeZoneOffset;
this.to = to;
this.xMailer = xMailer;
this.epilogue = epilogue;
this.preamble = preamble;
}
/**
* Returns attribute type map
*/
static getAttributeTypeMap() {
return EmailDto.attributeTypeMap;
}
}
exports.EmailDto = EmailDto;
/**
* Attribute type map
*/
EmailDto.attributeTypeMap = [
{
name: "alternateViews",
baseName: "alternateViews",
type: "Array<AlternateView>",
},
{
name: "attachments",
baseName: "attachments",
type: "Array<Attachment>",
},
{
name: "bcc",
baseName: "bcc",
type: "Array<MailAddress>",
},
{
name: "body",
baseName: "body",
type: "string",
},
{
name: "bodyEncoding",
baseName: "bodyEncoding",
type: "string",
},
{
name: "bodyType",
baseName: "bodyType",
type: "string",
},
{
name: "cc",
baseName: "cc",
type: "Array<MailAddress>",
},
{
name: "date",
baseName: "date",
type: "Date",
},
{
name: "deliveryNotificationOptions",
baseName: "deliveryNotificationOptions",
type: "Array<string>",
},
{
name: "from",
baseName: "from",
type: "MailAddress",
},
{
name: "headers",
baseName: "headers",
type: "{ [key: string]: string; }",
},
{
name: "htmlBody",
baseName: "htmlBody",
type: "string",
},
{
name: "htmlBodyText",
baseName: "htmlBodyText",
type: "string",
},
{
name: "isBodyHtml",
baseName: "isBodyHtml",
type: "boolean",
},
{
name: "isDraft",
baseName: "isDraft",
type: "boolean",
},
{
name: "isEncrypted",
baseName: "isEncrypted",
type: "boolean",
},
{
name: "isSigned",
baseName: "isSigned",
type: "boolean",
},
{
name: "linkedResources",
baseName: "linkedResources",
type: "Array<LinkedResource>",
},
{
name: "messageId",
baseName: "messageId",
type: "string",
},
{
name: "originalIsTnef",
baseName: "originalIsTnef",
type: "boolean",
},
{
name: "preferredTextEncoding",
baseName: "preferredTextEncoding",
type: "string",
},
{
name: "priority",
baseName: "priority",
type: "string",
},
{
name: "readReceiptTo",
baseName: "readReceiptTo",
type: "Array<MailAddress>",
},
{
name: "replyToList",
baseName: "replyToList",
type: "Array<MailAddress>",
},
{
name: "reversePath",
baseName: "reversePath",
type: "MailAddress",
},
{
name: "sender",
baseName: "sender",
type: "MailAddress",
},
{
name: "sensitivity",
baseName: "sensitivity",
type: "string",
},
{
name: "subject",
baseName: "subject",
type: "string",
},
{
name: "subjectEncoding",
baseName: "subjectEncoding",
type: "string",
},
{
name: "timeZoneOffset",
baseName: "timeZoneOffset",
type: "number",
},
{
name: "to",
baseName: "to",
type: "Array<MailAddress>",
},
{
name: "xMailer",
baseName: "xMailer",
type: "string",
},
{
name: "epilogue",
baseName: "epilogue",
type: "string",
},
{
name: "preamble",
baseName: "preamble",
type: "string",
}
];
/**
* EmailDto model builder
*/
class EmailDtoBuilder {
constructor(model) {
this.model = model;
}
/**
* Build model.
*/
build() {
return this.model;
}
/**
* Collection of alternate views of message.
*/
alternateViews(alternateViews) {
this.model.alternateViews = alternateViews;
return this;
}
/**
* Email message attachments.
*/
attachments(attachments) {
this.model.attachments = attachments;
return this;
}
/**
* BCC recipients.
*/
bcc(bcc) {
this.model.bcc = bcc;
return this;
}
/**
* Email message body as plain text.
*/
body(body) {
this.model.body = body;
return this;
}
/**
* Body encoding.
*/
bodyEncoding(bodyEncoding) {
this.model.bodyEncoding = bodyEncoding;
return this;
}
/**
* The content type of message body. Enum, available values: PlainText, Html, Rtf
*/
bodyType(bodyType) {
this.model.bodyType = bodyType;
return this;
}
/**
* CC recipients.
*/
cc(cc) {
this.model.cc = cc;
return this;
}
/**
* Message date.
*/
date(date) {
this.model.date = date;
return this;
}
/**
* Delivery notifications. Items: Email delivery notification options. Enum, available values: Delay, Never, None, OnFailure, OnSuccess
*/
deliveryNotificationOptions(deliveryNotificationOptions) {
this.model.deliveryNotificationOptions = deliveryNotificationOptions;
return this;
}
/**
* From address.
*/
from(from) {
this.model.from = from;
return this;
}
/**
* Document headers.
*/
headers(headers) {
this.model.headers = headers;
return this;
}
/**
* HTML body.
*/
htmlBody(htmlBody) {
this.model.htmlBody = htmlBody;
return this;
}
/**
* Html body as plain text. Read only.
*/
htmlBodyText(htmlBodyText) {
this.model.htmlBodyText = htmlBodyText;
return this;
}
/**
* Indicates whether the message body is in Html.
*/
isBodyHtml(isBodyHtml) {
this.model.isBodyHtml = isBodyHtml;
return this;
}
/**
* Indicates whether or not a message has been sent.
*/
isDraft(isDraft) {
this.model.isDraft = isDraft;
return this;
}
/**
* Indicates whether the message is encrypted. Read only.
*/
isEncrypted(isEncrypted) {
this.model.isEncrypted = isEncrypted;
return this;
}
/**
* Indicates whether the message is signed. Read only.
*/
isSigned(isSigned) {
this.model.isSigned = isSigned;
return this;
}
/**
* Linked resources of message.
*/
linkedResources(linkedResources) {
this.model.linkedResources = linkedResources;
return this;
}
/**
* Message id.
*/
messageId(messageId) {
this.model.messageId = messageId;
return this;
}
/**
* Indicates whether original EML message is in TNEF format. Read only.
*/
originalIsTnef(originalIsTnef) {
this.model.originalIsTnef = originalIsTnef;
return this;
}
/**
* Preferred encoding.
*/
preferredTextEncoding(preferredTextEncoding) {
this.model.preferredTextEncoding = preferredTextEncoding;
return this;
}
/**
* Email priority status. Enum, available values: High, Low, Normal
*/
priority(priority) {
this.model.priority = priority;
return this;
}
/**
* Read receipt addresses.
*/
readReceiptTo(readReceiptTo) {
this.model.readReceiptTo = readReceiptTo;
return this;
}
/**
* The list of addresses to reply to for the mail message.
*/
replyToList(replyToList) {
this.model.replyToList = replyToList;
return this;
}
/**
* ReversePath address.
*/
reversePath(reversePath) {
this.model.reversePath = reversePath;
return this;
}
/**
* Sender address.
*/
sender(sender) {
this.model.sender = sender;
return this;
}
/**
* Specifies the sensitivity of a MailMessage. Enum, available values: None, Normal, Personal, Private, CompanyConfidential
*/
sensitivity(sensitivity) {
this.model.sensitivity = sensitivity;
return this;
}
/**
* Message subject.
*/
subject(subject) {
this.model.subject = subject;
return this;
}
/**
* Subject encoding.
*/
subjectEncoding(subjectEncoding) {
this.model.subjectEncoding = subjectEncoding;
return this;
}
/**
* Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC represented as count of ticks (10 000 per millisecond).
*/
timeZoneOffset(timeZoneOffset) {
this.model.timeZoneOffset = timeZoneOffset;
return this;
}
/**
* The address collection that contains the recipients of message.
*/
to(to) {
this.model.to = to;
return this;
}
/**
* The X-Mailer the software that created the e-mail message.
*/
xMailer(xMailer) {
this.model.xMailer = xMailer;
return this;
}
/**
* Gets or sets an epilogue text. It is located after the last boundary.
*/
epilogue(epilogue) {
this.model.epilogue = epilogue;
return this;
}
/**
* Gets or sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.
*/
preamble(preamble) {
this.model.preamble = preamble;
return this;
}
}
exports.EmailDtoBuilder = EmailDtoBuilder;
//# sourceMappingURL=email-dto.js.map