Skip to content

Commit

Permalink
fix: use _gaxModule when accessing gax for bundling (#1322)
Browse files Browse the repository at this point in the history
* feat: accept google-gax instance as a parameter

Please see the documentation of the client constructor for details.

PiperOrigin-RevId: 470332808

Source-Link: googleapis/googleapis@d4a2367

Source-Link: googleapis/googleapis-gen@e97a1ac
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: use _gaxModule when accessing gax for bundling

PiperOrigin-RevId: 470911839

Source-Link: googleapis/googleapis@3527566

Source-Link: googleapis/googleapis-gen@f16a1d2
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: accept gax instance in Logging

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Alexander Fenster <[email protected]>
  • Loading branch information
3 people committed Aug 31, 2022
1 parent f125d8e commit 9cd207d
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 84 deletions.
14 changes: 10 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class Logging {
configService?: typeof v2.ConfigServiceV2Client;
loggingService?: typeof v2.LoggingServiceV2Client;

constructor(options?: LoggingOptions) {
constructor(options?: LoggingOptions, gaxInstance?: typeof gax) {
// Determine what scopes are needed.
// It is the union of the scopes on all three clients.
const scopes: Array<{}> = [];
Expand All @@ -292,11 +292,17 @@ class Logging {
options
);
this.api = {};
this.auth = new gax.GoogleAuth(options_);
this.auth = new (gaxInstance ?? gax).GoogleAuth(options_);
this.options = options_;
this.projectId = this.options.projectId || '{{projectId}}';
this.configService = new v2.ConfigServiceV2Client(this.options);
this.loggingService = new v2.LoggingServiceV2Client(this.options);
this.configService = new v2.ConfigServiceV2Client(
this.options,
gaxInstance
);
this.loggingService = new v2.LoggingServiceV2Client(
this.options,
gaxInstance
);
}

/**
Expand Down

0 comments on commit 9cd207d

Please sign in to comment.