-
Notifications
You must be signed in to change notification settings - Fork 407
Expand file tree
/
Copy pathSendGridAPI.java
More file actions
92 lines (79 loc) · 1.91 KB
/
SendGridAPI.java
File metadata and controls
92 lines (79 loc) · 1.91 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.sendgrid;
import java.io.IOException;
import java.util.Map;
public interface SendGridAPI {
/**
* Initialize the client.
*
* @param auth authorization header value
* @param host the base URL for the API
*/
void initialize(final String auth, final String host);
/**
* Get the current library version.
*
* @return the current version
*/
String getLibraryVersion();
/**
* Get the API version.
*
* @return the current API version
*/
String getVersion();
/**
* Set the API version.
*
* @param version the new version
*/
void setVersion(final String version);
/**
* Get the request headers.
*
* @return the request headers
*/
Map<String, String> getRequestHeaders();
/**
* Add/update a request header.
*
* @param key the header key
* @param value the header value
* @return the new set of request headers
*/
Map<String, String> addRequestHeader(final String key, final String value);
/**
* Remove a request header.
*
* @param key the header key to remove
* @return the new set of request headers
*/
Map<String, String> removeRequestHeader(final String key);
/**
* Get the host.
*
* @return the host
*/
String getHost();
/**
* Set the host.
*
* @param host the new host
*/
void setHost(final String host);
/**
* Makes the call to the Twilio SendGrid API, override this method for testing.
*
* @param request the request to make
* @return the response object
* @throws IOException in case of a network error
*/
Response makeCall(final Request request) throws IOException;
/**
* Class api sets up the request to the Twilio SendGrid API, this is main interface.
*
* @param request the request object
* @return the response object
* @throws IOException in case of a network error
*/
Response api(final Request request) throws IOException;
}