Example #1
0
 /**
  * Updates the specified delivery connection settings for the specified domain.
  * If a parameter is passed in as null, it will not be updated.
  *
  * @param string    $domain     Name of the domain.
  * @param bool|null $requireTLS Enforces that messages are sent only over a TLS connection.
  * @param bool|null $noVerify   Disables TLS certificate and hostname verification.
  *
  * @return UpdateConnectionResponse|array|ResponseInterface
  */
 public function updateConnection($domain, $requireTLS, $noVerify)
 {
     Assert::stringNotEmpty($domain);
     Assert::nullOrBoolean($requireTLS);
     Assert::nullOrBoolean($noVerify);
     $params = [];
     if (null !== $requireTLS) {
         $params['require_tls'] = $requireTLS ? 'true' : 'false';
     }
     if (null !== $noVerify) {
         $params['skip_verification'] = $noVerify ? 'true' : 'false';
     }
     $response = $this->httpPut(sprintf('/v3/domains/%s/connection', $domain), $params);
     return $this->deserializer->deserialize($response, UpdateConnectionResponse::class);
 }