Google Api PHP 客户端 - 调用未定义的方法 UsersSettingsSendAs::list()

问题描述 投票:0回答:0

我们正在尝试从使用最新版本 (2.13.2) 的 PHP 谷歌 API 客户端库的用户处获取“sendAs”电子邮件列表。

$gmail = new Google_Service_Gmail($client);
$response = $gmail->users_settings_sendAs->list('[email protected]');

错误 500 出现并且 apache 日志上的这一行:

[Mon Apr 24 12:50:37.233655 2023] [proxy_fcgi:error] [pid 4185936:tid 139798719207168] [client 90.161.67.44:35704] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Google\\Service\\Gmail\\Resource\\UsersSettingsSendAs::list() in /path/to/index.php:19\nStack trace:\n#0 {main}\n  thrown in /path/to/index.php on line 19'

如果我尝试另一种方法(例如获取)按预期工作...

$gmail = new Google_Service_Gmail($client);
$response = $gmail->users_settings_sendAs->get('[email protected]','[email protected]')->getSignature();

文件 api/vendor/google/apiclient-services/src/Gmail.php 有 get 和 list ...

$this->users_settings_sendAs = new Gmail\Resource\UsersSettingsSendAs(
        $this,
        $this->serviceName,
        'sendAs',
        [
          'methods' => [
            ...,'get' => [
              'path' => 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}',
              'httpMethod' => 'GET',
              'parameters' => [
                'userId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
                'sendAsEmail' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],'list' => [
              'path' => 'gmail/v1/users/{userId}/settings/sendAs',
              'httpMethod' => 'GET',
              'parameters' => [
                'userId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],...

我试图从用户那里获取 sendAs 电子邮件列表,但发生了错误(未定义的方法)。有任何想法吗?谢谢

google-api-php-client google-workspace
© www.soinside.com 2019 - 2024. All rights reserved.