UNPKG

12.4 kBTypeScriptView Raw
1import BaseClient from "./BaseClient";
2import { Callback, ClientOptions, DefaultResponse, FilteringParameters } from "./models";
3import { CreateDomainRequest, CreateServerRequest, CreateSignatureRequest, DomainDetails, Domains, Server, ServerFilteringParameters, Servers, SignatureDetails, Signatures, TemplatesPush, TemplatesPushRequest, UpdateDomainRequest, UpdateServerRequest, UpdateSignatureRequest, DataRemovalRequest, DataRemovalStatus } from "./models";
4export default class AccountClient extends BaseClient {
5 /**
6 * Create a new AccountClient
7 * @param accountToken The account token that should be used with requests.
8 * @param configOptions Various options to customize client behavior.
9 */
10 constructor(accountToken: string, configOptions?: ClientOptions.Configuration);
11 /**
12 * Retrieve a list of Servers.
13 *
14 * @param filter - An optional filter for which data is retrieved.
15 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
16 * @returns A promise that will complete when the API responds (or an error occurs).
17 */
18 getServers(filter?: ServerFilteringParameters, callback?: Callback<Servers>): Promise<Servers>;
19 /**
20 * Retrieve a single server by ID.
21 *
22 * @param id - The ID of the Server for which you wish to retrieve details.
23 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
24 * @returns A promise that will complete when the API responds (or an error occurs).
25 */
26 getServer(id: number, callback?: Callback<Server>): Promise<Server>;
27 /**
28 * Create a new Server.
29 *
30 * @param options - The options to be used to create new Server.
31 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
32 * @returns A promise that will complete when the API responds (or an error occurs).
33 */
34 createServer(options: CreateServerRequest, callback?: Callback<Server>): Promise<Server>;
35 /**
36 * Modify the Server associated with this Client.
37 *
38 * @param id - The ID of the Server you wish to update.
39 * @param options - The options to be used to create new Server.
40 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
41 * @returns A promise that will complete when the API responds (or an error occurs).
42 */
43 editServer(id: number, options: UpdateServerRequest, callback?: Callback<Server>): Promise<Server>;
44 /**
45 * Modify the Server associated with this Client.
46 *
47 * @param id - The ID of the Domain you wish to delete.
48 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
49 * @returns A promise that will complete when the API responds (or an error occurs).
50 */
51 deleteServer(id: number, callback?: Callback<DefaultResponse>): Promise<DefaultResponse>;
52 /**
53 * Retrieve a batch of Domains.
54 *
55 * @param filter - An optional filter for which data is retrieved.
56 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
57 * @returns A promise that will complete when the API responds (or an error occurs).
58 */
59 getDomains(filter?: FilteringParameters, callback?: Callback<Domains>): Promise<Domains>;
60 /**
61 * Retrieve a single Domain by ID.
62 *
63 * @param id - The ID of the Domain for which you wish to retrieve details.
64 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
65 * @returns A promise that will complete when the API responds (or an error occurs).
66 */
67 getDomain(id: number, callback?: Callback<DomainDetails>): Promise<DomainDetails>;
68 /**
69 * Create a new Domain.
70 *
71 * @param options - The options to be used to create new Domain.
72 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
73 * @returns A promise that will complete when the API responds (or an error occurs).
74 */
75 createDomain(options: CreateDomainRequest, callback?: Callback<DomainDetails>): Promise<DomainDetails>;
76 /**
77 * Update a Domain.
78 *
79 * @param id - The ID of the Domain you wish to update.
80 * @param domain - The values on the Domain you wish to update.
81 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
82 * @returns A promise that will complete when the API responds (or an error occurs).
83 */
84 editDomain(id: number, options: UpdateDomainRequest, callback?: Callback<DomainDetails>): Promise<DomainDetails>;
85 /**
86 * Delete a Domain.
87 *
88 * @param id - The ID of the Domain you wish to delete.
89 * @param options - The options to be used in create Domain.
90 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
91 * @returns A promise that will complete when the API responds (or an error occurs).
92 */
93 deleteDomain(id: number, callback?: Callback<DefaultResponse>): Promise<DefaultResponse>;
94 /**
95 * Trigger Domain DKIM key verification.
96 *
97 * @param id - The ID of the Domain you wish to trigger DKIM verification for.
98 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
99 * @returns A promise that will complete when the API responds (or an error occurs).
100 */
101 verifyDomainDKIM(id: number, callback?: Callback<DomainDetails>): Promise<DomainDetails>;
102 /**
103 * Trigger Domain DKIM key verification.
104 *
105 * @param id - The ID of the Domain you wish to trigger DKIM verification for.
106 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
107 * @returns A promise that will complete when the API responds (or an error occurs).
108 */
109 verifyDomainReturnPath(id: number, callback?: Callback<DomainDetails>): Promise<DomainDetails>;
110 /**
111 * Trigger Domain DKIM key verification.
112 *
113 * @param id - The ID of the Domain you wish to trigger DKIM verification for.
114 * @param callback If the callback is provided, it will be passed to the resulting promise as a continuation.
115 * @returns A promise that will complete when the API responds (or an error occurs).
116 */
117 verifyDomainSPF(id: number, callback?: Callback<DomainDetails>): Promise<DomainDetails>;
118 /**
119 * Trigger Domain DKIM key verification.
120 *
121 * @param id - The ID of the Domain you wish to trigger DKIM verification for.
122 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
123 * @returns A promise that will complete when the API responds (or an error occurs).
124 */
125 rotateDomainDKIM(id: number, callback?: Callback<DomainDetails>): Promise<DomainDetails>;
126 /**
127 * Retrieve a single Sender Signature by ID.
128 *
129 * @param id - The ID of the Sender Signature for which you wish to retrieve details.
130 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
131 * @returns A promise that will complete when the API responds (or an error occurs).
132 */
133 getSenderSignature(id: number, callback?: Callback<SignatureDetails>): Promise<SignatureDetails>;
134 /**
135 * Retrieve a batch of Sender Signatures.
136 *
137 * @param filter - An optional filter for which data is retrieved.
138 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
139 * @returns A promise that will complete when the API responds (or an error occurs).
140 */
141 getSenderSignatures(filter?: FilteringParameters, callback?: Callback<Signatures>): Promise<Signatures>;
142 /**
143 * Create a new Sender Signature.
144 *
145 * @param options - The options to be used to create new Sender Signature.
146 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
147 * @returns A promise that will complete when the API responds (or an error occurs).
148 */
149 createSenderSignature(options: CreateSignatureRequest, callback?: Callback<SignatureDetails>): Promise<SignatureDetails>;
150 /**
151 * Update a Sender Signature.
152 *
153 * @param id - The ID of the Sender Signature for which you wish to update.
154 * @param options - The values on the Sender Signature you wish to update.
155 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
156 * @returns A promise that will complete when the API responds (or an error occurs).
157 */
158 editSenderSignature(id: number, options: UpdateSignatureRequest, callback?: Callback<SignatureDetails>): Promise<SignatureDetails>;
159 /**
160 * Delete a Domain.
161 *
162 * @param id - The ID of the Domain you wish to delete.
163 * @param options - The options to be used in create Domain.
164 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
165 * @returns A promise that will complete when the API responds (or an error occurs).
166 */
167 deleteSenderSignature(id: number, callback?: Callback<DefaultResponse>): Promise<DefaultResponse>;
168 /**
169 * Request a new confirmation email to be sent to the email address associated with a Sender Signature.
170 *
171 * @param id - The ID of the Sender Signature.
172 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
173 * @returns A promise that will complete when the API responds (or an error occurs).
174 */
175 resendSenderSignatureConfirmation(id: number, callback?: Callback<DefaultResponse>): Promise<DefaultResponse>;
176 /**
177 * Request that the SPF records for Sender Signature be verified.
178 *
179 * @param id - The ID of the Sender Signature.
180 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
181 * @returns A promise that will complete when the API responds (or an error occurs).
182 */
183 verifySenderSignatureSPF(id: number, callback?: Callback<SignatureDetails>): Promise<SignatureDetails>;
184 /**
185 * Request that the SPF records for Sender Signature be verified.
186 *
187 * @param id - The ID of the Sender Signature.
188 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
189 * @returns A promise that will complete when the API responds (or an error occurs).
190 */
191 requestNewDKIMForSenderSignature(id: number, callback?: Callback<SignatureDetails>): Promise<SignatureDetails>;
192 /**
193 * Request a push of templates from one server to another.
194 *
195 * @param options - details for pushing templates from one place to another.
196 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
197 * @returns A promise that will complete when the API responds (or an error occurs).
198 */
199 pushTemplates(options: TemplatesPushRequest, callback?: Callback<TemplatesPush>): Promise<TemplatesPush>;
200 /**
201 * Request a data removal.
202 *
203 * @param options - details for creating data removal request
204 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
205 * @returns A promise that will complete when the API responds (or an error occurs).
206 */
207 requestDataRemoval(options: DataRemovalRequest, callback?: Callback<DataRemovalStatus>): Promise<DataRemovalStatus>;
208 /**
209 * Retrieve a single data removal status by ID.
210 *
211 * @param id - The ID of the DataRemoval for which you wish to retrieve details.
212 * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
213 * @returns A promise that will complete when the API responds (or an error occurs).
214 */
215 getDataRemovalStatus(id: number, callback?: Callback<DataRemovalStatus>): Promise<DataRemovalStatus>;
216}