google-ads-php icon indicating copy to clipboard operation
google-ads-php copied to clipboard

Add ability to pass configuration down from the Ads client layer to the GAPIC (generated) clients

Open bshaffer opened this issue 1 year ago • 1 comments

See https://github.com/googleapis/gax-php/issues/458

Users are hoping to configure GAPIC clients from the Ads client surface, but it's currently not possible. Users need to create the GAPIC clients directly in order to take advantage of GAPIC configuration. This could be done by providing an $options array to the build method (or somewhere else) which could be merged in with the default ads client configuration:

$options = ['transportConfig' => ['rest' => ['httpHandler' => $customHttpHandler]]];
// Currently the Ads clients do not accept configuration
$oAuth2Credential = (new OAuth2TokenBuilder())
    ->withClientOptions($options)
    ->build();

bshaffer avatar Jul 25 '23 17:07 bshaffer

Thanks for reporting. I'll include this in prioritization.

fiboknacky avatar Jul 27 '23 14:07 fiboknacky