PHP-клиент Google Api – вызов неопределенного метода UsersSettingsSendAs::list()Php

Кемеровские программисты php общаются здесь
Ответить
Anonymous
 PHP-клиент Google Api – вызов неопределенного метода UsersSettingsSendAs::list()

Сообщение Anonymous »

Мы пытаемся получить список электронных писем sendAs от пользователя с последней версией (2.13.2) клиентской библиотеки API Google для PHP.

Код: Выделить всё

$gmail = new Google_Service_Gmail($client);
$response = $gmail->users_settings_sendAs->list('my@email.tld');
Появляется ошибка 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'
Если я попробую другой метод (например, get), он будет работать так, как ожидалось...

Код: Выделить всё

$gmail = new Google_Service_Gmail($client);
$response = $gmail->users_settings_sendAs->get('my@email.tld','my@email.tld')->getSignature();
Файл api/vendor/google/apiclient-services/src/Gmail.php имеет метод get и список...

Код: Выделить всё

$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 от пользователя, но произошла ошибка (неопределенный метод). Есть идеи? Спасибо


Подробнее здесь: https://stackoverflow.com/questions/760 ... sendaslist
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»