Skip to content

Commit 895830a

Browse files
feat: support for Trusted Private Cloud
* feat: support for Trusted Private Cloud * 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwY29ubmVjdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6IjA3YjdmM2RhZDhhYTE5MTJkNGFjZGNmZDYzNjViYjQyMzZlNGI1NGIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwY29ubmVjdG9ycy8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwZ2F0ZXdheXMvLk93bEJvdC55YW1sIiwiaCI6IjA3YjdmM2RhZDhhYTE5MTJkNGFjZGNmZDYzNjViYjQyMzZlNGI1NGIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtY2xpZW50Y29ubmVjdG9yc2VydmljZXMvLk93bEJvdC55YW1sIiwiaCI6IjA3YjdmM2RhZDhhYTE5MTJkNGFjZGNmZDYzNjViYjQyMzZlNGI1NGIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtY2xpZW50Z2F0ZXdheXMvLk93bEJvdC55YW1sIiwiaCI6IjA3YjdmM2RhZDhhYTE5MTJkNGFjZGNmZDYzNjViYjQyMzZlNGI1NGIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWFuYWx5dGljc2h1Yi8uT3dsQm90LnlhbWw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n0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbmZpZGVudGlhbGNvbXB1dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: fix generated test for Cloud Channel v1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: fix formatting --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Alexander Fenster <[email protected]>
1 parent 43acd89 commit 895830a

135 files changed

Lines changed: 3638 additions & 535 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-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.list_app_connections.js

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

7474
// Run request
75-
const iterable = await appconnectionsClient.listAppConnectionsAsync(request);
75+
const iterable = appconnectionsClient.listAppConnectionsAsync(request);
7676
for await (const response of iterable) {
7777
console.log(response);
7878
}

packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.resolve_app_connections.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function main(parent, appConnectorId) {
6868
};
6969

7070
// Run request
71-
const iterable = await appconnectionsClient.resolveAppConnectionsAsync(request);
71+
const iterable = appconnectionsClient.resolveAppConnectionsAsync(request);
7272
for await (const response of iterable) {
7373
console.log(response);
7474
}

