如何检索 Google 日历资源 PHP API 客户端?

How do I retrieve Google Calendar Resources PHP API client?

如何使用 php-client I found same question here 获取 google 日历资源,我没有从回答中得到任何帮助。

是否可以使用 download google admin sdk PHP

从我公司的 google 日历中获取所有资源

我无法将任何示例或方法获取到此库中如何获取房间等所有资源。有任何方法可以从公司 google 日历中获取资源。

这是解决方案

$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->setScopes(['https://www.googleapis.com/auth/admin.directory.resource.calendar','https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly']);
$client->setSubject('user@domain.com');
$directoryService = new \Google_Service_Directory($client);

$resources = $directoryService->resources_calendars->listResourcesCalendars('my_customer')->getItems();

var_dump($resources);