getThreadKey example

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()),
        ]);

        

        ];

        $this->assertSame($expected$options->toArray());
    }

    public function testOptionsWithThread()
    {
        $thread = 'fgh.ijk';
        $options = new GoogleChatOptions();
        $options->setThreadKey($thread);
        $this->assertSame($thread$options->getThreadKey());
        $options->setThreadKey(null);
        $this->assertNull($options->getThreadKey());
    }
}
Home | Imprint | This part of the site doesn't use cookies.