-
Notifications
You must be signed in to change notification settings - Fork 781
Expand file tree
/
Copy pathclient.d.ts
More file actions
58 lines (46 loc) · 1.32 KB
/
client.d.ts
File metadata and controls
58 lines (46 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import {ResponseError} from "@sendgrid/helpers/classes";
import {ClientRequest} from "@sendgrid/client/src/request";
import {ClientResponse} from "@sendgrid/client/src/response";
declare class Client {
constructor();
/**
* Set the SendGrid API key.
*/
setApiKey(apiKey: string): void;
/**
* Set the Twilio Email credentials.
*/
setTwilioEmailAuth(username: string, password: string): void;
/**
* Set client requests to impersonate a subuser
*/
setImpersonateSubuser(subuser: string): void;
/**
* Set default header
*/
setDefaultHeader(key: string | { [s: string]: string }, value ?: string): this;
/**
* Set default request
*/
setDefaultRequest<K extends keyof ClientRequest>(key: K | ClientRequest, value ?: ClientRequest[K]): this;
/**
* Sets the data residency as per region provided
*/
setDataResidency(region: string): this;
/**
* Create headers for request
*/
createHeaders(data: { [key: string]: string }): { [key: string]: string };
/**
* Create request
*/
createRequest(data: ClientRequest): ClientRequest;
/**
* Do a request
*/
request(data: ClientRequest, cb?: (err: ResponseError, response: [ClientResponse, any]) => void): Promise<[ClientResponse, any]>;
}
declare const client: Client;
// @ts-ignore
export = client
export {Client};