import BaseClient from "./BaseClient"; import { Callback, ClientOptions, DefaultResponse, FilteringParameters } from "./models/index"; import { Bounce, BounceActivationResponse, BounceCounts, BounceDump, BounceFilteringParameters, Bounces, BrowserUsageCounts, ClickCounts, ClickLocationCounts, ClickPlaformUsageCounts, CreateInboundRuleRequest, CreateMessageStreamRequest, CreateSuppressionsRequest, CreateTemplateRequest, CreateWebhookRequest, DeleteSuppressionsRequest, DeliveryStatistics, EmailClientUsageCounts, EmailPlaformUsageCounts, EmailReadTimesCounts, InboundMessageDetails, InboundMessages, InboundMessagesFilteringParameters, InboundRule, InboundRules, Message, MessageSendingResponse, MessageStream, MessageStreamArchiveResponse, MessageStreams, MessageStreamsFilteringParameters, MessageStreamUnarchiveResponse, OpenCounts, OutboundMessageClicks, OutboundMessageClicksFilteringParameters, OutboundMessageDetails, OutboundMessageDump, OutboundMessageOpens, OutboundMessageOpensFilteringParameters, OutboundMessages, OutboundMessagesFilteringParameters, OutboundStatistics, SentCounts, Server, SpamCounts, StatisticsFilteringParameters, Suppressions, SuppressionStatuses, Template, TemplatedMessage, TemplateFilteringParameters, Templates, TemplateValidation, TemplateValidationOptions, TrackedEmailCounts, UpdateMessageStreamRequest, UpdateServerRequest, UpdateTemplateRequest, UpdateWebhookRequest, Webhook, WebhookFilteringParameters, Webhooks } from "./models/index"; /** * Server client class that can be used to interact with an individual Postmark Server. */ export default class ServerClient extends BaseClient { /** * Create a client. * * @param serverToken - The token for the server that you wish to interact with. * @param configOptions - Options to customize the behavior of the this client. */ constructor(serverToken: string, configOptions?: ClientOptions.Configuration); /** Send a single email message. * * @param email - Email message to send. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ sendEmail(email: Message, callback?: Callback): Promise; /** * Send a batch of email messages. * * @param emails - An array of messages to send. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ sendEmailBatch(emails: Message[], callback?: Callback): Promise; /** * Send a message using a template. * * @param template - Message you wish to send. * @param callback If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ sendEmailWithTemplate(template: TemplatedMessage, callback?: Callback): Promise; /** * Send a batch of template email messages. * * @param templates - An array of templated messages you wish to send using this Client. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ sendEmailBatchWithTemplates(templates: TemplatedMessage[], callback?: Callback): Promise; /** * Get bounce statistic information for the associated Server. * * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ getDeliveryStatistics(callback?: Callback): Promise; /** * Get a batch of bounces. * * @param filter - Optional filtering parameters. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ getBounces(filter?: BounceFilteringParameters, callback?: Callback): Promise; /** * Get details for a specific Bounce. * * @param id - The ID of the Bounce you wish to retrieve. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ getBounce(id: number, callback?: Callback): Promise; /** * Get a Bounce Dump for a specific Bounce. * * @param id - The ID of the Bounce for which you wish to retrieve Bounce Dump. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ getBounceDump(id: number, callback?: Callback): Promise; /** * Activate email address that was deactivated due to a Bounce. * * @param id - The ID of the Bounce for which you wish to activate the associated email. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ activateBounce(id: number, callback?: Callback): Promise; /** * Get the list of templates associated with this server. * * @param filter - Optional filtering options. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ getTemplates(filter?: TemplateFilteringParameters, callback?: Callback): Promise; /** * Get the a specific template associated with this server. * * @param idOrAlias - ID or alias for the template you wish to retrieve. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ getTemplate(idOrAlias: (number | string), callback?: Callback