-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathPhaxio.java
More file actions
45 lines (35 loc) · 1.46 KB
/
Copy pathPhaxio.java
File metadata and controls
45 lines (35 loc) · 1.46 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
package com.phaxio;
import java.net.Proxy;
import com.phaxio.repositories.*;
import com.phaxio.services.Requests;
/**
* The Phaxio API client.
*/
public class Phaxio {
private static final String PHAXIO_SERVICE = "https://api.phaxio.com:%s";
private static final String PHAXIO_VERSION_SEGMENT = "/v2.1/";
private static final String PHAXIO_ENDPOINT = PHAXIO_SERVICE + PHAXIO_VERSION_SEGMENT;
private static final int PHAXIO_PORT = 443;
public Phaxio(String key, String secret) {
this(key, secret, PHAXIO_ENDPOINT, PHAXIO_PORT,null);
}
public Phaxio(String key, String secret, Proxy proxy) {
this(key, secret, PHAXIO_ENDPOINT, PHAXIO_PORT, proxy);
}
public Phaxio(String key, String secret, String endpoint, int port) {
this(key, secret, endpoint, port, null);
}
private Phaxio(String key, String secret, String endpoint, int port, Proxy proxy) {
Requests requests = new Requests(key, secret, endpoint, port, proxy);
fax = new FaxRepository(requests);
publicInfo = new PublicRepository(requests);
account = new AccountRepository(requests);
phoneNumber = new PhoneNumberRepository(requests);
phaxCode = new PhaxCodeRepository(requests);
}
public final FaxRepository fax;
public final PublicRepository publicInfo;
public final AccountRepository account;
public final PhoneNumberRepository phoneNumber;
public final PhaxCodeRepository phaxCode;
}