Closed hashimoto-AJ closed 1 year ago
Could you try changing the key of the array in these lines to be snake case, e.g., customerId
-> customer_id
, geoTargetConstants
-> geo_target_constants
?
Is it an error in the sample code?
I think perhaps it's a bug in that particular example. GAPIC generated code sometimes uses both snake cases and camel cases. So, can you run it now?
The problem solved. But, it may not be related to this case, but the following message is output.
Deprecated: Return type of GetOpt\GetOpt::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/google-ads-php/vendor/ulrichsg/getopt-php/src/GetOpt.php on line 583
Deprecated: Return type of GetOpt\GetOpt::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/google-ads-php/vendor/ulrichsg/getopt-php/src/GetOpt.php on line 529
Deprecated: Return type of GetOpt\GetOpt::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/google-ads-php/vendor/ulrichsg/getopt-php/src/GetOpt.php on line 545
Deprecated: Return type of GetOpt\GetOpt::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/google-ads-php/vendor/ulrichsg/getopt-php/src/GetOpt.php on line 561
Deprecated: Return type of GetOpt\GetOpt::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/google-ads-php/vendor/ulrichsg/getopt-php/src/GetOpt.php on line 572
Deprecated: Return type of GetOpt\GetOpt::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/google-ads-php/vendor/ulrichsg/getopt-php/src/GetOpt.php on line 509
It's because of the GetOpt library. You can ignore that.
from Google Ads API and AdWords API Forum
My client library and Google Ads API versions:
My environment: PHP version : 8.2.8 Dokcer Desktop(windows11) 5.10.16.3-microsoft-standard-WSL2
Description of the bug: Seeing the notes on this page, I applied this sample code to see how GAPIC v2 works. But I get an error. I tried to get the AdsAPI log, but nothing is output. Please advise the solution.
Regards,
Request/Response Logs: