private function setUrl(Url $url)
    {
        $urlValidationRegex = '_https:\/\/hooks.slack.com\/services\/[\w\/]+$_iuS';
        if (!preg_match($urlValidationRegex, (string) $url)) {
            throw new InvalidUrlException(
                sprintf(
                    'The url: "%s" is not a valid url.
                     Slack webhook urls should always start with "https://hooks.slack.com/services/"',
                    $url
                ),
                400
            );
        }
        $this->url = $url;

        return $this;
    }