throw new UnsupportedMessageTypeException(__CLASS__, ChatMessage::
class,
$message);
} if (($options =
$message->
getOptions()) && !
$options instanceof GoogleChatOptions
) { throw new LogicException(sprintf('The "%s" transport only supports instances of "%s" for options.', __CLASS__, GoogleChatOptions::
class));
} if (!
$options) { if ($notification =
$message->
getNotification()) { $options = GoogleChatOptions::
fromNotification($notification);
} else { $options = GoogleChatOptions::
fromMessage($message);
} } $threadKey =
$options->
getThreadKey() ?:
$this->threadKey;
$url =
sprintf('https://%s/v1/spaces/%s/messages?key=%s&token=%s%s',
$this->
getEndpoint(),
$this->space,
urlencode($this->accessKey
),
urlencode($this->accessToken
),
$threadKey ? '&threadKey='.
urlencode($threadKey) : ''
);