| @@ 42-55 (lines=14) @@ | ||
| 39 | * |
|
| 40 | * @return ValidateResponse |
|
| 41 | */ |
|
| 42 | public function validate(string $address, $mailboxVerification = false) |
|
| 43 | { |
|
| 44 | Assert::stringNotEmpty($address); |
|
| 45 | Assert::boolean($mailboxVerification); |
|
| 46 | ||
| 47 | $params = [ |
|
| 48 | 'address' => $address, |
|
| 49 | 'mailbox_verification' => $mailboxVerification, |
|
| 50 | ]; |
|
| 51 | ||
| 52 | $response = $this->httpGet('/address/private/validate', $params); |
|
| 53 | ||
| 54 | return $this->hydrateResponse($response, ValidateResponse::class); |
|
| 55 | } |
|
| 56 | ||
| 57 | /** |
|
| 58 | * Parses a delimiter-separated list of email addresses into two lists: parsed addresses and unparsable portions. |
|
| @@ 81-97 (lines=17) @@ | ||
| 78 | * |
|
| 79 | * @return ParseResponse |
|
| 80 | */ |
|
| 81 | public function parse($addresses, $syntaxOnly = true) |
|
| 82 | { |
|
| 83 | Assert::stringNotEmpty($addresses); |
|
| 84 | Assert::maxLength($addresses, 8000); |
|
| 85 | ||
| 86 | // Validates the Syntax Only verification. |
|
| 87 | Assert::boolean($syntaxOnly); |
|
| 88 | ||
| 89 | $params = [ |
|
| 90 | 'addresses' => $addresses, |
|
| 91 | 'syntax_only' => $syntaxOnly, |
|
| 92 | ]; |
|
| 93 | ||
| 94 | $response = $this->httpGet('/address/private/parse', $params); |
|
| 95 | ||
| 96 | return $this->hydrateResponse($response, ParseResponse::class); |
|
| 97 | } |
|
| 98 | } |
|
| 99 | ||
| @@ 33-44 (lines=12) @@ | ||
| 30 | * |
|
| 31 | * @return IndexResponse|ResponseInterface |
|
| 32 | */ |
|
| 33 | public function index(bool $dedicated = false) |
|
| 34 | { |
|
| 35 | Assert::boolean($dedicated); |
|
| 36 | ||
| 37 | $params = [ |
|
| 38 | 'dedicated' => $dedicated, |
|
| 39 | ]; |
|
| 40 | ||
| 41 | $response = $this->httpGet('/v3/ips', $params); |
|
| 42 | ||
| 43 | return $this->hydrateResponse($response, IndexResponse::class); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Returns a list of IPs assigned to a domain. |
|
| @@ 38-48 (lines=11) @@ | ||
| 35 | * |
|
| 36 | * @return IndexResponse|ResponseInterface |
|
| 37 | */ |
|
| 38 | public function index(string $domain, int $limit = 100) |
|
| 39 | { |
|
| 40 | Assert::stringNotEmpty($domain); |
|
| 41 | $params = [ |
|
| 42 | 'limit' => $limit, |
|
| 43 | ]; |
|
| 44 | ||
| 45 | $response = $this->httpGet(sprintf('/v3/%s/tags', $domain), $params); |
|
| 46 | ||
| 47 | return $this->hydrateResponse($response, IndexResponse::class); |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * Returns a single tag. |
|