diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index ae69490574f..4f77acdd234 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -4234,13 +4234,13 @@ export namespace google { public name: string; /** Metric intValue. */ - public intValue: (number|Long|string); + public intValue?: (number|Long|string|null); /** Metric doubleValue. */ - public doubleValue: number; + public doubleValue?: (number|null); /** Metric stringValue. */ - public stringValue: string; + public stringValue?: (string|null); /** Metric value. */ public value?: ("intValue"|"doubleValue"|"stringValue"); @@ -12223,19 +12223,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-container/protos/protos.js b/packages/google-container/protos/protos.js index 95643c5bf62..53ef005e9ae 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -10685,27 +10685,27 @@ /** * Metric intValue. - * @member {number|Long} intValue + * @member {number|Long|null|undefined} intValue * @memberof google.container.v1.OperationProgress.Metric * @instance */ - Metric.prototype.intValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Metric.prototype.intValue = null; /** * Metric doubleValue. - * @member {number} doubleValue + * @member {number|null|undefined} doubleValue * @memberof google.container.v1.OperationProgress.Metric * @instance */ - Metric.prototype.doubleValue = 0; + Metric.prototype.doubleValue = null; /** * Metric stringValue. - * @member {string} stringValue + * @member {string|null|undefined} stringValue * @memberof google.container.v1.OperationProgress.Metric * @instance */ - Metric.prototype.stringValue = ""; + Metric.prototype.stringValue = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -30235,43 +30235,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-container/src/v1/cluster_manager_client.ts b/packages/google-container/src/v1/cluster_manager_client.ts index a6de3f74c0b..816fa7cb3e3 100644 --- a/packages/google-container/src/v1/cluster_manager_client.ts +++ b/packages/google-container/src/v1/cluster_manager_client.ts @@ -253,13 +253,14 @@ export class ClusterManagerClient { ]; for (const methodName of clusterManagerStubMethods) { const callPromise = this.clusterManagerStub.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; } @@ -419,12 +420,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.listClusters(request, options, callback); } @@ -517,12 +517,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.getCluster(request, options, callback); } @@ -628,12 +627,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.createCluster(request, options, callback); } @@ -728,12 +726,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.updateCluster(request, options, callback); } @@ -854,12 +851,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.updateNodePool(request, options, callback); } @@ -966,12 +962,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setNodePoolAutoscaling( request, @@ -1082,12 +1077,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setLoggingService(request, options, callback); } @@ -1200,12 +1194,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setMonitoringService(request, options, callback); } @@ -1301,12 +1294,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setAddonsConfig(request, options, callback); } @@ -1410,12 +1402,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setLocations(request, options, callback); } @@ -1519,12 +1510,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.updateMaster(request, options, callback); } @@ -1623,12 +1613,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setMasterAuth(request, options, callback); } @@ -1729,12 +1718,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.deleteCluster(request, options, callback); } @@ -1825,12 +1813,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.listOperations(request, options, callback); } @@ -1923,12 +1910,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.getOperation(request, options, callback); } @@ -2021,12 +2007,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.cancelOperation(request, options, callback); } @@ -2116,12 +2101,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.getServerConfig(request, options, callback); } @@ -2205,11 +2189,10 @@ export class ClusterManagerClient { 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.getJSONWebKeys(request, options, callback); } @@ -2302,12 +2285,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.listNodePools(request, options, callback); } @@ -2404,12 +2386,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.getNodePool(request, options, callback); } @@ -2505,12 +2486,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.createNodePool(request, options, callback); } @@ -2607,12 +2587,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.deleteNodePool(request, options, callback); } @@ -2718,12 +2697,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.rollbackNodePoolUpgrade( request, @@ -2834,12 +2812,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setNodePoolManagement(request, options, callback); } @@ -2941,12 +2918,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setLabels(request, options, callback); } @@ -3041,12 +3017,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setLegacyAbac(request, options, callback); } @@ -3141,12 +3116,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.startIPRotation(request, options, callback); } @@ -3241,12 +3215,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.completeIPRotation(request, options, callback); } @@ -3345,12 +3318,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setNodePoolSize(request, options, callback); } @@ -3447,12 +3419,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setNetworkPolicy(request, options, callback); } @@ -3554,12 +3525,11 @@ export class ClusterManagerClient { 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 || '', - project_id: request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.setMaintenancePolicy(request, options, callback); } @@ -3665,11 +3635,10 @@ export class ClusterManagerClient { 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.listUsableSubnetworks(request, options, callback); } @@ -3714,11 +3683,10 @@ export class ClusterManagerClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listUsableSubnetworks.createStream( @@ -3774,17 +3742,16 @@ export class ClusterManagerClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listUsableSubnetworks.asyncIterate( this.innerApiCalls['listUsableSubnetworks'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable<protos.google.container.v1.IUsableSubnetwork>; } diff --git a/packages/google-container/test/gapic_cluster_manager_v1.ts b/packages/google-container/test/gapic_cluster_manager_v1.ts index c9a7b74a817..f6c50c3214b 100644 --- a/packages/google-container/test/gapic_cluster_manager_v1.ts +++ b/packages/google-container/test/gapic_cluster_manager_v1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage<T extends object>(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message<T>, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message<T>, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -251,9 +250,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.ListClustersResponse() ); - client.innerApiCalls.listClusters = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listClusters( request, @@ -366,9 +364,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Cluster() ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getCluster( request, @@ -481,9 +478,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.createCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createCluster( request, @@ -596,9 +592,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.updateCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateCluster( request, @@ -711,9 +706,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.updateNodePool = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateNodePool = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateNodePool( request, @@ -794,9 +788,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.setNodePoolAutoscaling = + stubSimpleCall(expectedResponse); const [response] = await client.setNodePoolAutoscaling(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -828,9 +821,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setNodePoolAutoscaling = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setNodePoolAutoscaling = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setNodePoolAutoscaling( request, @@ -946,9 +938,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setLoggingService = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setLoggingService = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setLoggingService( request, @@ -1029,9 +1020,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setMonitoringService = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.setMonitoringService = + stubSimpleCall(expectedResponse); const [response] = await client.setMonitoringService(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1063,9 +1053,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setMonitoringService = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setMonitoringService = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setMonitoringService( request, @@ -1178,9 +1167,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setAddonsConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setAddonsConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setAddonsConfig( request, @@ -1293,9 +1281,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setLocations = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setLocations = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setLocations( request, @@ -1408,9 +1395,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.updateMaster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateMaster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateMaster( request, @@ -1523,9 +1509,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setMasterAuth = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setMasterAuth = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setMasterAuth( request, @@ -1638,9 +1623,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteCluster( request, @@ -1753,9 +1737,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.ListOperationsResponse() ); - client.innerApiCalls.listOperations = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listOperations = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listOperations( request, @@ -1868,9 +1851,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.getOperation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getOperation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getOperation( request, @@ -1983,9 +1965,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.cancelOperation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.cancelOperation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.cancelOperation( request, @@ -2098,9 +2079,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.ServerConfig() ); - client.innerApiCalls.getServerConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getServerConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getServerConfig( request, @@ -2211,9 +2191,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.GetJSONWebKeysResponse() ); - client.innerApiCalls.getJSONWebKeys = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getJSONWebKeys = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getJSONWebKeys( request, @@ -2325,9 +2304,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.ListNodePoolsResponse() ); - client.innerApiCalls.listNodePools = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listNodePools = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listNodePools( request, @@ -2440,9 +2418,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.NodePool() ); - client.innerApiCalls.getNodePool = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getNodePool = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getNodePool( request, @@ -2555,9 +2532,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.createNodePool = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createNodePool = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createNodePool( request, @@ -2670,9 +2646,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.deleteNodePool = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteNodePool = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteNodePool( request, @@ -2753,9 +2728,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.rollbackNodePoolUpgrade = + stubSimpleCall(expectedResponse); const [response] = await client.rollbackNodePoolUpgrade(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -2787,9 +2761,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.rollbackNodePoolUpgrade = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.rollbackNodePoolUpgrade = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.rollbackNodePoolUpgrade( request, @@ -2873,9 +2846,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.setNodePoolManagement = + stubSimpleCall(expectedResponse); const [response] = await client.setNodePoolManagement(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -2907,9 +2879,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setNodePoolManagement = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setNodePoolManagement = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setNodePoolManagement( request, @@ -3025,9 +2996,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setLabels = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setLabels( request, @@ -3137,9 +3107,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setLegacyAbac = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setLegacyAbac = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setLegacyAbac( request, @@ -3252,9 +3221,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.startIPRotation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.startIPRotation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.startIPRotation( request, @@ -3335,9 +3303,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.completeIPRotation = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.completeIPRotation = + stubSimpleCall(expectedResponse); const [response] = await client.completeIPRotation(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -3369,9 +3336,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.completeIPRotation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.completeIPRotation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.completeIPRotation( request, @@ -3484,9 +3450,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setNodePoolSize = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setNodePoolSize = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setNodePoolSize( request, @@ -3599,9 +3564,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setNetworkPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setNetworkPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setNetworkPolicy( request, @@ -3682,9 +3646,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.setMaintenancePolicy = + stubSimpleCall(expectedResponse); const [response] = await client.setMaintenancePolicy(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -3716,9 +3679,8 @@ describe('v1.ClusterManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.container.v1.Operation() ); - client.innerApiCalls.setMaintenancePolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setMaintenancePolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setMaintenancePolicy( request, @@ -3806,9 +3768,8 @@ describe('v1.ClusterManagerClient', () => { new protos.google.container.v1.UsableSubnetwork() ), ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listUsableSubnetworks = + stubSimpleCall(expectedResponse); const [response] = await client.listUsableSubnetworks(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -3847,9 +3808,8 @@ describe('v1.ClusterManagerClient', () => { new protos.google.container.v1.UsableSubnetwork() ), ]; - client.innerApiCalls.listUsableSubnetworks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listUsableSubnetworks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listUsableSubnetworks( request, @@ -3930,9 +3890,8 @@ describe('v1.ClusterManagerClient', () => { new protos.google.container.v1.UsableSubnetwork() ), ]; - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listUsableSubnetworks.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listUsableSubnetworksStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.container.v1.UsableSubnetwork[] = []; @@ -3952,16 +3911,18 @@ describe('v1.ClusterManagerClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listUsableSubnetworks - .createStream as SinonStub) + ( + client.descriptors.page.listUsableSubnetworks + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listUsableSubnetworks, request) ); assert.strictEqual( - (client.descriptors.page.listUsableSubnetworks - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUsableSubnetworks + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3978,10 +3939,8 @@ describe('v1.ClusterManagerClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listUsableSubnetworks.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listUsableSubnetworksStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.container.v1.UsableSubnetwork[] = []; @@ -4000,16 +3959,18 @@ describe('v1.ClusterManagerClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listUsableSubnetworks - .createStream as SinonStub) + ( + client.descriptors.page.listUsableSubnetworks + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listUsableSubnetworks, request) ); assert.strictEqual( - (client.descriptors.page.listUsableSubnetworks - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUsableSubnetworks + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -4036,9 +3997,8 @@ describe('v1.ClusterManagerClient', () => { new protos.google.container.v1.UsableSubnetwork() ), ]; - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listUsableSubnetworks.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.container.v1.IUsableSubnetwork[] = []; const iterable = client.listUsableSubnetworksAsync(request); for await (const resource of iterable) { @@ -4046,15 +4006,17 @@ describe('v1.ClusterManagerClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listUsableSubnetworks + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listUsableSubnetworks - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUsableSubnetworks + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -4071,10 +4033,8 @@ describe('v1.ClusterManagerClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listUsableSubnetworks.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listUsableSubnetworks.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listUsableSubnetworksAsync(request); await assert.rejects(async () => { const responses: protos.google.container.v1.IUsableSubnetwork[] = []; @@ -4083,15 +4043,17 @@ describe('v1.ClusterManagerClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listUsableSubnetworks - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listUsableSubnetworks + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listUsableSubnetworks - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUsableSubnetworks + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); });