Skip to content

Commit 09e59ad

Browse files
feat: Trusted Private Cloud support, use the universeDomain parameter (#5029)
* 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWRldnRvb2xzLWNvbnRhaW5lcmFuYWx5c2lzLy5Pd2xCb3QueWFtbCIsImgiOiIwN2I3ZjNkYWQ4YWExOTEyZDRhY2RjZmQ2MzY1YmI0MjM2ZTRiNTRiIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWlhbS1jcmVkZW50aWFscy8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWlhbS8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWlkZW50aXR5LWFjY2Vzc2NvbnRleHRtYW5hZ2VyLy5Pd2xCb3QueWFtbCIsImgiOiIwN2I3ZjNkYWQ4YWExOTEyZDRhY2RjZmQ2MzY1YmI0MjM2ZTRiNTRiIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtYWRkcmVzc3ZhbGlkYXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjA3YjdmM2RhZDhhYTE5MTJkNGFjZGNmZDYzNjViYjQyMzZlNGI1NGIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtbWFwc3BsYXRmb3JtZGF0YXNldHMvLk93bEJvdC55YW1sIiwiaCI6IjA3YjdmM2RhZDhhYTE5MTJkNGFjZGNmZDYzNjViYjQyMzZlNGI1NGIifQ== Copy-Tag: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lLXN0b3JhZ2V0cmFuc2Zlci8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ3JhZmVhcy8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Trusted Private Cloud support, use the universeDomain parameter --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Alexander Fenster <[email protected]>
1 parent 852f3eb commit 09e59ad

76 files changed

Lines changed: 2401 additions & 348 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function main(name) {
5959
};
6060

6161
// Run request
62-
const iterable = await containeranalysisClient.listNoteOccurrencesAsync(request);
62+
const iterable = containeranalysisClient.listNoteOccurrencesAsync(request);
6363
for await (const response of iterable) {
6464
console.log(response);
6565
}

packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function main(parent) {
6060
};
6161

6262
// Run request
63-
const iterable = await containeranalysisClient.listNotesAsync(request);
63+
const iterable = containeranalysisClient.listNotesAsync(request);
6464
for await (const response of iterable) {
6565
console.log(response);
6666
}

packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function main(parent) {
6060
};
6161

6262
// Run request
63-
const iterable = await containeranalysisClient.listOccurrencesAsync(request);
63+
const iterable = containeranalysisClient.listOccurrencesAsync(request);
6464
for await (const response of iterable) {
6565
console.log(response);
6666
}

packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_note_occurrences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function main() {
5858
};
5959

6060
// Run request
61-
const iterable = await containeranalysisClient.listNoteOccurrencesAsync(request);
61+
const iterable = containeranalysisClient.listNoteOccurrencesAsync(request);
6262
for await (const response of iterable) {
6363
console.log(response);
6464
}

packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_notes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function main() {
5858
};
5959

6060
// Run request
61-
const iterable = await containeranalysisClient.listNotesAsync(request);
61+
const iterable = containeranalysisClient.listNotesAsync(request);
6262
for await (const response of iterable) {
6363
console.log(response);
6464
}

packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_occurrences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function main() {
5858
};
5959

6060
// Run request
61-
const iterable = await containeranalysisClient.listOccurrencesAsync(request);
61+
const iterable = containeranalysisClient.listOccurrencesAsync(request);
6262
for await (const response of iterable) {
6363
console.log(response);
6464
}

packages/google-devtools-containeranalysis/src/v1/container_analysis_client.ts

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import type {
2828

2929
import * as protos from '../../protos/protos';
3030
import jsonProtos = require('../../protos/protos.json');
31+
3132
/**
3233
* Client JSON configuration object, loaded from
3334
* `src/v1/container_analysis_client_config.json`.
@@ -61,6 +62,8 @@ export class ContainerAnalysisClient {
6162
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
6263
private _protos: {};
6364
private _defaults: {[method: string]: gax.CallSettings};
65+
private _universeDomain: string;
66+
private _servicePath: string;
6467
auth: gax.GoogleAuth;
6568
descriptors: Descriptors = {
6669
page: {},
@@ -118,8 +121,20 @@ export class ContainerAnalysisClient {
118121
) {
119122
// Ensure that options include all the required fields.
120123
const staticMembers = this.constructor as typeof ContainerAnalysisClient;
124+
if (
125+
opts?.universe_domain &&
126+
opts?.universeDomain &&
127+
opts?.universe_domain !== opts?.universeDomain
128+
) {
129+
throw new Error(
130+
'Please set either universe_domain or universeDomain, but not both.'
131+
);
132+
}
133+
this._universeDomain =
134+
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
135+
this._servicePath = 'containeranalysis.' + this._universeDomain;
121136
const servicePath =
122-
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
137+
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
123138
this._providedCustomServicePath = !!(
124139
opts?.servicePath || opts?.apiEndpoint
125140
);
@@ -134,7 +149,7 @@ export class ContainerAnalysisClient {
134149
opts.numericEnums = true;
135150

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

@@ -159,10 +174,10 @@ export class ContainerAnalysisClient {
159174
this.auth.useJWTAccessWithScope = true;
160175

161176
// Set defaultServicePath on the auth object.
162-
this.auth.defaultServicePath = staticMembers.servicePath;
177+
this.auth.defaultServicePath = this._servicePath;
163178

164179
// Set the default scopes in auth client if needed.
165-
if (servicePath === staticMembers.servicePath) {
180+
if (servicePath === this._servicePath) {
166181
this.auth.defaultScopes = staticMembers.scopes;
167182
}
168183

@@ -286,21 +301,52 @@ export class ContainerAnalysisClient {
286301

287302
/**
288303
* The DNS address for this API service.
304+
* @deprecated Use the apiEndpoint method of the client instance.
289305
* @returns {string} The DNS address for this service.
290306
*/
291307
static get servicePath() {
308+
if (
309+
typeof process !== undefined &&
310+
typeof process.emitWarning === 'function'
311+
) {
312+
process.emitWarning(
313+
'Static servicePath is deprecated, please use the instance method instead.',
314+
'DeprecationWarning'
315+
);
316+
}
292317
return 'containeranalysis.googleapis.com';
293318
}
294319

295320
/**
296-
* The DNS address for this API service - same as servicePath(),
297-
* exists for compatibility reasons.
321+
* The DNS address for this API service - same as servicePath.
322+
* @deprecated Use the apiEndpoint method of the client instance.
298323
* @returns {string} The DNS address for this service.
299324
*/
300325
static get apiEndpoint() {
326+
if (
327+
typeof process !== undefined &&
328+
typeof process.emitWarning === 'function'
329+
) {
330+
process.emitWarning(
331+
'Static apiEndpoint is deprecated, please use the instance method instead.',
332+
'DeprecationWarning'
333+
);
334+
}
301335
return 'containeranalysis.googleapis.com';
302336
}
303337

338+
/**
339+
* The DNS address for this API service.
340+
* @returns {string} The DNS address for this service.
341+
*/
342+
get apiEndpoint() {
343+
return this._servicePath;
344+
}
345+
346+
get universeDomain() {
347+
return this._universeDomain;
348+
}
349+
304350
/**
305351
* The port for this API service.
306352
* @returns {number} The default port for this service.

packages/google-devtools-containeranalysis/src/v1beta1/container_analysis_v1_beta1_client.ts

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import type {
2727

2828
import * as protos from '../../protos/protos';
2929
import jsonProtos = require('../../protos/protos.json');
30+
3031
/**
3132
* Client JSON configuration object, loaded from
3233
* `src/v1beta1/container_analysis_v1_beta1_client_config.json`.
@@ -60,6 +61,8 @@ export class ContainerAnalysisV1Beta1Client {
6061
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
6162
private _protos: {};
6263
private _defaults: {[method: string]: gax.CallSettings};
64+
private _universeDomain: string;
65+
private _servicePath: string;
6366
auth: gax.GoogleAuth;
6467
descriptors: Descriptors = {
6568
page: {},
@@ -117,8 +120,20 @@ export class ContainerAnalysisV1Beta1Client {
117120
// Ensure that options include all the required fields.
118121
const staticMembers = this
119122
.constructor as typeof ContainerAnalysisV1Beta1Client;
123+
if (
124+
opts?.universe_domain &&
125+
opts?.universeDomain &&
126+
opts?.universe_domain !== opts?.universeDomain
127+
) {
128+
throw new Error(
129+
'Please set either universe_domain or universeDomain, but not both.'
130+
);
131+
}
132+
this._universeDomain =
133+
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
134+
this._servicePath = 'containeranalysis.' + this._universeDomain;
120135
const servicePath =
121-
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
136+
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
122137
this._providedCustomServicePath = !!(
123138
opts?.servicePath || opts?.apiEndpoint
124139
);
@@ -133,7 +148,7 @@ export class ContainerAnalysisV1Beta1Client {
133148
opts.numericEnums = true;
134149

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

@@ -158,10 +173,10 @@ export class ContainerAnalysisV1Beta1Client {
158173
this.auth.useJWTAccessWithScope = true;
159174

160175
// Set defaultServicePath on the auth object.
161-
this.auth.defaultServicePath = staticMembers.servicePath;
176+
this.auth.defaultServicePath = this._servicePath;
162177

163178
// Set the default scopes in auth client if needed.
164-
if (servicePath === staticMembers.servicePath) {
179+
if (servicePath === this._servicePath) {
165180
this.auth.defaultScopes = staticMembers.scopes;
166181
}
167182

@@ -271,21 +286,52 @@ export class ContainerAnalysisV1Beta1Client {
271286

272287
/**
273288
* The DNS address for this API service.
289+
* @deprecated Use the apiEndpoint method of the client instance.
274290
* @returns {string} The DNS address for this service.
275291
*/
276292
static get servicePath() {
293+
if (
294+
typeof process !== undefined &&
295+
typeof process.emitWarning === 'function'
296+
) {
297+
process.emitWarning(
298+
'Static servicePath is deprecated, please use the instance method instead.',
299+
'DeprecationWarning'
300+
);
301+
}
277302
return 'containeranalysis.googleapis.com';
278303
}
279304

280305
/**
281-
* The DNS address for this API service - same as servicePath(),
282-
* exists for compatibility reasons.
306+
* The DNS address for this API service - same as servicePath.
307+
* @deprecated Use the apiEndpoint method of the client instance.
283308
* @returns {string} The DNS address for this service.
284309
*/
285310
static get apiEndpoint() {
311+
if (
312+
typeof process !== undefined &&
313+
typeof process.emitWarning === 'function'
314+
) {
315+
process.emitWarning(
316+
'Static apiEndpoint is deprecated, please use the instance method instead.',
317+
'DeprecationWarning'
318+
);
319+
}
286320
return 'containeranalysis.googleapis.com';
287321
}
288322

323+
/**
324+
* The DNS address for this API service.
325+
* @returns {string} The DNS address for this service.
326+
*/
327+
get apiEndpoint() {
328+
return this._servicePath;
329+
}
330+
331+
get universeDomain() {
332+
return this._universeDomain;
333+
}
334+
289335
/**
290336
* The port for this API service.
291337
* @returns {number} The default port for this service.

0 commit comments

Comments
 (0)