From c1b4f35081ddf6748f31507c72d4b2664270411d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:02:14 +0000 Subject: [PATCH] chore: new owl bot post processor docker image (#441) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../google-cloud-oslogin/protos/protos.d.ts | 10 +-- .../google-cloud-oslogin/protos/protos.js | 20 +++--- .../src/v1/os_login_service_client.ts | 69 +++++++++---------- .../src/v1beta/os_login_service_client.ts | 69 +++++++++---------- .../test/gapic_os_login_service_v1.ts | 57 +++++++-------- .../test/gapic_os_login_service_v1beta.ts | 57 +++++++-------- 6 files changed, 125 insertions(+), 157 deletions(-) diff --git a/packages/google-cloud-oslogin/protos/protos.d.ts b/packages/google-cloud-oslogin/protos/protos.d.ts index d5f81fe64616..c891b0557a70 100644 --- a/packages/google-cloud-oslogin/protos/protos.d.ts +++ b/packages/google-cloud-oslogin/protos/protos.d.ts @@ -2533,19 +2533,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-oslogin/protos/protos.js b/packages/google-cloud-oslogin/protos/protos.js index 83e217c63bfc..f754d666413d 100644 --- a/packages/google-cloud-oslogin/protos/protos.js +++ b/packages/google-cloud-oslogin/protos/protos.js @@ -5766,43 +5766,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-oslogin/src/v1/os_login_service_client.ts b/packages/google-cloud-oslogin/src/v1/os_login_service_client.ts index e7f1862a9fd6..56e3b9c4524e 100644 --- a/packages/google-cloud-oslogin/src/v1/os_login_service_client.ts +++ b/packages/google-cloud-oslogin/src/v1/os_login_service_client.ts @@ -224,13 +224,14 @@ export class OsLoginServiceClient { ]; for (const methodName of osLoginServiceStubMethods) { const callPromise = this.osLoginServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -391,11 +392,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deletePosixAccount(request, options, callback); } @@ -485,11 +485,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteSshPublicKey(request, options, callback); } @@ -576,11 +575,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getLoginProfile(request, options, callback); } @@ -664,11 +662,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getSshPublicKey(request, options, callback); } @@ -762,11 +759,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importSshPublicKey(request, options, callback); } @@ -861,11 +857,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.updateSshPublicKey(request, options, callback); } diff --git a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts index c68af4d77e67..c263b9cf5047 100644 --- a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts +++ b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts @@ -224,13 +224,14 @@ export class OsLoginServiceClient { ]; for (const methodName of osLoginServiceStubMethods) { const callPromise = this.osLoginServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -393,11 +394,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deletePosixAccount(request, options, callback); } @@ -487,11 +487,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteSshPublicKey(request, options, callback); } @@ -584,11 +583,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getLoginProfile(request, options, callback); } @@ -678,11 +676,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getSshPublicKey(request, options, callback); } @@ -776,11 +773,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importSshPublicKey(request, options, callback); } @@ -875,11 +871,10 @@ export class OsLoginServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.updateSshPublicKey(request, options, callback); } diff --git a/packages/google-cloud-oslogin/test/gapic_os_login_service_v1.ts b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1.ts index 12067cc81f13..b275c0ce8af2 100644 --- a/packages/google-cloud-oslogin/test/gapic_os_login_service_v1.ts +++ b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1.ts @@ -26,10 +26,9 @@ import * as osloginserviceModule from '../src'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -155,9 +154,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deletePosixAccount = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCall(expectedResponse); const [response] = await client.deletePosixAccount(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -188,9 +186,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deletePosixAccount = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deletePosixAccount( request, @@ -269,9 +266,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteSshPublicKey = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCall(expectedResponse); const [response] = await client.deleteSshPublicKey(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -302,9 +298,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteSshPublicKey( request, @@ -414,9 +409,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.v1.LoginProfile() ); - client.innerApiCalls.getLoginProfile = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getLoginProfile = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getLoginProfile( request, @@ -526,9 +520,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.common.SshPublicKey() ); - client.innerApiCalls.getSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getSshPublicKey( request, @@ -607,9 +600,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.v1.ImportSshPublicKeyResponse() ); - client.innerApiCalls.importSshPublicKey = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCall(expectedResponse); const [response] = await client.importSshPublicKey(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -640,9 +632,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.v1.ImportSshPublicKeyResponse() ); - client.innerApiCalls.importSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importSshPublicKey( request, @@ -721,9 +712,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.common.SshPublicKey() ); - client.innerApiCalls.updateSshPublicKey = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCall(expectedResponse); const [response] = await client.updateSshPublicKey(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -754,9 +744,8 @@ describe('v1.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.common.SshPublicKey() ); - client.innerApiCalls.updateSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSshPublicKey( request, diff --git a/packages/google-cloud-oslogin/test/gapic_os_login_service_v1beta.ts b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1beta.ts index 965498fce1a9..5674d1ece035 100644 --- a/packages/google-cloud-oslogin/test/gapic_os_login_service_v1beta.ts +++ b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1beta.ts @@ -26,10 +26,9 @@ import * as osloginserviceModule from '../src'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -155,9 +154,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deletePosixAccount = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCall(expectedResponse); const [response] = await client.deletePosixAccount(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -188,9 +186,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deletePosixAccount = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deletePosixAccount( request, @@ -269,9 +266,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteSshPublicKey = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCall(expectedResponse); const [response] = await client.deleteSshPublicKey(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -302,9 +298,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteSshPublicKey( request, @@ -414,9 +409,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.v1beta.LoginProfile() ); - client.innerApiCalls.getLoginProfile = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getLoginProfile = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getLoginProfile( request, @@ -526,9 +520,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.common.SshPublicKey() ); - client.innerApiCalls.getSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getSshPublicKey( request, @@ -607,9 +600,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse() ); - client.innerApiCalls.importSshPublicKey = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCall(expectedResponse); const [response] = await client.importSshPublicKey(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -640,9 +632,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse() ); - client.innerApiCalls.importSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importSshPublicKey( request, @@ -721,9 +712,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.common.SshPublicKey() ); - client.innerApiCalls.updateSshPublicKey = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCall(expectedResponse); const [response] = await client.updateSshPublicKey(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -754,9 +744,8 @@ describe('v1beta.OsLoginServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.oslogin.common.SshPublicKey() ); - client.innerApiCalls.updateSshPublicKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSshPublicKey( request,