Mailgun\Api\Domain::updateCredential PHP Method

updateCredential() public method

Update a set of SMTP credentials for the specified domain.
public updateCredential ( string $domain, string $login, string $pass ) : UpdateCredentialResponse | array | Psr\Http\Message\ResponseInterface
$domain string Name of the domain.
$login string SMTP Username.
$pass string New SMTP Password. Length min 5, max 32.
return Mailgun\Resource\Api\Domain\UpdateCredentialResponse | array | Psr\Http\Message\ResponseInterface
    public function updateCredential($domain, $login, $pass)
    {
        Assert::stringNotEmpty($domain);
        Assert::stringNotEmpty($login);
        Assert::stringNotEmpty($pass);
        Assert::lengthBetween($pass, 5, 32, 'SMTP password must be between 5 and 32 characters.');
        $params = ['password' => $pass];
        $response = $this->httpPut(sprintf('/v3/domains/%s/credentials/%s', $domain, $login), $params);
        return $this->deserializer->deserialize($response, UpdateCredentialResponse::class);
    }