summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail/mailchimp-mandrill-api-php-da3adc10042e/src/Mandrill/Ips.php
blob: 2369c6bf085232eaef1658822c2cb14b407b749b (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<?php

class Postman_Mandrill_Ips {
    public function __construct(Postman_Mandrill $master) {
        $this->master = $master;
    }

    /**
     * Lists your dedicated IPs.
     * @return array an array of structs for each dedicated IP
     *     - return[] struct information about a single dedicated IP
     *         - ip string the ip address
     *         - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *         - pool string the name of the pool that this dedicated IP belongs to
     *         - domain string the domain name (reverse dns) of this dedicated IP
     *         - custom_dns struct information about the ip's custom dns, if it has been configured
     *             - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *             - valid boolean whether the ip's custom dns is currently valid
     *             - error string if the ip's custom dns is invalid, this will include details about the error
     *         - warmup struct information about the ip's warmup status
     *             - warming_up boolean whether the ip is currently in warmup mode
     *             - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *             - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function getList() {
        $_params = array();
        return $this->master->call('ips/list', $_params);
    }

    /**
     * Retrieves information about a single dedicated ip.
     * @param string $ip a dedicated IP address
     * @return struct Information about the dedicated ip
     *     - ip string the ip address
     *     - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *     - pool string the name of the pool that this dedicated IP belongs to
     *     - domain string the domain name (reverse dns) of this dedicated IP
     *     - custom_dns struct information about the ip's custom dns, if it has been configured
     *         - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *         - valid boolean whether the ip's custom dns is currently valid
     *         - error string if the ip's custom dns is invalid, this will include details about the error
     *     - warmup struct information about the ip's warmup status
     *         - warming_up boolean whether the ip is currently in warmup mode
     *         - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *         - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function info($ip) {
        $_params = array("ip" => $ip);
        return $this->master->call('ips/info', $_params);
    }

    /**
     * Requests an additional dedicated IP for your account. Accounts may
have one outstanding request at any time, and provisioning requests
are processed within 24 hours.
     * @param boolean $warmup whether to enable warmup mode for the ip
     * @param string $pool the id of the pool to add the dedicated ip to, or null to use your account's default pool
     * @return struct a description of the provisioning request that was created
     *     - requested_at string the date and time that the request was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
     */
    public function provision($warmup=false, $pool=null) {
        $_params = array("warmup" => $warmup, "pool" => $pool);
        return $this->master->call('ips/provision', $_params);
    }

    /**
     * Begins the warmup process for a dedicated IP. During the warmup process,
Mandrill will gradually increase the percentage of your mail that is sent over
the warming-up IP, over a period of roughly 30 days. The rest of your mail
will be sent over shared IPs or other dedicated IPs in the same pool.
     * @param string $ip a dedicated ip address
     * @return struct Information about the dedicated IP
     *     - ip string the ip address
     *     - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *     - pool string the name of the pool that this dedicated IP belongs to
     *     - domain string the domain name (reverse dns) of this dedicated IP
     *     - custom_dns struct information about the ip's custom dns, if it has been configured
     *         - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *         - valid boolean whether the ip's custom dns is currently valid
     *         - error string if the ip's custom dns is invalid, this will include details about the error
     *     - warmup struct information about the ip's warmup status
     *         - warming_up boolean whether the ip is currently in warmup mode
     *         - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *         - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function startWarmup($ip) {
        $_params = array("ip" => $ip);
        return $this->master->call('ips/start-warmup', $_params);
    }

    /**
     * Cancels the warmup process for a dedicated IP.
     * @param string $ip a dedicated ip address
     * @return struct Information about the dedicated IP
     *     - ip string the ip address
     *     - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *     - pool string the name of the pool that this dedicated IP belongs to
     *     - domain string the domain name (reverse dns) of this dedicated IP
     *     - custom_dns struct information about the ip's custom dns, if it has been configured
     *         - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *         - valid boolean whether the ip's custom dns is currently valid
     *         - error string if the ip's custom dns is invalid, this will include details about the error
     *     - warmup struct information about the ip's warmup status
     *         - warming_up boolean whether the ip is currently in warmup mode
     *         - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *         - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function cancelWarmup($ip) {
        $_params = array("ip" => $ip);
        return $this->master->call('ips/cancel-warmup', $_params);
    }

    /**
     * Moves a dedicated IP to a different pool.
     * @param string $ip a dedicated ip address
     * @param string $pool the name of the new pool to add the dedicated ip to
     * @param boolean $create_pool whether to create the pool if it does not exist; if false and the pool does not exist, an Unknown_Pool will be thrown.
     * @return struct Information about the updated state of the dedicated IP
     *     - ip string the ip address
     *     - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *     - pool string the name of the pool that this dedicated IP belongs to
     *     - domain string the domain name (reverse dns) of this dedicated IP
     *     - custom_dns struct information about the ip's custom dns, if it has been configured
     *         - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *         - valid boolean whether the ip's custom dns is currently valid
     *         - error string if the ip's custom dns is invalid, this will include details about the error
     *     - warmup struct information about the ip's warmup status
     *         - warming_up boolean whether the ip is currently in warmup mode
     *         - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *         - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function setPool($ip, $pool, $create_pool=false) {
        $_params = array("ip" => $ip, "pool" => $pool, "create_pool" => $create_pool);
        return $this->master->call('ips/set-pool', $_params);
    }

    /**
     * Deletes a dedicated IP. This is permanent and cannot be undone.
     * @param string $ip the dedicated ip to remove from your account
     * @return struct a description of the ip that was removed from your account.
     *     - ip string the ip address
     *     - deleted string a boolean indicating whether the ip was successfully deleted
     */
    public function delete($ip) {
        $_params = array("ip" => $ip);
        return $this->master->call('ips/delete', $_params);
    }

    /**
     * Lists your dedicated IP pools.
     * @return array the dedicated IP pools for your account, up to a maximum of 1,000
     *     - return[] struct information about each dedicated IP pool
     *         - name string this pool's name
     *         - created_at string the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
     *         - ips array the dedicated IPs in this pool
     *             - ips[] struct information about each dedicated IP
     *                 - ip string the ip address
     *                 - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *                 - pool string the name of the pool that this dedicated IP belongs to
     *                 - domain string the domain name (reverse dns) of this dedicated IP
     *                 - custom_dns struct information about the ip's custom dns, if it has been configured
     *                     - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *                     - valid boolean whether the ip's custom dns is currently valid
     *                     - error string if the ip's custom dns is invalid, this will include details about the error
     *                 - warmup struct information about the ip's warmup status
     *                     - warming_up boolean whether the ip is currently in warmup mode
     *                     - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *                     - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function listPools() {
        $_params = array();
        return $this->master->call('ips/list-pools', $_params);
    }

    /**
     * Describes a single dedicated IP pool.
     * @param string $pool a pool name
     * @return struct Information about the dedicated ip pool
     *     - name string this pool's name
     *     - created_at string the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
     *     - ips array the dedicated IPs in this pool
     *         - ips[] struct information about each dedicated IP
     *             - ip string the ip address
     *             - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *             - pool string the name of the pool that this dedicated IP belongs to
     *             - domain string the domain name (reverse dns) of this dedicated IP
     *             - custom_dns struct information about the ip's custom dns, if it has been configured
     *                 - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *                 - valid boolean whether the ip's custom dns is currently valid
     *                 - error string if the ip's custom dns is invalid, this will include details about the error
     *             - warmup struct information about the ip's warmup status
     *                 - warming_up boolean whether the ip is currently in warmup mode
     *                 - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *                 - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function poolInfo($pool) {
        $_params = array("pool" => $pool);
        return $this->master->call('ips/pool-info', $_params);
    }

    /**
     * Creates a pool and returns it. If a pool already exists with this
name, no action will be performed.
     * @param string $pool the name of a pool to create
     * @return struct Information about the dedicated ip pool
     *     - name string this pool's name
     *     - created_at string the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
     *     - ips array the dedicated IPs in this pool
     *         - ips[] struct information about each dedicated IP
     *             - ip string the ip address
     *             - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *             - pool string the name of the pool that this dedicated IP belongs to
     *             - domain string the domain name (reverse dns) of this dedicated IP
     *             - custom_dns struct information about the ip's custom dns, if it has been configured
     *                 - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *                 - valid boolean whether the ip's custom dns is currently valid
     *                 - error string if the ip's custom dns is invalid, this will include details about the error
     *             - warmup struct information about the ip's warmup status
     *                 - warming_up boolean whether the ip is currently in warmup mode
     *                 - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *                 - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function createPool($pool) {
        $_params = array("pool" => $pool);
        return $this->master->call('ips/create-pool', $_params);
    }

    /**
     * Deletes a pool. A pool must be empty before you can delete it, and you cannot delete your default pool.
     * @param string $pool the name of the pool to delete
     * @return struct information about the status of the pool that was deleted
     *     - pool string the name of the pool
     *     - deleted boolean whether the pool was deleted
     */
    public function deletePool($pool) {
        $_params = array("pool" => $pool);
        return $this->master->call('ips/delete-pool', $_params);
    }

    /**
     * Tests whether a domain name is valid for use as the custom reverse
DNS for a dedicated IP.
     * @param string $ip a dedicated ip address
     * @param string $domain the domain name to test
     * @return struct validation results for the domain
     *     - valid string whether the domain name has a correctly-configured A record pointing to the ip address
     *     - error string if valid is false, this will contain details about why the domain's A record is incorrect
     */
    public function checkCustomDns($ip, $domain) {
        $_params = array("ip" => $ip, "domain" => $domain);
        return $this->master->call('ips/check-custom-dns', $_params);
    }

    /**
     * Configures the custom DNS name for a dedicated IP.
     * @param string $ip a dedicated ip address
     * @param string $domain a domain name to set as the dedicated IP's custom dns name.
     * @return struct information about the dedicated IP's new configuration
     *     - ip string the ip address
     *     - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
     *     - pool string the name of the pool that this dedicated IP belongs to
     *     - domain string the domain name (reverse dns) of this dedicated IP
     *     - custom_dns struct information about the ip's custom dns, if it has been configured
     *         - enabled boolean a boolean indicating whether custom dns has been configured for this ip
     *         - valid boolean whether the ip's custom dns is currently valid
     *         - error string if the ip's custom dns is invalid, this will include details about the error
     *     - warmup struct information about the ip's warmup status
     *         - warming_up boolean whether the ip is currently in warmup mode
     *         - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     *         - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
     */
    public function setCustomDns($ip, $domain) {
        $_params = array("ip" => $ip, "domain" => $domain);
        return $this->master->call('ips/set-custom-dns', $_params);
    }

}