|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* Copyright (C) 2013 Mailgun |
|
5
|
|
|
* |
|
6
|
|
|
* This software may be modified and distributed under the terms |
|
7
|
|
|
* of the MIT license. See the LICENSE file for details. |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace Mailgun\Api; |
|
11
|
|
|
|
|
12
|
|
|
use Http\Client\HttpClient; |
|
13
|
|
|
use Mailgun\Api\Suppression\Bounce; |
|
14
|
|
|
use Mailgun\Api\Suppression\Complaint; |
|
15
|
|
|
use Mailgun\Api\Suppression\Unsubscribe; |
|
16
|
|
|
use Mailgun\Hydrator\Hydrator; |
|
17
|
|
|
use Mailgun\RequestBuilder; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @see https://documentation.mailgun.com/api-suppressions.html |
|
21
|
|
|
* |
|
22
|
|
|
* @author Sean Johnson <[email protected]> |
|
23
|
|
|
*/ |
|
24
|
|
|
class Suppression |
|
25
|
|
|
{ |
|
26
|
|
|
/** |
|
27
|
|
|
* @var HttpClient |
|
28
|
|
|
*/ |
|
29
|
|
|
private $httpClient; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var RequestBuilder |
|
33
|
|
|
*/ |
|
34
|
|
|
private $requestBuilder; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var Hydrator |
|
38
|
|
|
*/ |
|
39
|
|
|
private $hydrator; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @param HttpClient $httpClient |
|
43
|
|
|
* @param RequestBuilder $requestBuilder |
|
44
|
|
|
* @param Hydrator $hydrator |
|
45
|
|
|
*/ |
|
46
|
3 |
|
public function __construct(HttpClient $httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator) |
|
47
|
|
|
{ |
|
48
|
3 |
|
$this->httpClient = $httpClient; |
|
49
|
3 |
|
$this->requestBuilder = $requestBuilder; |
|
50
|
3 |
|
$this->hydrator = $hydrator; |
|
51
|
3 |
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @return Bounce |
|
55
|
|
|
*/ |
|
56
|
1 |
|
public function bounces() |
|
57
|
|
|
{ |
|
58
|
1 |
|
return new Bounce($this->httpClient, $this->requestBuilder, $this->hydrator); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @return Complaint |
|
63
|
|
|
*/ |
|
64
|
1 |
|
public function complaints() |
|
65
|
|
|
{ |
|
66
|
1 |
|
return new Complaint($this->httpClient, $this->requestBuilder, $this->hydrator); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @return Unsubscribe |
|
71
|
|
|
*/ |
|
72
|
1 |
|
public function unsubscribes() |
|
73
|
|
|
{ |
|
74
|
1 |
|
return new Unsubscribe($this->httpClient, $this->requestBuilder, $this->hydrator); |
|
75
|
|
|
} |
|
76
|
|
|
} |
|
77
|
|
|
|