2017-02-20 13:57:54 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2017-11-22 00:37:04 -08:00
|
|
|
* Copyright (C) 2013 Mailgun
|
2017-02-20 13:57:54 -06:00
|
|
|
*
|
|
|
|
* This software may be modified and distributed under the terms
|
|
|
|
* of the MIT license. See the LICENSE file for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Mailgun\Api;
|
|
|
|
|
|
|
|
use Http\Client\HttpClient;
|
2017-04-07 21:31:57 +02:00
|
|
|
use Mailgun\Api\Suppression\Bounce;
|
|
|
|
use Mailgun\Api\Suppression\Complaint;
|
|
|
|
use Mailgun\Api\Suppression\Unsubscribe;
|
2017-03-22 07:44:08 +01:00
|
|
|
use Mailgun\Hydrator\Hydrator;
|
2017-02-20 13:57:54 -06:00
|
|
|
use Mailgun\RequestBuilder;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see https://documentation.mailgun.com/api-suppressions.html
|
|
|
|
*
|
|
|
|
* @author Sean Johnson <sean@mailgun.com>
|
|
|
|
*/
|
2017-03-22 07:44:08 +01:00
|
|
|
class Suppression
|
2017-02-20 13:57:54 -06:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var HttpClient
|
|
|
|
*/
|
|
|
|
private $httpClient;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var RequestBuilder
|
|
|
|
*/
|
|
|
|
private $requestBuilder;
|
|
|
|
|
|
|
|
/**
|
2017-03-22 07:44:08 +01:00
|
|
|
* @var Hydrator
|
2017-02-20 13:57:54 -06:00
|
|
|
*/
|
2017-03-22 07:44:08 +01:00
|
|
|
private $hydrator;
|
2017-02-20 13:57:54 -06:00
|
|
|
|
|
|
|
/**
|
2017-03-22 07:44:08 +01:00
|
|
|
* @param HttpClient $httpClient
|
|
|
|
* @param RequestBuilder $requestBuilder
|
|
|
|
* @param Hydrator $hydrator
|
2017-02-20 13:57:54 -06:00
|
|
|
*/
|
2017-03-22 07:44:08 +01:00
|
|
|
public function __construct(HttpClient $httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator)
|
2017-02-20 13:57:54 -06:00
|
|
|
{
|
|
|
|
$this->httpClient = $httpClient;
|
|
|
|
$this->requestBuilder = $requestBuilder;
|
2017-03-22 07:44:08 +01:00
|
|
|
$this->hydrator = $hydrator;
|
2017-02-20 13:57:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-03-22 07:44:08 +01:00
|
|
|
* @return Bounce
|
2017-02-20 13:57:54 -06:00
|
|
|
*/
|
|
|
|
public function bounces()
|
|
|
|
{
|
2017-03-22 07:44:08 +01:00
|
|
|
return new Bounce($this->httpClient, $this->requestBuilder, $this->hydrator);
|
2017-02-20 13:57:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-03-22 07:44:08 +01:00
|
|
|
* @return Complaint
|
2017-02-20 13:57:54 -06:00
|
|
|
*/
|
|
|
|
public function complaints()
|
|
|
|
{
|
2017-03-22 07:44:08 +01:00
|
|
|
return new Complaint($this->httpClient, $this->requestBuilder, $this->hydrator);
|
2017-02-20 13:57:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-03-22 07:44:08 +01:00
|
|
|
* @return Unsubscribe
|
2017-02-20 13:57:54 -06:00
|
|
|
*/
|
|
|
|
public function unsubscribes()
|
|
|
|
{
|
2017-03-22 07:44:08 +01:00
|
|
|
return new Unsubscribe($this->httpClient, $this->requestBuilder, $this->hydrator);
|
2017-02-20 13:57:54 -06:00
|
|
|
}
|
|
|
|
}
|