Skip to content

Commit

Permalink
build: update gapic-generator-typescript to v4.4.1 (#1489)
Browse files Browse the repository at this point in the history
* feat: Trusted Private Cloud support, use the universeDomain parameter
feat: auto populate UUID fields where needed
fix: revert changes to streaming retries

Use gapic-generator-typescript v4.4.0.

PiperOrigin-RevId: 603757799

Source-Link: googleapis/googleapis@1a45bf7

Source-Link: googleapis/googleapis-gen@19ca4b4
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTljYTRiNDVhNTNkMDBjYjdiZGQ5NGI0NDJiNjBiZDIzN2RmZTEyMyJ9

* 🦉 Updates from OwlBot post-processor

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

* build: update gapic-generator-typescript to v4.4.1

PiperOrigin-RevId: 604765466

Source-Link: googleapis/googleapis@40203ca

Source-Link: googleapis/googleapis-gen@07b7f3d
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9

* 🦉 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: Cindy Peng <[email protected]>
  • Loading branch information
3 people authored Feb 9, 2024
1 parent 033ecb5 commit 53c5c24
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 52 deletions.
2 changes: 1 addition & 1 deletion samples/generated/v2/config_service_v2.list_buckets.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function main(parent) {
};

// Run request
const iterable = await loggingClient.listBucketsAsync(request);
const iterable = loggingClient.listBucketsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/generated/v2/config_service_v2.list_exclusions.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function main(parent) {
};

// Run request
const iterable = await loggingClient.listExclusionsAsync(request);
const iterable = loggingClient.listExclusionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/generated/v2/config_service_v2.list_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function main(parent) {
};

// Run request
const iterable = await loggingClient.listLinksAsync(request);
const iterable = loggingClient.listLinksAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/generated/v2/config_service_v2.list_sinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function main(parent) {
};

// Run request
const iterable = await loggingClient.listSinksAsync(request);
const iterable = loggingClient.listSinksAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/generated/v2/config_service_v2.list_views.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function main(parent) {
};

// Run request
const iterable = await loggingClient.listViewsAsync(request);
const iterable = loggingClient.listViewsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function main(resourceNames) {
};

// Run request
const iterable = await loggingClient.listLogEntriesAsync(request);
const iterable = loggingClient.listLogEntriesAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/generated/v2/logging_service_v2.list_logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function main(parent) {
};

// Run request
const iterable = await loggingClient.listLogsAsync(request);
const iterable = loggingClient.listLogsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function main() {

// Run request
const iterable =
await loggingClient.listMonitoredResourceDescriptorsAsync(request);
loggingClient.listMonitoredResourceDescriptorsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function main(parent) {
};

// Run request
const iterable = await loggingClient.listLogMetricsAsync(request);
const iterable = loggingClient.listLogMetricsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
58 changes: 52 additions & 6 deletions src/v2/config_service_v2_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import type {
import {Transform} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');

/**
* Client JSON configuration object, loaded from
* `src/v2/config_service_v2_client_config.json`.
Expand All @@ -52,6 +53,8 @@ export class ConfigServiceV2Client {
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
private _defaults: {[method: string]: gax.CallSettings};
private _universeDomain: string;
private _servicePath: string;
auth: gax.GoogleAuth;
descriptors: Descriptors = {
page: {},
Expand Down Expand Up @@ -110,8 +113,20 @@ export class ConfigServiceV2Client {
) {
// Ensure that options include all the required fields.
const staticMembers = this.constructor as typeof ConfigServiceV2Client;
if (
opts?.universe_domain &&
opts?.universeDomain &&
opts?.universe_domain !== opts?.universeDomain
) {
throw new Error(
'Please set either universe_domain or universeDomain, but not both.'
);
}
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
this._servicePath = 'logging.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
Expand All @@ -126,7 +141,7 @@ export class ConfigServiceV2Client {
opts.numericEnums = true;

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
if (servicePath !== this._servicePath && !('scopes' in opts)) {
opts['scopes'] = staticMembers.scopes;
}

Expand All @@ -151,10 +166,10 @@ export class ConfigServiceV2Client {
this.auth.useJWTAccessWithScope = true;

// Set defaultServicePath on the auth object.
this.auth.defaultServicePath = staticMembers.servicePath;
this.auth.defaultServicePath = this._servicePath;

// Set the default scopes in auth client if needed.
if (servicePath === staticMembers.servicePath) {
if (servicePath === this._servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}

Expand Down Expand Up @@ -558,21 +573,52 @@ export class ConfigServiceV2Client {

/**
* The DNS address for this API service.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
'Static servicePath is deprecated, please use the instance method instead.',
'DeprecationWarning'
);
}
return 'logging.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
* The DNS address for this API service - same as servicePath.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
'Static apiEndpoint is deprecated, please use the instance method instead.',
'DeprecationWarning'
);
}
return 'logging.googleapis.com';
}

/**
* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/
get apiEndpoint() {
return this._servicePath;
}

get universeDomain() {
return this._universeDomain;
}

/**
* The port for this API service.
* @returns {number} The default port for this service.
Expand Down
60 changes: 53 additions & 7 deletions src/v2/logging_service_v2_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import type {
import {Transform, PassThrough} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');

/**
* Client JSON configuration object, loaded from
* `src/v2/logging_service_v2_client_config.json`.
Expand All @@ -50,6 +51,8 @@ export class LoggingServiceV2Client {
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
private _defaults: {[method: string]: gax.CallSettings};
private _universeDomain: string;
private _servicePath: string;
auth: gax.GoogleAuth;
descriptors: Descriptors = {
page: {},
Expand Down Expand Up @@ -107,8 +110,20 @@ export class LoggingServiceV2Client {
) {
// Ensure that options include all the required fields.
const staticMembers = this.constructor as typeof LoggingServiceV2Client;
if (
opts?.universe_domain &&
opts?.universeDomain &&
opts?.universe_domain !== opts?.universeDomain
) {
throw new Error(
'Please set either universe_domain or universeDomain, but not both.'
);
}
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
this._servicePath = 'logging.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
Expand All @@ -123,7 +138,7 @@ export class LoggingServiceV2Client {
opts.numericEnums = true;

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
if (servicePath !== this._servicePath && !('scopes' in opts)) {
opts['scopes'] = staticMembers.scopes;
}

Expand All @@ -148,10 +163,10 @@ export class LoggingServiceV2Client {
this.auth.useJWTAccessWithScope = true;

// Set defaultServicePath on the auth object.
this.auth.defaultServicePath = staticMembers.servicePath;
this.auth.defaultServicePath = this._servicePath;

// Set the default scopes in auth client if needed.
if (servicePath === staticMembers.servicePath) {
if (servicePath === this._servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}

Expand Down Expand Up @@ -313,7 +328,7 @@ export class LoggingServiceV2Client {
tailLogEntries: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ true
/* gaxStreamingRetries: */ false
),
};

Expand Down Expand Up @@ -437,21 +452,52 @@ export class LoggingServiceV2Client {

/**
* The DNS address for this API service.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
'Static servicePath is deprecated, please use the instance method instead.',
'DeprecationWarning'
);
}
return 'logging.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
* The DNS address for this API service - same as servicePath.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
'Static apiEndpoint is deprecated, please use the instance method instead.',
'DeprecationWarning'
);
}
return 'logging.googleapis.com';
}

/**
* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/
get apiEndpoint() {
return this._servicePath;
}

get universeDomain() {
return this._universeDomain;
}

/**
* The port for this API service.
* @returns {number} The default port for this service.
Expand Down
Loading

0 comments on commit 53c5c24

Please sign in to comment.