Skip to content

Commit 737909e

Browse files
feat: update typescript generator (#3303)
* feat: run owlbot locally * 🦉 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>
1 parent b0141c9 commit 737909e

9 files changed

Lines changed: 123 additions & 103 deletions

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
function main(parent, appConnection) {
2424
// [START beyondcorp_v1_generated_AppConnectionsService_CreateAppConnection_async]
2525
/**
26+
* This snippet has been automatically generated and should be regarded as a code template only.
27+
* It will require modifications to work.
28+
* It may require correct/in-range values for request initialization.
2629
* TODO(developer): Uncomment these variables before running the sample.
2730
*/
2831
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
function main(name) {
2424
// [START beyondcorp_v1_generated_AppConnectionsService_DeleteAppConnection_async]
2525
/**
26+
* This snippet has been automatically generated and should be regarded as a code template only.
27+
* It will require modifications to work.
28+
* It may require correct/in-range values for request initialization.
2629
* TODO(developer): Uncomment these variables before running the sample.
2730
*/
2831
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
function main(name) {
2424
// [START beyondcorp_v1_generated_AppConnectionsService_GetAppConnection_async]
2525
/**
26+
* This snippet has been automatically generated and should be regarded as a code template only.
27+
* It will require modifications to work.
28+
* It may require correct/in-range values for request initialization.
2629
* TODO(developer): Uncomment these variables before running the sample.
2730
*/
2831
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
function main(parent) {
2424
// [START beyondcorp_v1_generated_AppConnectionsService_ListAppConnections_async]
2525
/**
26+
* This snippet has been automatically generated and should be regarded as a code template only.
27+
* It will require modifications to work.
28+
* It may require correct/in-range values for request initialization.
2629
* TODO(developer): Uncomment these variables before running the sample.
2730
*/
2831
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
function main(parent, appConnectorId) {
2424
// [START beyondcorp_v1_generated_AppConnectionsService_ResolveAppConnections_async]
2525
/**
26+
* This snippet has been automatically generated and should be regarded as a code template only.
27+
* It will require modifications to work.
28+
* It may require correct/in-range values for request initialization.
2629
* TODO(developer): Uncomment these variables before running the sample.
2730
*/
2831
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
function main(updateMask, appConnection) {
2424
// [START beyondcorp_v1_generated_AppConnectionsService_UpdateAppConnection_async]
2525
/**
26+
* This snippet has been automatically generated and should be regarded as a code template only.
27+
* It will require modifications to work.
28+
* It may require correct/in-range values for request initialization.
2629
* TODO(developer): Uncomment these variables before running the sample.
2730
*/
2831
/**

packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnections.v1.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"segments": [
2323
{
2424
"start": 25,
25-
"end": 78,
25+
"end": 81,
2626
"type": "FULL"
2727
}
2828
],
@@ -78,7 +78,7 @@
7878
"segments": [
7979
{
8080
"start": 25,
81-
"end": 51,
81+
"end": 54,
8282
"type": "FULL"
8383
}
8484
],
@@ -118,7 +118,7 @@
118118
"segments": [
119119
{
120120
"start": 25,
121-
"end": 83,
121+
"end": 86,
122122
"type": "FULL"
123123
}
124124
],
@@ -174,7 +174,7 @@
174174
"segments": [
175175
{
176176
"start": 25,
177-
"end": 86,
177+
"end": 89,
178178
"type": "FULL"
179179
}
180180
],
@@ -230,7 +230,7 @@
230230
"segments": [
231231
{
232232
"start": 25,
233-
"end": 71,
233+
"end": 74,
234234
"type": "FULL"
235235
}
236236
],
@@ -278,7 +278,7 @@
278278
"segments": [
279279
{
280280
"start": 25,
281-
"end": 74,
281+
"end": 77,
282282
"type": "FULL"
283283
}
284284
],

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {
3434
} from 'google-gax';
3535

3636
import {Transform} from 'stream';
37-
import {RequestType} from 'google-gax/build/src/apitypes';
3837
import * as protos from '../../protos/protos';
3938
import jsonProtos = require('../../protos/protos.json');
4039
/**
@@ -441,7 +440,8 @@ export class AppConnectionsServiceClient {
441440
const apiCall = this._gaxModule.createApiCall(
442441
callPromise,
443442
this._defaults[methodName],
444-
descriptor
443+
descriptor,
444+
this._opts.fallback
445445
);
446446

447447
this.innerApiCalls[methodName] = apiCall;
@@ -757,7 +757,7 @@ export class AppConnectionsServiceClient {
757757
const decodeOperation = new gax.Operation(
758758
operation,
759759
this.descriptors.longrunning.createAppConnection,
760-
gax.createDefaultBackoffSettings()
760+
this._gaxModule.createDefaultBackoffSettings()
761761
);
762762
return decodeOperation as LROperation<
763763
protos.google.cloud.beyondcorp.appconnections.v1.AppConnection,
@@ -922,7 +922,7 @@ export class AppConnectionsServiceClient {
922922
const decodeOperation = new gax.Operation(
923923
operation,
924924
this.descriptors.longrunning.updateAppConnection,
925-
gax.createDefaultBackoffSettings()
925+
this._gaxModule.createDefaultBackoffSettings()
926926
);
927927
return decodeOperation as LROperation<
928928
protos.google.cloud.beyondcorp.appconnections.v1.AppConnection,
@@ -1077,7 +1077,7 @@ export class AppConnectionsServiceClient {
10771077
const decodeOperation = new gax.Operation(
10781078
operation,
10791079
this.descriptors.longrunning.deleteAppConnection,
1080-
gax.createDefaultBackoffSettings()
1080+
this._gaxModule.createDefaultBackoffSettings()
10811081
);
10821082
return decodeOperation as LROperation<
10831083
protos.google.protobuf.Empty,
@@ -1249,7 +1249,7 @@ export class AppConnectionsServiceClient {
12491249
const callSettings = defaultCallSettings.merge(options);
12501250
this.initialize();
12511251
return this.descriptors.page.listAppConnections.createStream(
1252-
this.innerApiCalls.listAppConnections as gax.GaxCall,
1252+
this.innerApiCalls.listAppConnections as GaxCall,
12531253
request,
12541254
callSettings
12551255
);
@@ -1311,7 +1311,7 @@ export class AppConnectionsServiceClient {
13111311
this.initialize();
13121312
return this.descriptors.page.listAppConnections.asyncIterate(
13131313
this.innerApiCalls['listAppConnections'] as GaxCall,
1314-
request as unknown as RequestType,
1314+
request as {},
13151315
callSettings
13161316
) as AsyncIterable<protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection>;
13171317
}
@@ -1476,7 +1476,7 @@ export class AppConnectionsServiceClient {
14761476
const callSettings = defaultCallSettings.merge(options);
14771477
this.initialize();
14781478
return this.descriptors.page.resolveAppConnections.createStream(
1479-
this.innerApiCalls.resolveAppConnections as gax.GaxCall,
1479+
this.innerApiCalls.resolveAppConnections as GaxCall,
14801480
request,
14811481
callSettings
14821482
);
@@ -1535,7 +1535,7 @@ export class AppConnectionsServiceClient {
15351535
this.initialize();
15361536
return this.descriptors.page.resolveAppConnections.asyncIterate(
15371537
this.innerApiCalls['resolveAppConnections'] as GaxCall,
1538-
request as unknown as RequestType,
1538+
request as {},
15391539
callSettings
15401540
) as AsyncIterable<protos.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.IAppConnectionDetails>;
15411541
}

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

Lines changed: 90 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -151,109 +151,111 @@ function stubAsyncIterationCall<ResponseType>(
151151
}
152152

153153
describe('v1.AppConnectionsServiceClient', () => {
154-
it('has servicePath', () => {
155-
const servicePath =
156-
appconnectionsserviceModule.v1.AppConnectionsServiceClient.servicePath;
157-
assert(servicePath);
158-
});
154+
describe('Common methods', () => {
155+
it('has servicePath', () => {
156+
const servicePath =
157+
appconnectionsserviceModule.v1.AppConnectionsServiceClient.servicePath;
158+
assert(servicePath);
159+
});
159160

160-
it('has apiEndpoint', () => {
161-
const apiEndpoint =
162-
appconnectionsserviceModule.v1.AppConnectionsServiceClient.apiEndpoint;
163-
assert(apiEndpoint);
164-
});
161+
it('has apiEndpoint', () => {
162+
const apiEndpoint =
163+
appconnectionsserviceModule.v1.AppConnectionsServiceClient.apiEndpoint;
164+
assert(apiEndpoint);
165+
});
165166

166-
it('has port', () => {
167-
const port =
168-
appconnectionsserviceModule.v1.AppConnectionsServiceClient.port;
169-
assert(port);
170-
assert(typeof port === 'number');
171-
});
167+
it('has port', () => {
168+
const port =
169+
appconnectionsserviceModule.v1.AppConnectionsServiceClient.port;
170+
assert(port);
171+
assert(typeof port === 'number');
172+
});
172173

173-
it('should create a client with no option', () => {
174-
const client =
175-
new appconnectionsserviceModule.v1.AppConnectionsServiceClient();
176-
assert(client);
177-
});
174+
it('should create a client with no option', () => {
175+
const client =
176+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient();
177+
assert(client);
178+
});
178179

179-
it('should create a client with gRPC fallback', () => {
180-
const client =
181-
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
182-
fallback: true,
183-
});
184-
assert(client);
185-
});
180+
it('should create a client with gRPC fallback', () => {
181+
const client =
182+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
183+
fallback: true,
184+
});
185+
assert(client);
186+
});
186187

187-
it('has initialize method and supports deferred initialization', async () => {
188-
const client =
189-
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
190-
credentials: {client_email: 'bogus', private_key: 'bogus'},
191-
projectId: 'bogus',
192-
});
193-
assert.strictEqual(client.appConnectionsServiceStub, undefined);
194-
await client.initialize();
195-
assert(client.appConnectionsServiceStub);
196-
});
188+
it('has initialize method and supports deferred initialization', async () => {
189+
const client =
190+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
191+
credentials: {client_email: 'bogus', private_key: 'bogus'},
192+
projectId: 'bogus',
193+
});
194+
assert.strictEqual(client.appConnectionsServiceStub, undefined);
195+
await client.initialize();
196+
assert(client.appConnectionsServiceStub);
197+
});
197198

198-
it('has close method for the initialized client', done => {
199-
const client =
200-
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
201-
credentials: {client_email: 'bogus', private_key: 'bogus'},
202-
projectId: 'bogus',
199+
it('has close method for the initialized client', done => {
200+
const client =
201+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
202+
credentials: {client_email: 'bogus', private_key: 'bogus'},
203+
projectId: 'bogus',
204+
});
205+
client.initialize();
206+
assert(client.appConnectionsServiceStub);
207+
client.close().then(() => {
208+
done();
203209
});
204-
client.initialize();
205-
assert(client.appConnectionsServiceStub);
206-
client.close().then(() => {
207-
done();
208210
});
209-
});
210211

211-
it('has close method for the non-initialized client', done => {
212-
const client =
213-
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
214-
credentials: {client_email: 'bogus', private_key: 'bogus'},
215-
projectId: 'bogus',
212+
it('has close method for the non-initialized client', done => {
213+
const client =
214+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
215+
credentials: {client_email: 'bogus', private_key: 'bogus'},
216+
projectId: 'bogus',
217+
});
218+
assert.strictEqual(client.appConnectionsServiceStub, undefined);
219+
client.close().then(() => {
220+
done();
216221
});
217-
assert.strictEqual(client.appConnectionsServiceStub, undefined);
218-
client.close().then(() => {
219-
done();
220222
});
221-
});
222223

223-
it('has getProjectId method', async () => {
224-
const fakeProjectId = 'fake-project-id';
225-
const client =
226-
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
227-
credentials: {client_email: 'bogus', private_key: 'bogus'},
228-
projectId: 'bogus',
229-
});
230-
client.auth.getProjectId = sinon.stub().resolves(fakeProjectId);
231-
const result = await client.getProjectId();
232-
assert.strictEqual(result, fakeProjectId);
233-
assert((client.auth.getProjectId as SinonStub).calledWithExactly());
234-
});
224+
it('has getProjectId method', async () => {
225+
const fakeProjectId = 'fake-project-id';
226+
const client =
227+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
228+
credentials: {client_email: 'bogus', private_key: 'bogus'},
229+
projectId: 'bogus',
230+
});
231+
client.auth.getProjectId = sinon.stub().resolves(fakeProjectId);
232+
const result = await client.getProjectId();
233+
assert.strictEqual(result, fakeProjectId);
234+
assert((client.auth.getProjectId as SinonStub).calledWithExactly());
235+
});
235236

236-
it('has getProjectId method with callback', async () => {
237-
const fakeProjectId = 'fake-project-id';
238-
const client =
239-
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
240-
credentials: {client_email: 'bogus', private_key: 'bogus'},
241-
projectId: 'bogus',
242-
});
243-
client.auth.getProjectId = sinon
244-
.stub()
245-
.callsArgWith(0, null, fakeProjectId);
246-
const promise = new Promise((resolve, reject) => {
247-
client.getProjectId((err?: Error | null, projectId?: string | null) => {
248-
if (err) {
249-
reject(err);
250-
} else {
251-
resolve(projectId);
252-
}
237+
it('has getProjectId method with callback', async () => {
238+
const fakeProjectId = 'fake-project-id';
239+
const client =
240+
new appconnectionsserviceModule.v1.AppConnectionsServiceClient({
241+
credentials: {client_email: 'bogus', private_key: 'bogus'},
242+
projectId: 'bogus',
243+
});
244+
client.auth.getProjectId = sinon
245+
.stub()
246+
.callsArgWith(0, null, fakeProjectId);
247+
const promise = new Promise((resolve, reject) => {
248+
client.getProjectId((err?: Error | null, projectId?: string | null) => {
249+
if (err) {
250+
reject(err);
251+
} else {
252+
resolve(projectId);
253+
}
254+
});
253255
});
256+
const result = await promise;
257+
assert.strictEqual(result, fakeProjectId);
254258
});
255-
const result = await promise;
256-
assert.strictEqual(result, fakeProjectId);
257259
});
258260

259261
describe('getAppConnection', () => {

0 commit comments

Comments
 (0)