packages/google-cloud-beyondcorp-appconnections/src/v1/app_connections_service_client.ts

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import type {
3535
import {Transform} from 'stream';
3636
import * as protos from '../../protos/protos';
3737
import jsonProtos = require('../../protos/protos.json');
38+
3839
/**
3940
* Client JSON configuration object, loaded from
4041
* `src/v1/app_connections_service_client_config.json`.
@@ -69,6 +70,8 @@ export class AppConnectionsServiceClient {
6970
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
7071
private _protos: {};
7172
private _defaults: {[method: string]: gax.CallSettings};
73+
private _universeDomain: string;
74+
private _servicePath: string;
7275
auth: gax.GoogleAuth;
7376
descriptors: Descriptors = {
7477
page: {},
@@ -130,8 +133,20 @@ export class AppConnectionsServiceClient {
130133
// Ensure that options include all the required fields.
131134
const staticMembers = this
132135
.constructor as typeof AppConnectionsServiceClient;
136+
if (
137+
opts?.universe_domain &&
138+
opts?.universeDomain &&
139+
opts?.universe_domain !== opts?.universeDomain
140+
) {
141+
throw new Error(
142+
'Please set either universe_domain or universeDomain, but not both.'
143+
);
144+
}
145+
this._universeDomain =
146+
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
147+
this._servicePath = 'beyondcorp.' + this._universeDomain;
133148
const servicePath =
134-
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
149+
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
135150
this._providedCustomServicePath = !!(
136151
opts?.servicePath || opts?.apiEndpoint
137152
);
@@ -146,7 +161,7 @@ export class AppConnectionsServiceClient {
146161
opts.numericEnums = true;
147162

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

@@ -171,10 +186,10 @@ export class AppConnectionsServiceClient {
171186
this.auth.useJWTAccessWithScope = true;
172187

173188
// Set defaultServicePath on the auth object.
174-
this.auth.defaultServicePath = staticMembers.servicePath;
189+
this.auth.defaultServicePath = this._servicePath;
175190

176191
// Set the default scopes in auth client if needed.
177-
if (servicePath === staticMembers.servicePath) {
192+
if (servicePath === this._servicePath) {
178193
this.auth.defaultScopes = staticMembers.scopes;
179194
}
180195
this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);
@@ -470,21 +485,52 @@ export class AppConnectionsServiceClient {
470485

471486
/**
472487
* The DNS address for this API service.
488+
* @deprecated Use the apiEndpoint method of the client instance.
473489
* @returns {string} The DNS address for this service.
474490
*/
475491
static get servicePath() {
492+
if (
493+
typeof process !== undefined &&
494+
typeof process.emitWarning === 'function'
495+
) {
496+
process.emitWarning(
497+
'Static servicePath is deprecated, please use the instance method instead.',
498+
'DeprecationWarning'
499+
);
500+
}
476501
return 'beyondcorp.googleapis.com';
477502
}
478503

479504
/**
480-
* The DNS address for this API service - same as servicePath(),
481-
* exists for compatibility reasons.
505+
* The DNS address for this API service - same as servicePath.
506+
* @deprecated Use the apiEndpoint method of the client instance.
482507
* @returns {string} The DNS address for this service.
483508
*/
484509
static get apiEndpoint() {
510+
if (
511+
typeof process !== undefined &&
512+
typeof process.emitWarning === 'function'
513+
) {
514+
process.emitWarning(
515+
'Static apiEndpoint is deprecated, please use the instance method instead.',
516+
'DeprecationWarning'
517+
);
518+
}
485519
return 'beyondcorp.googleapis.com';
486520
}
487521

522+
/**
523+
* The DNS address for this API service.
524+
* @returns {string} The DNS address for this service.
525+
*/
526+
get apiEndpoint() {
527+
return this._servicePath;
528+
}
529+
530+
get universeDomain() {
531+
return this._universeDomain;
532+
}
533+
488534
/**
489535
* The port for this API service.
490536
* @returns {number} The default port for this service.

packages/google-cloud-beyondcorp-appconnections/test/gapic_app_connections_service_v1.ts

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,68 @@ function stubAsyncIterationCall<ResponseType>(
167167

168168
describe('v1.AppConnectionsServiceClient', () => {
169169
describe('Common methods', () => {
170-
it('has servicePath', () => {
171-
const servicePath =
172-
appconnectionsserviceModule.v1.AppConnectionsServiceClient.servicePath;
173-
assert(servicePath);
170+
it('has apiEndpoint', () => {
171+
const client =
172+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient();
173+
const apiEndpoint = client.apiEndpoint;
174+
assert.strictEqual(apiEndpoint, 'beyondcorp.googleapis.com');
174175
});
175176

176-
it('has apiEndpoint', () => {
177-
const apiEndpoint =
178-
appconnectionsserviceModule.v1.AppConnectionsServiceClient.apiEndpoint;
179-
assert(apiEndpoint);
177+
it('has universeDomain', () => {
178+
const client =
179+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient();
180+
const universeDomain = client.universeDomain;
181+
assert.strictEqual(universeDomain, 'googleapis.com');
182+
});
183+
184+
if (
185+
typeof process !== 'undefined' &&
186+
typeof process.emitWarning === 'function'
187+
) {
188+
it('throws DeprecationWarning if static servicePath is used', () => {
189+
const stub = sinon.stub(process, 'emitWarning');
190+
const servicePath =
191+
appconnectionsserviceModule.v1.AppConnectionsServiceClient
192+
.servicePath;
193+
assert.strictEqual(servicePath, 'beyondcorp.googleapis.com');
194+
assert(stub.called);
195+
stub.restore();
196+
});
197+
198+
it('throws DeprecationWarning if static apiEndpoint is used', () => {
199+
const stub = sinon.stub(process, 'emitWarning');
200+
const apiEndpoint =
201+
appconnectionsserviceModule.v1.AppConnectionsServiceClient
202+
.apiEndpoint;
203+
assert.strictEqual(apiEndpoint, 'beyondcorp.googleapis.com');
204+
assert(stub.called);
205+
stub.restore();
206+
});
207+
}
208+
it('sets apiEndpoint according to universe domain camelCase', () => {
209+
const client =
210+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
211+
universeDomain: 'example.com',
212+
});
213+
const servicePath = client.apiEndpoint;
214+
assert.strictEqual(servicePath, 'beyondcorp.example.com');
215+
});
216+
217+
it('sets apiEndpoint according to universe domain snakeCase', () => {
218+
const client =
219+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
220+
universe_domain: 'example.com',
221+
});
222+
const servicePath = client.apiEndpoint;
223+
assert.strictEqual(servicePath, 'beyondcorp.example.com');
224+
});
225+
it('does not allow setting both universeDomain and universe_domain', () => {
226+
assert.throws(() => {
227+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
228+
universe_domain: 'example.com',
229+
universeDomain: 'example.net',
230+
});
231+
});
180232
});
181233

182234
it('has port', () => {

packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.list_app_connectors.js

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

7474
// Run request
75-
const iterable = await appconnectorsClient.listAppConnectorsAsync(request);
75+
const iterable = appconnectorsClient.listAppConnectorsAsync(request);
7676
for await (const response of iterable) {
7777
console.log(response);
7878
}

packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import type {
3535
import {Transform} from 'stream';
3636
import * as protos from '../../protos/protos';
3737
import jsonProtos = require('../../protos/protos.json');
38+
3839
/**
3940
* Client JSON configuration object, loaded from
4041
* `src/v1/app_connectors_service_client_config.json`.
@@ -69,6 +70,8 @@ export class AppConnectorsServiceClient {
6970
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
7071
private _protos: {};
7172
private _defaults: {[method: string]: gax.CallSettings};
73+
private _universeDomain: string;
74+
private _servicePath: string;
7275
auth: gax.GoogleAuth;
7376
descriptors: Descriptors = {
7477
page: {},
@@ -129,8 +132,20 @@ export class AppConnectorsServiceClient {
129132
) {
130133
// Ensure that options include all the required fields.
131134
const staticMembers = this.constructor as typeof AppConnectorsServiceClient;
135+
if (
136+
opts?.universe_domain &&
137+
opts?.universeDomain &&
138+
opts?.universe_domain !== opts?.universeDomain
139+
) {
140+
throw new Error(
141+
'Please set either universe_domain or universeDomain, but not both.'
142+
);
143+
}
144+
this._universeDomain =
145+
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
146+
this._servicePath = 'beyondcorp.' + this._universeDomain;
132147
const servicePath =
133-
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
148+
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
134149
this._providedCustomServicePath = !!(
135150
opts?.servicePath || opts?.apiEndpoint
136151
);
@@ -145,7 +160,7 @@ export class AppConnectorsServiceClient {
145160
opts.numericEnums = true;
146161

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

@@ -170,10 +185,10 @@ export class AppConnectorsServiceClient {
170185
this.auth.useJWTAccessWithScope = true;
171186

172187
// Set defaultServicePath on the auth object.
173-
this.auth.defaultServicePath = staticMembers.servicePath;
188+
this.auth.defaultServicePath = this._servicePath;
174189

175190
// Set the default scopes in auth client if needed.
176-
if (servicePath === staticMembers.servicePath) {
191+
if (servicePath === this._servicePath) {
177192
this.auth.defaultScopes = staticMembers.scopes;
178193
}
179194
this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);
@@ -472,21 +487,52 @@ export class AppConnectorsServiceClient {
472487

473488
/**
474489
* The DNS address for this API service.
490+
* @deprecated Use the apiEndpoint method of the client instance.
475491
* @returns {string} The DNS address for this service.
476492
*/
477493
static get servicePath() {
494+
if (
495+
typeof process !== undefined &&
496+
typeof process.emitWarning === 'function'
497+
) {
498+
process.emitWarning(
499+
'Static servicePath is deprecated, please use the instance method instead.',
500+
'DeprecationWarning'
501+
);
502+
}
478503
return 'beyondcorp.googleapis.com';
479504
}
480505

481506
/**
482-
* The DNS address for this API service - same as servicePath(),
483-
* exists for compatibility reasons.
507+
* The DNS address for this API service - same as servicePath.
508+
* @deprecated Use the apiEndpoint method of the client instance.
484509
* @returns {string} The DNS address for this service.
485510
*/
486511
static get apiEndpoint() {
512+
if (
513+
typeof process !== undefined &&
514+
typeof process.emitWarning === 'function'
515+
) {
516+
process.emitWarning(
517+
'Static apiEndpoint is deprecated, please use the instance method instead.',
518+
'DeprecationWarning'
519+
);
520+
}
487521
return 'beyondcorp.googleapis.com';
488522
}
489523

524+
/**
525+
* The DNS address for this API service.
526+
* @returns {string} The DNS address for this service.
527+
*/
528+
get apiEndpoint() {
529+
return this._servicePath;
530+
}
531+
532+
get universeDomain() {
533+
return this._universeDomain;
534+
}
535+
490536
/**
491537
* The port for this API service.
492538
* @returns {number} The default port for this service.

0 commit comments

Comments
 (0)