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) : ''
);
$response =
$this->client->
request('POST',
$url,
[ 'json' =>
array_filter($options->
toArray()),
]);