googleapis / google-api-php-client

A PHP client library for accessing Google APIs
http://googleapis.github.io/google-api-php-client/
Apache License 2.0
9.31k stars 3.52k forks source link

Support for "forHandle" parameter in youtube->channels->list request #2578

Closed alexschastny closed 6 months ago

alexschastny commented 6 months ago

i'm noted in the changelog that at 31.01.2024 api should support forHandle, but when i try to use it on the latest lib "google/apiclient": "^2.15.3" like

$result = $this->getYoutubeService()->channels->listChannels('id', ['forHandle' => $channelName]);

I get an exception

[2024-03-14T08:04:46.185822-07:00] google-api-php-client.ERROR: Service parameter unknown {"service":"youtube","resource":"channels","method":"list","parameter":"forHandle"} []
[error] Error processing stream ID: 9c400592-d638-11ee-9bf2-bd306e8dd87c with exception message: (list) unknown parameter: 'forHandle'

i guess that forHandle released at 31.01.2024, but lib 2.15.3 released at 04.01.2024, so looks like it just not supported yet, am i right?

dmitriynet commented 6 months ago

Have the same problem, do you have some progress with it?

yash30201 commented 6 months ago

Hi @alexschastny, thanks for asking this question.

I can see that forHandle option has been added and released in google-api-php-client-services on 5th Feb 2024.

This library depends upon the google-api-php-client-services (see composer.json) and all the service related files comes from there.

You can take advantage of latest product enhancements just by running a composer update from the root of your google-api-client-php as new library features don't depend upon google-api-client-php releases.

Please let me know if running composer update solved your issue.

alexschastny commented 6 months ago

Hey @yash30201 thanks for the help! Definitely, it is enough just to update the dependency google/apiclient-services from v0.293.0 to v0.340.0🔥