From 5431bf07d8435a2afd9bbf07cae0b5654482a78f 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:00:38 +0000 Subject: [PATCH] chore: new owl bot post processor docker image (#536) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../protos/protos.d.ts | 46 +- .../google-cloud-monitoring/protos/protos.js | 92 +- .../src/v3/alert_policy_service_client.ts | 129 +- .../src/v3/group_service_client.ts | 158 +- .../src/v3/metric_service_client.ts | 224 +- .../v3/notification_channel_service_client.ts | 194 +- .../src/v3/query_service_client.ts | 93 +- .../v3/service_monitoring_service_client.ts | 195 +- .../src/v3/uptime_check_service_client.ts | 131 +- .../system-test/fixtures/sample/src/index.js | 6 +- .../system-test/fixtures/sample/src/index.ts | 3 +- .../test/gapic_alert_policy_service_v3.ts | 829 +++---- .../test/gapic_group_service_v3.ts | 844 ++++---- .../test/gapic_metric_service_v3.ts | 1281 ++++++----- .../gapic_notification_channel_service_v3.ts | 1920 +++++++++-------- .../test/gapic_query_service_v3.ts | 809 ++++--- .../gapic_service_monitoring_service_v3.ts | 1442 +++++++------ .../test/gapic_uptime_check_service_v3.ts | 914 ++++---- 18 files changed, 5049 insertions(+), 4261 deletions(-) diff --git a/packages/google-cloud-monitoring/protos/protos.d.ts b/packages/google-cloud-monitoring/protos/protos.d.ts index bd2143c7282..8dd3d65095b 100644 --- a/packages/google-cloud-monitoring/protos/protos.d.ts +++ b/packages/google-cloud-monitoring/protos/protos.d.ts @@ -410,10 +410,10 @@ export namespace google { constructor(properties?: google.monitoring.v3.AlertPolicy.Condition.ITrigger); /** Trigger count. */ - public count: number; + public count?: (number|null); /** Trigger percent. */ - public percent: number; + public percent?: (number|null); /** Trigger type. */ public type?: ("count"|"percent"); @@ -870,16 +870,16 @@ export namespace google { constructor(properties?: google.monitoring.v3.ITypedValue); /** TypedValue boolValue. */ - public boolValue: boolean; + public boolValue?: (boolean|null); /** TypedValue int64Value. */ - public int64Value: (number|Long|string); + public int64Value?: (number|Long|string|null); /** TypedValue doubleValue. */ - public doubleValue: number; + public doubleValue?: (number|null); /** TypedValue stringValue. */ - public stringValue: string; + public stringValue?: (string|null); /** TypedValue distributionValue. */ public distributionValue?: (google.api.IDistribution|null); @@ -2426,13 +2426,13 @@ export namespace google { public name: string; /** ListGroupsRequest childrenOfGroup. */ - public childrenOfGroup: string; + public childrenOfGroup?: (string|null); /** ListGroupsRequest ancestorsOfGroup. */ - public ancestorsOfGroup: string; + public ancestorsOfGroup?: (string|null); /** ListGroupsRequest descendantsOfGroup. */ - public descendantsOfGroup: string; + public descendantsOfGroup?: (string|null); /** ListGroupsRequest pageSize. */ public pageSize: number; @@ -3857,13 +3857,13 @@ export namespace google { constructor(properties?: google.monitoring.v3.ILabelValue); /** LabelValue boolValue. */ - public boolValue: boolean; + public boolValue?: (boolean|null); /** LabelValue int64Value. */ - public int64Value: (number|Long|string); + public int64Value?: (number|Long|string|null); /** LabelValue stringValue. */ - public stringValue: string; + public stringValue?: (string|null); /** LabelValue value. */ public value?: ("boolValue"|"int64Value"|"stringValue"); @@ -8850,7 +8850,7 @@ export namespace google { public rollingPeriod?: (google.protobuf.IDuration|null); /** ServiceLevelObjective calendarPeriod. */ - public calendarPeriod: (google.type.CalendarPeriod|keyof typeof google.type.CalendarPeriod); + public calendarPeriod?: (google.type.CalendarPeriod|keyof typeof google.type.CalendarPeriod|null); /** ServiceLevelObjective period. */ public period?: ("rollingPeriod"|"calendarPeriod"); @@ -9757,7 +9757,7 @@ export namespace google { constructor(properties?: google.monitoring.v3.IWindowsBasedSli); /** WindowsBasedSli goodBadMetricFilter. */ - public goodBadMetricFilter: string; + public goodBadMetricFilter?: (string|null); /** WindowsBasedSli goodTotalRatioThreshold. */ public goodTotalRatioThreshold?: (google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null); @@ -14556,19 +14556,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); @@ -19908,16 +19908,16 @@ export namespace google { constructor(properties?: google.protobuf.IValue); /** Value nullValue. */ - public nullValue: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue); + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue. */ - public numberValue: number; + public numberValue?: (number|null); /** Value stringValue. */ - public stringValue: string; + public stringValue?: (string|null); /** Value boolValue. */ - public boolValue: boolean; + public boolValue?: (boolean|null); /** Value structValue. */ public structValue?: (google.protobuf.IStruct|null); diff --git a/packages/google-cloud-monitoring/protos/protos.js b/packages/google-cloud-monitoring/protos/protos.js index b07f1bd2592..6cf36a8c6e5 100644 --- a/packages/google-cloud-monitoring/protos/protos.js +++ b/packages/google-cloud-monitoring/protos/protos.js @@ -1144,19 +1144,19 @@ /** * Trigger count. - * @member {number} count + * @member {number|null|undefined} count * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger * @instance */ - Trigger.prototype.count = 0; + Trigger.prototype.count = null; /** * Trigger percent. - * @member {number} percent + * @member {number|null|undefined} percent * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger * @instance */ - Trigger.prototype.percent = 0; + Trigger.prototype.percent = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -2366,35 +2366,35 @@ /** * TypedValue boolValue. - * @member {boolean} boolValue + * @member {boolean|null|undefined} boolValue * @memberof google.monitoring.v3.TypedValue * @instance */ - TypedValue.prototype.boolValue = false; + TypedValue.prototype.boolValue = null; /** * TypedValue int64Value. - * @member {number|Long} int64Value + * @member {number|Long|null|undefined} int64Value * @memberof google.monitoring.v3.TypedValue * @instance */ - TypedValue.prototype.int64Value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TypedValue.prototype.int64Value = null; /** * TypedValue doubleValue. - * @member {number} doubleValue + * @member {number|null|undefined} doubleValue * @memberof google.monitoring.v3.TypedValue * @instance */ - TypedValue.prototype.doubleValue = 0; + TypedValue.prototype.doubleValue = null; /** * TypedValue stringValue. - * @member {string} stringValue + * @member {string|null|undefined} stringValue * @memberof google.monitoring.v3.TypedValue * @instance */ - TypedValue.prototype.stringValue = ""; + TypedValue.prototype.stringValue = null; /** * TypedValue distributionValue. @@ -5986,27 +5986,27 @@ /** * ListGroupsRequest childrenOfGroup. - * @member {string} childrenOfGroup + * @member {string|null|undefined} childrenOfGroup * @memberof google.monitoring.v3.ListGroupsRequest * @instance */ - ListGroupsRequest.prototype.childrenOfGroup = ""; + ListGroupsRequest.prototype.childrenOfGroup = null; /** * ListGroupsRequest ancestorsOfGroup. - * @member {string} ancestorsOfGroup + * @member {string|null|undefined} ancestorsOfGroup * @memberof google.monitoring.v3.ListGroupsRequest * @instance */ - ListGroupsRequest.prototype.ancestorsOfGroup = ""; + ListGroupsRequest.prototype.ancestorsOfGroup = null; /** * ListGroupsRequest descendantsOfGroup. - * @member {string} descendantsOfGroup + * @member {string|null|undefined} descendantsOfGroup * @memberof google.monitoring.v3.ListGroupsRequest * @instance */ - ListGroupsRequest.prototype.descendantsOfGroup = ""; + ListGroupsRequest.prototype.descendantsOfGroup = null; /** * ListGroupsRequest pageSize. @@ -9612,27 +9612,27 @@ /** * LabelValue boolValue. - * @member {boolean} boolValue + * @member {boolean|null|undefined} boolValue * @memberof google.monitoring.v3.LabelValue * @instance */ - LabelValue.prototype.boolValue = false; + LabelValue.prototype.boolValue = null; /** * LabelValue int64Value. - * @member {number|Long} int64Value + * @member {number|Long|null|undefined} int64Value * @memberof google.monitoring.v3.LabelValue * @instance */ - LabelValue.prototype.int64Value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + LabelValue.prototype.int64Value = null; /** * LabelValue stringValue. - * @member {string} stringValue + * @member {string|null|undefined} stringValue * @memberof google.monitoring.v3.LabelValue * @instance */ - LabelValue.prototype.stringValue = ""; + LabelValue.prototype.stringValue = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -21217,11 +21217,11 @@ /** * ServiceLevelObjective calendarPeriod. - * @member {google.type.CalendarPeriod} calendarPeriod + * @member {google.type.CalendarPeriod|null|undefined} calendarPeriod * @memberof google.monitoring.v3.ServiceLevelObjective * @instance */ - ServiceLevelObjective.prototype.calendarPeriod = 0; + ServiceLevelObjective.prototype.calendarPeriod = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -23463,11 +23463,11 @@ /** * WindowsBasedSli goodBadMetricFilter. - * @member {string} goodBadMetricFilter + * @member {string|null|undefined} goodBadMetricFilter * @memberof google.monitoring.v3.WindowsBasedSli * @instance */ - WindowsBasedSli.prototype.goodBadMetricFilter = ""; + WindowsBasedSli.prototype.goodBadMetricFilter = null; /** * WindowsBasedSli goodTotalRatioThreshold. @@ -34874,43 +34874,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. @@ -49120,35 +49120,35 @@ /** * Value nullValue. - * @member {google.protobuf.NullValue} nullValue + * @member {google.protobuf.NullValue|null|undefined} nullValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.nullValue = 0; + Value.prototype.nullValue = null; /** * Value numberValue. - * @member {number} numberValue + * @member {number|null|undefined} numberValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.numberValue = 0; + Value.prototype.numberValue = null; /** * Value stringValue. - * @member {string} stringValue + * @member {string|null|undefined} stringValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.stringValue = ""; + Value.prototype.stringValue = null; /** * Value boolValue. - * @member {boolean} boolValue + * @member {boolean|null|undefined} boolValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.boolValue = false; + Value.prototype.boolValue = null; /** * Value structValue. diff --git a/packages/google-cloud-monitoring/src/v3/alert_policy_service_client.ts b/packages/google-cloud-monitoring/src/v3/alert_policy_service_client.ts index 44ac998c46f..defdfa341e0 100644 --- a/packages/google-cloud-monitoring/src/v3/alert_policy_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/alert_policy_service_client.ts @@ -192,36 +192,42 @@ export class AlertPolicyServiceClient { folderServicePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - folderServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + folderServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), folderUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' ), organizationAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/alertPolicies/{alert_policy}' ), - organizationAlertPolicyConditionPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - organizationChannelDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' - ), + organizationAlertPolicyConditionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' + ), + organizationChannelDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannels/{notification_channel}' - ), + organizationNotificationChannelPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), organizationServicePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/services/{service}' ), - organizationServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - organizationUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' - ), + organizationServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -243,9 +249,10 @@ export class AlertPolicyServiceClient { projectServicePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/services/{service}' ), - projectServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + projectServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), projectUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), @@ -316,13 +323,14 @@ export class AlertPolicyServiceClient { ]; for (const methodName of alertPolicyServiceStubMethods) { const callPromise = this.alertPolicyServiceStub.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; } @@ -476,11 +484,10 @@ export class AlertPolicyServiceClient { 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.getAlertPolicy(request, options, callback); } @@ -576,11 +583,10 @@ export class AlertPolicyServiceClient { 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.createAlertPolicy(request, options, callback); } @@ -666,11 +672,10 @@ export class AlertPolicyServiceClient { 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.deleteAlertPolicy(request, options, callback); } @@ -780,11 +785,10 @@ export class AlertPolicyServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'alert_policy.name': request.alertPolicy!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'alert_policy.name': request.alertPolicy!.name || '', + }); this.initialize(); return this.innerApiCalls.updateAlertPolicy(request, options, callback); } @@ -897,11 +901,10 @@ export class AlertPolicyServiceClient { 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.listAlertPolicies(request, options, callback); } @@ -959,11 +962,10 @@ export class AlertPolicyServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAlertPolicies.createStream( @@ -1032,17 +1034,16 @@ export class AlertPolicyServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAlertPolicies.asyncIterate( this.innerApiCalls['listAlertPolicies'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-monitoring/src/v3/group_service_client.ts b/packages/google-cloud-monitoring/src/v3/group_service_client.ts index bd90184be4f..f38d2ac4a31 100644 --- a/packages/google-cloud-monitoring/src/v3/group_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/group_service_client.ts @@ -195,36 +195,42 @@ export class GroupServiceClient { folderServicePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - folderServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + folderServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), folderUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' ), organizationAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/alertPolicies/{alert_policy}' ), - organizationAlertPolicyConditionPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - organizationChannelDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' - ), + organizationAlertPolicyConditionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' + ), + organizationChannelDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannels/{notification_channel}' - ), + organizationNotificationChannelPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), organizationServicePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/services/{service}' ), - organizationServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - organizationUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' - ), + organizationServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -246,9 +252,10 @@ export class GroupServiceClient { projectServicePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/services/{service}' ), - projectServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + projectServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), projectUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), @@ -325,13 +332,14 @@ export class GroupServiceClient { ]; for (const methodName of groupServiceStubMethods) { const callPromise = this.groupServiceStub.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; } @@ -485,11 +493,10 @@ export class GroupServiceClient { 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.getGroup(request, options, callback); } @@ -576,11 +583,10 @@ export class GroupServiceClient { 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.createGroup(request, options, callback); } @@ -664,11 +670,10 @@ export class GroupServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'group.name': request.group!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'group.name': request.group!.name || '', + }); this.initialize(); return this.innerApiCalls.updateGroup(request, options, callback); } @@ -754,11 +759,10 @@ export class GroupServiceClient { 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.deleteGroup(request, options, callback); } @@ -874,11 +878,10 @@ export class GroupServiceClient { 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.listGroups(request, options, callback); } @@ -941,11 +944,10 @@ export class GroupServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGroups.createStream( @@ -1019,17 +1021,16 @@ export class GroupServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGroups.asyncIterate( this.innerApiCalls['listGroups'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1136,11 +1137,10 @@ export class GroupServiceClient { 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.listGroupMembers(request, options, callback); } @@ -1193,11 +1193,10 @@ export class GroupServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGroupMembers.createStream( @@ -1261,17 +1260,16 @@ export class GroupServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGroupMembers.asyncIterate( this.innerApiCalls['listGroupMembers'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-monitoring/src/v3/metric_service_client.ts b/packages/google-cloud-monitoring/src/v3/metric_service_client.ts index a33afcb2c4d..db18a051203 100644 --- a/packages/google-cloud-monitoring/src/v3/metric_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/metric_service_client.ts @@ -182,51 +182,60 @@ export class MetricServiceClient { folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' ), - folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), + folderMonitoredResourceDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), folderServicePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - folderServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + folderServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), folderUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' ), organizationAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/alertPolicies/{alert_policy}' ), - organizationAlertPolicyConditionPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - organizationChannelDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' - ), + organizationAlertPolicyConditionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' + ), + organizationChannelDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' - ), - organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), - organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannels/{notification_channel}' - ), + organizationMetricDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' + ), + organizationMonitoredResourceDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), + organizationNotificationChannelPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), organizationServicePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/services/{service}' ), - organizationServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - organizationUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' - ), + organizationServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -245,18 +254,20 @@ export class MetricServiceClient { projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/metricDescriptors/{metric_descriptor=**}' ), - projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), + projectMonitoredResourceDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), projectServicePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/services/{service}' ), - projectServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + projectServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), projectTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/timeSeries/{time_series}' ), @@ -343,13 +354,14 @@ export class MetricServiceClient { ]; for (const methodName of metricServiceStubMethods) { const callPromise = this.metricServiceStub.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; } @@ -521,11 +533,10 @@ export class MetricServiceClient { 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.getMonitoredResourceDescriptor( request, @@ -622,11 +633,10 @@ export class MetricServiceClient { 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.getMetricDescriptor(request, options, callback); } @@ -721,11 +731,10 @@ export class MetricServiceClient { 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.createMetricDescriptor( request, @@ -824,11 +833,10 @@ export class MetricServiceClient { 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.deleteMetricDescriptor( request, @@ -927,11 +935,10 @@ export class MetricServiceClient { 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.createTimeSeries(request, options, callback); } @@ -1038,11 +1045,10 @@ export class MetricServiceClient { 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.listMonitoredResourceDescriptors( request, @@ -1092,11 +1098,10 @@ export class MetricServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listMonitoredResourceDescriptors.createStream( @@ -1153,17 +1158,16 @@ export class MetricServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listMonitoredResourceDescriptors.asyncIterate( this.innerApiCalls['listMonitoredResourceDescriptors'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1271,11 +1275,10 @@ export class MetricServiceClient { 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.listMetricDescriptors(request, options, callback); } @@ -1323,11 +1326,10 @@ export class MetricServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listMetricDescriptors.createStream( @@ -1386,17 +1388,16 @@ export class MetricServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listMetricDescriptors.asyncIterate( this.innerApiCalls['listMetricDescriptors'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1522,11 +1523,10 @@ export class MetricServiceClient { 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.listTimeSeries(request, options, callback); } @@ -1598,11 +1598,10 @@ export class MetricServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTimeSeries.createStream( @@ -1685,17 +1684,16 @@ export class MetricServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTimeSeries.asyncIterate( this.innerApiCalls['listTimeSeries'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-monitoring/src/v3/notification_channel_service_client.ts b/packages/google-cloud-monitoring/src/v3/notification_channel_service_client.ts index e2be5884b29..123f549e0cb 100644 --- a/packages/google-cloud-monitoring/src/v3/notification_channel_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/notification_channel_service_client.ts @@ -186,36 +186,42 @@ export class NotificationChannelServiceClient { folderServicePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - folderServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + folderServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), folderUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' ), organizationAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/alertPolicies/{alert_policy}' ), - organizationAlertPolicyConditionPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - organizationChannelDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' - ), + organizationAlertPolicyConditionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' + ), + organizationChannelDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannels/{notification_channel}' - ), + organizationNotificationChannelPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), organizationServicePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/services/{service}' ), - organizationServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - organizationUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' - ), + organizationServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -237,9 +243,10 @@ export class NotificationChannelServiceClient { projectServicePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/services/{service}' ), - projectServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + projectServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), projectUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), @@ -320,13 +327,14 @@ export class NotificationChannelServiceClient { ]; for (const methodName of notificationChannelServiceStubMethods) { const callPromise = this.notificationChannelServiceStub.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; } @@ -495,11 +503,10 @@ export class NotificationChannelServiceClient { 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.getNotificationChannelDescriptor( request, @@ -597,11 +604,10 @@ export class NotificationChannelServiceClient { 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.getNotificationChannel( request, @@ -703,11 +709,10 @@ export class NotificationChannelServiceClient { 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.createNotificationChannel( request, @@ -805,11 +810,10 @@ export class NotificationChannelServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'notification_channel.name': request.notificationChannel!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'notification_channel.name': request.notificationChannel!.name || '', + }); this.initialize(); return this.innerApiCalls.updateNotificationChannel( request, @@ -908,11 +912,10 @@ export class NotificationChannelServiceClient { 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.deleteNotificationChannel( request, @@ -1011,11 +1014,10 @@ export class NotificationChannelServiceClient { 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.sendNotificationChannelVerificationCode( request, @@ -1145,11 +1147,10 @@ export class NotificationChannelServiceClient { 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.getNotificationChannelVerificationCode( request, @@ -1251,11 +1252,10 @@ export class NotificationChannelServiceClient { 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.verifyNotificationChannel( request, @@ -1368,11 +1368,10 @@ export class NotificationChannelServiceClient { 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.listNotificationChannelDescriptors( request, @@ -1423,11 +1422,10 @@ export class NotificationChannelServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationChannelDescriptors.createStream( @@ -1485,17 +1483,16 @@ export class NotificationChannelServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationChannelDescriptors.asyncIterate( this.innerApiCalls['listNotificationChannelDescriptors'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1616,11 +1613,10 @@ export class NotificationChannelServiceClient { 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.listNotificationChannels( request, @@ -1685,11 +1681,10 @@ export class NotificationChannelServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationChannels.createStream( @@ -1761,17 +1756,16 @@ export class NotificationChannelServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationChannels.asyncIterate( this.innerApiCalls['listNotificationChannels'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-monitoring/src/v3/query_service_client.ts b/packages/google-cloud-monitoring/src/v3/query_service_client.ts index 8260474a0ec..38492e3d2bf 100644 --- a/packages/google-cloud-monitoring/src/v3/query_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/query_service_client.ts @@ -186,36 +186,42 @@ export class QueryServiceClient { folderServicePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - folderServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + folderServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), folderUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' ), organizationAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/alertPolicies/{alert_policy}' ), - organizationAlertPolicyConditionPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - organizationChannelDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' - ), + organizationAlertPolicyConditionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' + ), + organizationChannelDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannels/{notification_channel}' - ), + organizationNotificationChannelPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), organizationServicePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/services/{service}' ), - organizationServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - organizationUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' - ), + organizationServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), projectAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/alertPolicies/{alert_policy}' ), @@ -234,9 +240,10 @@ export class QueryServiceClient { projectServicePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/services/{service}' ), - projectServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + projectServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), projectUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), @@ -301,13 +308,14 @@ export class QueryServiceClient { const queryServiceStubMethods = ['queryTimeSeries']; for (const methodName of queryServiceStubMethods) { const callPromise = this.queryServiceStub.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; } @@ -477,11 +485,10 @@ export class QueryServiceClient { 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.queryTimeSeries(request, options, callback); } @@ -524,11 +531,10 @@ export class QueryServiceClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.queryTimeSeries.createStream( @@ -582,17 +588,16 @@ export class QueryServiceClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.queryTimeSeries.asyncIterate( this.innerApiCalls['queryTimeSeries'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client.ts b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client.ts index d7a4f852245..b6157a78676 100644 --- a/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client.ts @@ -188,36 +188,42 @@ export class ServiceMonitoringServiceClient { folderServicePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - folderServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + folderServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), folderUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' ), organizationAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/alertPolicies/{alert_policy}' ), - organizationAlertPolicyConditionPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - organizationChannelDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' - ), + organizationAlertPolicyConditionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' + ), + organizationChannelDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannels/{notification_channel}' - ), + organizationNotificationChannelPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), organizationServicePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/services/{service}' ), - organizationServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - organizationUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' - ), + organizationServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -239,9 +245,10 @@ export class ServiceMonitoringServiceClient { projectServicePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/services/{service}' ), - projectServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + projectServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), projectUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), @@ -322,13 +329,14 @@ export class ServiceMonitoringServiceClient { ]; for (const methodName of serviceMonitoringServiceStubMethods) { const callPromise = this.serviceMonitoringServiceStub.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; } @@ -487,11 +495,10 @@ export class ServiceMonitoringServiceClient { 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.createService(request, options, callback); } @@ -573,11 +580,10 @@ export class ServiceMonitoringServiceClient { 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.getService(request, options, callback); } @@ -660,11 +666,10 @@ export class ServiceMonitoringServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'service.name': request.service!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'service.name': request.service!.name || '', + }); this.initialize(); return this.innerApiCalls.updateService(request, options, callback); } @@ -746,11 +751,10 @@ export class ServiceMonitoringServiceClient { 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.deleteService(request, options, callback); } @@ -854,11 +858,10 @@ export class ServiceMonitoringServiceClient { 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.createServiceLevelObjective( request, @@ -957,11 +960,10 @@ export class ServiceMonitoringServiceClient { 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.getServiceLevelObjective( request, @@ -1062,11 +1064,11 @@ export class ServiceMonitoringServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'service_level_objective.name': request.serviceLevelObjective!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'service_level_objective.name': + request.serviceLevelObjective!.name || '', + }); this.initialize(); return this.innerApiCalls.updateServiceLevelObjective( request, @@ -1166,11 +1168,10 @@ export class ServiceMonitoringServiceClient { 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.deleteServiceLevelObjective( request, @@ -1289,11 +1290,10 @@ export class ServiceMonitoringServiceClient { 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.listServices(request, options, callback); } @@ -1355,11 +1355,10 @@ export class ServiceMonitoringServiceClient { 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.listServices.createStream( @@ -1432,17 +1431,16 @@ export class ServiceMonitoringServiceClient { 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.listServices.asyncIterate( this.innerApiCalls['listServices'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1551,11 +1549,10 @@ export class ServiceMonitoringServiceClient { 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.listServiceLevelObjectives( request, @@ -1608,11 +1605,10 @@ export class ServiceMonitoringServiceClient { 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.listServiceLevelObjectives.createStream( @@ -1672,17 +1668,16 @@ export class ServiceMonitoringServiceClient { 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.listServiceLevelObjectives.asyncIterate( this.innerApiCalls['listServiceLevelObjectives'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-monitoring/src/v3/uptime_check_service_client.ts b/packages/google-cloud-monitoring/src/v3/uptime_check_service_client.ts index 418c51f80ba..7a5d6ce8318 100644 --- a/packages/google-cloud-monitoring/src/v3/uptime_check_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/uptime_check_service_client.ts @@ -191,36 +191,42 @@ export class UptimeCheckServiceClient { folderServicePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - folderServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + folderServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), folderUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' ), organizationAlertPolicyPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/alertPolicies/{alert_policy}' ), - organizationAlertPolicyConditionPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - organizationChannelDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' - ), + organizationAlertPolicyConditionPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}' + ), + organizationChannelDescriptorPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationChannels/{notification_channel}' - ), + organizationNotificationChannelPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), organizationServicePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/services/{service}' ), - organizationServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - organizationUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' - ), + organizationServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -242,9 +248,10 @@ export class UptimeCheckServiceClient { projectServicePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/services/{service}' ), - projectServiceServiceLevelObjectivePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), + projectServiceServiceLevelObjectivePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), projectUptimeCheckConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), @@ -321,13 +328,14 @@ export class UptimeCheckServiceClient { ]; for (const methodName of uptimeCheckServiceStubMethods) { const callPromise = this.uptimeCheckServiceStub.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; } @@ -489,11 +497,10 @@ export class UptimeCheckServiceClient { 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.getUptimeCheckConfig(request, options, callback); } @@ -585,11 +592,10 @@ export class UptimeCheckServiceClient { 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.createUptimeCheckConfig( request, @@ -699,11 +705,10 @@ export class UptimeCheckServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'uptime_check_config.name': request.uptimeCheckConfig!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'uptime_check_config.name': request.uptimeCheckConfig!.name || '', + }); this.initialize(); return this.innerApiCalls.updateUptimeCheckConfig( request, @@ -799,11 +804,10 @@ export class UptimeCheckServiceClient { 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.deleteUptimeCheckConfig( request, @@ -911,11 +915,10 @@ export class UptimeCheckServiceClient { 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.listUptimeCheckConfigs( request, @@ -961,11 +964,10 @@ export class UptimeCheckServiceClient { 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.listUptimeCheckConfigs.createStream( @@ -1018,17 +1020,16 @@ export class UptimeCheckServiceClient { 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.listUptimeCheckConfigs.asyncIterate( this.innerApiCalls['listUptimeCheckConfigs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1216,7 +1217,7 @@ export class UptimeCheckServiceClient { this.initialize(); return this.descriptors.page.listUptimeCheckIps.asyncIterate( this.innerApiCalls['listUptimeCheckIps'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.js b/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.js index 989fd17d844..49be45ef93a 100644 --- a/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.js @@ -23,9 +23,11 @@ function main() { const alertPolicyServiceClient = new monitoring.AlertPolicyServiceClient(); const groupServiceClient = new monitoring.GroupServiceClient(); const metricServiceClient = new monitoring.MetricServiceClient(); - const notificationChannelServiceClient = new monitoring.NotificationChannelServiceClient(); + const notificationChannelServiceClient = + new monitoring.NotificationChannelServiceClient(); const queryServiceClient = new monitoring.QueryServiceClient(); - const serviceMonitoringServiceClient = new monitoring.ServiceMonitoringServiceClient(); + const serviceMonitoringServiceClient = + new monitoring.ServiceMonitoringServiceClient(); const uptimeCheckServiceClient = new monitoring.UptimeCheckServiceClient(); } diff --git a/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.ts index c4ee0535da7..3c852d99a4a 100644 --- a/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-monitoring/system-test/fixtures/sample/src/index.ts @@ -64,7 +64,8 @@ function main() { const metricServiceClient = new MetricServiceClient(); doStuffWithMetricServiceClient(metricServiceClient); // check that the client instance can be created - const notificationChannelServiceClient = new NotificationChannelServiceClient(); + const notificationChannelServiceClient = + new NotificationChannelServiceClient(); doStuffWithNotificationChannelServiceClient(notificationChannelServiceClient); // check that the client instance can be created const queryServiceClient = new QueryServiceClient(); diff --git a/packages/google-cloud-monitoring/test/gapic_alert_policy_service_v3.ts b/packages/google-cloud-monitoring/test/gapic_alert_policy_service_v3.ts index 4a47b723950..8002a011759 100644 --- a/packages/google-cloud-monitoring/test/gapic_alert_policy_service_v3.ts +++ b/packages/google-cloud-monitoring/test/gapic_alert_policy_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; 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; @@ -249,9 +248,8 @@ describe('v3.AlertPolicyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.AlertPolicy() ); - client.innerApiCalls.getAlertPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getAlertPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getAlertPolicy( request, @@ -361,9 +359,8 @@ describe('v3.AlertPolicyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.AlertPolicy() ); - client.innerApiCalls.createAlertPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createAlertPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createAlertPolicy( request, @@ -473,9 +470,8 @@ describe('v3.AlertPolicyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteAlertPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteAlertPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteAlertPolicy( request, @@ -587,9 +583,8 @@ describe('v3.AlertPolicyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.AlertPolicy() ); - client.innerApiCalls.updateAlertPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateAlertPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateAlertPolicy( request, @@ -704,9 +699,8 @@ describe('v3.AlertPolicyServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.AlertPolicy()), generateSampleMessage(new protos.google.monitoring.v3.AlertPolicy()), ]; - client.innerApiCalls.listAlertPolicies = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listAlertPolicies = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listAlertPolicies( request, @@ -778,9 +772,8 @@ describe('v3.AlertPolicyServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.AlertPolicy()), generateSampleMessage(new protos.google.monitoring.v3.AlertPolicy()), ]; - client.descriptors.page.listAlertPolicies.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listAlertPolicies.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listAlertPoliciesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.AlertPolicy[] = []; @@ -805,10 +798,9 @@ describe('v3.AlertPolicyServiceClient', () => { .calledWith(client.innerApiCalls.listAlertPolicies, request) ); assert.strictEqual( - (client.descriptors.page.listAlertPolicies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAlertPolicies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -825,10 +817,8 @@ describe('v3.AlertPolicyServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listAlertPolicies.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listAlertPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listAlertPoliciesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.AlertPolicy[] = []; @@ -852,10 +842,9 @@ describe('v3.AlertPolicyServiceClient', () => { .calledWith(client.innerApiCalls.listAlertPolicies, request) ); assert.strictEqual( - (client.descriptors.page.listAlertPolicies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAlertPolicies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -876,9 +865,8 @@ describe('v3.AlertPolicyServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.AlertPolicy()), generateSampleMessage(new protos.google.monitoring.v3.AlertPolicy()), ]; - client.descriptors.page.listAlertPolicies.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listAlertPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.IAlertPolicy[] = []; const iterable = client.listAlertPoliciesAsync(request); for await (const resource of iterable) { @@ -886,15 +874,15 @@ describe('v3.AlertPolicyServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listAlertPolicies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listAlertPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAlertPolicies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAlertPolicies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -911,10 +899,8 @@ describe('v3.AlertPolicyServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listAlertPolicies.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listAlertPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listAlertPoliciesAsync(request); await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IAlertPolicy[] = []; @@ -923,15 +909,15 @@ describe('v3.AlertPolicyServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listAlertPolicies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listAlertPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAlertPolicies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAlertPolicies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -963,8 +949,10 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -974,21 +962,24 @@ describe('v3.AlertPolicyServiceClient', () => { const result = client.matchFolderFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1022,47 +1013,52 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderAlertPolicyConditionName', () => { - const result = client.matchFolderFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchFolderFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromFolderAlertPolicyConditionName', () => { - const result = client.matchConditionFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1094,34 +1090,40 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderChannelDescriptorName', () => { - const result = client.matchFolderFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderChannelDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromFolderChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromFolderChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1202,34 +1204,40 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderNotificationChannelName', () => { - const result = client.matchFolderFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchFolderFromFolderNotificationChannelName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromFolderNotificationChannelName', () => { - const result = client.matchNotificationChannelFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromFolderNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1297,12 +1305,10 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderServiceServiceLevelObjectivePath', () => { const result = client.folderServiceServiceLevelObjectivePath( @@ -1312,47 +1318,58 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchFolderFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchFolderFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1384,34 +1401,40 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderUptimeCheckConfigName', () => { - const result = client.matchFolderFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchFolderFromFolderUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromFolderUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1443,34 +1466,38 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1489,12 +1516,10 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAlertPolicyConditionPath', () => { const result = client.organizationAlertPolicyConditionPath( @@ -1504,47 +1529,58 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchConditionFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1562,12 +1598,10 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationChannelDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationChannelDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationChannelDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationChannelDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationChannelDescriptorPath', () => { const result = client.organizationChannelDescriptorPath( @@ -1576,34 +1610,42 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationChannelDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromOrganizationChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1635,21 +1677,24 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationGroupPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationGroupName', () => { - const result = client.matchOrganizationFromOrganizationGroupName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1659,8 +1704,10 @@ describe('v3.AlertPolicyServiceClient', () => { const result = client.matchGroupFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'groupValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1678,12 +1725,10 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationNotificationChannelPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationNotificationChannelPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationNotificationChannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationChannelPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationNotificationChannelPath', () => { const result = client.organizationNotificationChannelPath( @@ -1692,34 +1737,42 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationNotificationChannelName', () => { - const result = client.matchOrganizationFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromOrganizationNotificationChannelName', () => { - const result = client.matchNotificationChannelFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1751,21 +1804,24 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationServicePathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceName', () => { - const result = client.matchOrganizationFromOrganizationServiceName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1775,8 +1831,10 @@ describe('v3.AlertPolicyServiceClient', () => { const result = client.matchServiceFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1796,12 +1854,10 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationServiceServiceLevelObjectivePath', () => { const result = client.organizationServiceServiceLevelObjectivePath( @@ -1811,51 +1867,62 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1873,12 +1940,10 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationUptimeCheckConfigPath', () => { const result = client.organizationUptimeCheckConfigPath( @@ -1887,34 +1952,42 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchOrganizationFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1984,8 +2057,10 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1995,21 +2070,24 @@ describe('v3.AlertPolicyServiceClient', () => { const result = client.matchProjectFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2028,9 +2106,8 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.projectAlertPolicyConditionPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -2043,47 +2120,52 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectAlertPolicyConditionName', () => { - const result = client.matchProjectFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchProjectFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromProjectAlertPolicyConditionName', () => { - const result = client.matchConditionFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2115,34 +2197,40 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectChannelDescriptorName', () => { - const result = client.matchProjectFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectChannelDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromProjectChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromProjectChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2223,34 +2311,40 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectNotificationChannelName', () => { - const result = client.matchProjectFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchProjectFromProjectNotificationChannelName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromProjectNotificationChannelName', () => { - const result = client.matchNotificationChannelFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromProjectNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2321,12 +2415,10 @@ describe('v3.AlertPolicyServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectServiceServiceLevelObjectivePath', () => { const result = client.projectServiceServiceLevelObjectivePath( @@ -2336,47 +2428,58 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchProjectFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchProjectFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2408,34 +2511,40 @@ describe('v3.AlertPolicyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectUptimeCheckConfigName', () => { - const result = client.matchProjectFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchProjectFromProjectUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromProjectUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-monitoring/test/gapic_group_service_v3.ts b/packages/google-cloud-monitoring/test/gapic_group_service_v3.ts index 5a984f6c0a8..6ca1907f044 100644 --- a/packages/google-cloud-monitoring/test/gapic_group_service_v3.ts +++ b/packages/google-cloud-monitoring/test/gapic_group_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; 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; @@ -247,9 +246,8 @@ describe('v3.GroupServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.Group() ); - client.innerApiCalls.getGroup = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGroup = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGroup( request, @@ -356,9 +354,8 @@ describe('v3.GroupServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.Group() ); - client.innerApiCalls.createGroup = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGroup = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGroup( request, @@ -470,9 +467,8 @@ describe('v3.GroupServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.Group() ); - client.innerApiCalls.updateGroup = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateGroup = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateGroup( request, @@ -583,9 +579,8 @@ describe('v3.GroupServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteGroup = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGroup = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGroup( request, @@ -699,9 +694,8 @@ describe('v3.GroupServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.Group()), generateSampleMessage(new protos.google.monitoring.v3.Group()), ]; - client.innerApiCalls.listGroups = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGroups = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGroups( request, @@ -773,9 +767,8 @@ describe('v3.GroupServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.Group()), generateSampleMessage(new protos.google.monitoring.v3.Group()), ]; - client.descriptors.page.listGroups.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listGroups.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listGroupsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.Group[] = []; @@ -863,9 +856,8 @@ describe('v3.GroupServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.Group()), generateSampleMessage(new protos.google.monitoring.v3.Group()), ]; - client.descriptors.page.listGroups.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listGroups.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.IGroup[] = []; const iterable = client.listGroupsAsync(request); for await (const resource of iterable) { @@ -981,9 +973,8 @@ describe('v3.GroupServiceClient', () => { generateSampleMessage(new protos.google.api.MonitoredResource()), generateSampleMessage(new protos.google.api.MonitoredResource()), ]; - client.innerApiCalls.listGroupMembers = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGroupMembers = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGroupMembers( request, @@ -1055,9 +1046,8 @@ describe('v3.GroupServiceClient', () => { generateSampleMessage(new protos.google.api.MonitoredResource()), generateSampleMessage(new protos.google.api.MonitoredResource()), ]; - client.descriptors.page.listGroupMembers.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listGroupMembers.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listGroupMembersStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.api.MonitoredResource[] = []; @@ -1079,10 +1069,9 @@ describe('v3.GroupServiceClient', () => { .calledWith(client.innerApiCalls.listGroupMembers, request) ); assert.strictEqual( - (client.descriptors.page.listGroupMembers - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGroupMembers.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1099,10 +1088,8 @@ describe('v3.GroupServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listGroupMembers.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listGroupMembers.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listGroupMembersStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.api.MonitoredResource[] = []; @@ -1123,10 +1110,9 @@ describe('v3.GroupServiceClient', () => { .calledWith(client.innerApiCalls.listGroupMembers, request) ); assert.strictEqual( - (client.descriptors.page.listGroupMembers - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGroupMembers.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1147,9 +1133,8 @@ describe('v3.GroupServiceClient', () => { generateSampleMessage(new protos.google.api.MonitoredResource()), generateSampleMessage(new protos.google.api.MonitoredResource()), ]; - client.descriptors.page.listGroupMembers.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listGroupMembers.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.api.IMonitoredResource[] = []; const iterable = client.listGroupMembersAsync(request); for await (const resource of iterable) { @@ -1157,15 +1142,15 @@ describe('v3.GroupServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listGroupMembers - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGroupMembers.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGroupMembers - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGroupMembers.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1182,10 +1167,8 @@ describe('v3.GroupServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listGroupMembers.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listGroupMembers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listGroupMembersAsync(request); await assert.rejects(async () => { const responses: protos.google.api.IMonitoredResource[] = []; @@ -1194,15 +1177,15 @@ describe('v3.GroupServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listGroupMembers - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGroupMembers.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGroupMembers - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGroupMembers.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1234,8 +1217,10 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1245,21 +1230,24 @@ describe('v3.GroupServiceClient', () => { const result = client.matchFolderFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1293,47 +1281,52 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderAlertPolicyConditionName', () => { - const result = client.matchFolderFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchFolderFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromFolderAlertPolicyConditionName', () => { - const result = client.matchConditionFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1365,34 +1358,40 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderChannelDescriptorName', () => { - const result = client.matchFolderFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderChannelDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromFolderChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromFolderChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1473,34 +1472,40 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderNotificationChannelName', () => { - const result = client.matchFolderFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchFolderFromFolderNotificationChannelName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromFolderNotificationChannelName', () => { - const result = client.matchNotificationChannelFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromFolderNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1568,12 +1573,10 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderServiceServiceLevelObjectivePath', () => { const result = client.folderServiceServiceLevelObjectivePath( @@ -1583,47 +1586,58 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchFolderFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchFolderFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1655,34 +1669,40 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderUptimeCheckConfigName', () => { - const result = client.matchFolderFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchFolderFromFolderUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromFolderUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1714,34 +1734,38 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1760,12 +1784,10 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAlertPolicyConditionPath', () => { const result = client.organizationAlertPolicyConditionPath( @@ -1775,47 +1797,58 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchConditionFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1833,12 +1866,10 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationChannelDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationChannelDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationChannelDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationChannelDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationChannelDescriptorPath', () => { const result = client.organizationChannelDescriptorPath( @@ -1847,34 +1878,42 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationChannelDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromOrganizationChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1906,21 +1945,24 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationGroupPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationGroupName', () => { - const result = client.matchOrganizationFromOrganizationGroupName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1930,8 +1972,10 @@ describe('v3.GroupServiceClient', () => { const result = client.matchGroupFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'groupValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1949,12 +1993,10 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationNotificationChannelPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationNotificationChannelPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationNotificationChannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationChannelPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationNotificationChannelPath', () => { const result = client.organizationNotificationChannelPath( @@ -1963,34 +2005,42 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationNotificationChannelName', () => { - const result = client.matchOrganizationFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromOrganizationNotificationChannelName', () => { - const result = client.matchNotificationChannelFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2022,21 +2072,24 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationServicePathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceName', () => { - const result = client.matchOrganizationFromOrganizationServiceName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2046,8 +2099,10 @@ describe('v3.GroupServiceClient', () => { const result = client.matchServiceFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2067,12 +2122,10 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationServiceServiceLevelObjectivePath', () => { const result = client.organizationServiceServiceLevelObjectivePath( @@ -2082,51 +2135,62 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2144,12 +2208,10 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationUptimeCheckConfigPath', () => { const result = client.organizationUptimeCheckConfigPath( @@ -2158,34 +2220,42 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchOrganizationFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2255,8 +2325,10 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -2266,21 +2338,24 @@ describe('v3.GroupServiceClient', () => { const result = client.matchProjectFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2299,9 +2374,8 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.projectAlertPolicyConditionPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -2314,47 +2388,52 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectAlertPolicyConditionName', () => { - const result = client.matchProjectFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchProjectFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromProjectAlertPolicyConditionName', () => { - const result = client.matchConditionFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2386,34 +2465,40 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectChannelDescriptorName', () => { - const result = client.matchProjectFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectChannelDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromProjectChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromProjectChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2494,34 +2579,40 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectNotificationChannelName', () => { - const result = client.matchProjectFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchProjectFromProjectNotificationChannelName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromProjectNotificationChannelName', () => { - const result = client.matchNotificationChannelFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromProjectNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2592,12 +2683,10 @@ describe('v3.GroupServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectServiceServiceLevelObjectivePath', () => { const result = client.projectServiceServiceLevelObjectivePath( @@ -2607,47 +2696,58 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchProjectFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchProjectFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2679,34 +2779,40 @@ describe('v3.GroupServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectUptimeCheckConfigName', () => { - const result = client.matchProjectFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchProjectFromProjectUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromProjectUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-monitoring/test/gapic_metric_service_v3.ts b/packages/google-cloud-monitoring/test/gapic_metric_service_v3.ts index f4c7a852563..8b4684de354 100644 --- a/packages/google-cloud-monitoring/test/gapic_metric_service_v3.ts +++ b/packages/google-cloud-monitoring/test/gapic_metric_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; 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; @@ -216,9 +215,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.MonitoredResourceDescriptor() ); - client.innerApiCalls.getMonitoredResourceDescriptor = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getMonitoredResourceDescriptor = + stubSimpleCall(expectedResponse); const [response] = await client.getMonitoredResourceDescriptor(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -249,9 +247,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.MonitoredResourceDescriptor() ); - client.innerApiCalls.getMonitoredResourceDescriptor = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getMonitoredResourceDescriptor = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getMonitoredResourceDescriptor( request, @@ -333,9 +330,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.MetricDescriptor() ); - client.innerApiCalls.getMetricDescriptor = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getMetricDescriptor = + stubSimpleCall(expectedResponse); const [response] = await client.getMetricDescriptor(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -366,9 +362,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.MetricDescriptor() ); - client.innerApiCalls.getMetricDescriptor = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getMetricDescriptor = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getMetricDescriptor( request, @@ -447,9 +442,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.MetricDescriptor() ); - client.innerApiCalls.createMetricDescriptor = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.createMetricDescriptor = + stubSimpleCall(expectedResponse); const [response] = await client.createMetricDescriptor(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -480,9 +474,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.MetricDescriptor() ); - client.innerApiCalls.createMetricDescriptor = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createMetricDescriptor = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createMetricDescriptor( request, @@ -564,9 +557,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteMetricDescriptor = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteMetricDescriptor = + stubSimpleCall(expectedResponse); const [response] = await client.deleteMetricDescriptor(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -597,9 +589,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteMetricDescriptor = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteMetricDescriptor = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteMetricDescriptor( request, @@ -712,9 +703,8 @@ describe('v3.MetricServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.createTimeSeries = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createTimeSeries = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createTimeSeries( request, @@ -801,9 +791,8 @@ describe('v3.MetricServiceClient', () => { new protos.google.api.MonitoredResourceDescriptor() ), ]; - client.innerApiCalls.listMonitoredResourceDescriptors = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listMonitoredResourceDescriptors = + stubSimpleCall(expectedResponse); const [response] = await client.listMonitoredResourceDescriptors(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -842,9 +831,8 @@ describe('v3.MetricServiceClient', () => { new protos.google.api.MonitoredResourceDescriptor() ), ]; - client.innerApiCalls.listMonitoredResourceDescriptors = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listMonitoredResourceDescriptors = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listMonitoredResourceDescriptors( request, @@ -925,9 +913,8 @@ describe('v3.MetricServiceClient', () => { new protos.google.api.MonitoredResourceDescriptor() ), ]; - client.descriptors.page.listMonitoredResourceDescriptors.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listMonitoredResourceDescriptors.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listMonitoredResourceDescriptorsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.api.MonitoredResourceDescriptor[] = []; @@ -947,8 +934,10 @@ describe('v3.MetricServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listMonitoredResourceDescriptors - .createStream as SinonStub) + ( + client.descriptors.page.listMonitoredResourceDescriptors + .createStream as SinonStub + ) .getCall(0) .calledWith( client.innerApiCalls.listMonitoredResourceDescriptors, @@ -956,10 +945,10 @@ describe('v3.MetricServiceClient', () => { ) ); assert.strictEqual( - (client.descriptors.page.listMonitoredResourceDescriptors - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMonitoredResourceDescriptors + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -976,10 +965,8 @@ describe('v3.MetricServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listMonitoredResourceDescriptors.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listMonitoredResourceDescriptors.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listMonitoredResourceDescriptorsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.api.MonitoredResourceDescriptor[] = []; @@ -998,8 +985,10 @@ describe('v3.MetricServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listMonitoredResourceDescriptors - .createStream as SinonStub) + ( + client.descriptors.page.listMonitoredResourceDescriptors + .createStream as SinonStub + ) .getCall(0) .calledWith( client.innerApiCalls.listMonitoredResourceDescriptors, @@ -1007,10 +996,10 @@ describe('v3.MetricServiceClient', () => { ) ); assert.strictEqual( - (client.descriptors.page.listMonitoredResourceDescriptors - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMonitoredResourceDescriptors + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1037,9 +1026,8 @@ describe('v3.MetricServiceClient', () => { new protos.google.api.MonitoredResourceDescriptor() ), ]; - client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.api.IMonitoredResourceDescriptor[] = []; const iterable = client.listMonitoredResourceDescriptorsAsync(request); for await (const resource of iterable) { @@ -1047,15 +1035,17 @@ describe('v3.MetricServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listMonitoredResourceDescriptors - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listMonitoredResourceDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listMonitoredResourceDescriptors - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMonitoredResourceDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1072,10 +1062,8 @@ describe('v3.MetricServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listMonitoredResourceDescriptorsAsync(request); await assert.rejects(async () => { const responses: protos.google.api.IMonitoredResourceDescriptor[] = []; @@ -1084,15 +1072,17 @@ describe('v3.MetricServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listMonitoredResourceDescriptors - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listMonitoredResourceDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listMonitoredResourceDescriptors - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMonitoredResourceDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1122,9 +1112,8 @@ describe('v3.MetricServiceClient', () => { generateSampleMessage(new protos.google.api.MetricDescriptor()), generateSampleMessage(new protos.google.api.MetricDescriptor()), ]; - client.innerApiCalls.listMetricDescriptors = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listMetricDescriptors = + stubSimpleCall(expectedResponse); const [response] = await client.listMetricDescriptors(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1157,9 +1146,8 @@ describe('v3.MetricServiceClient', () => { generateSampleMessage(new protos.google.api.MetricDescriptor()), generateSampleMessage(new protos.google.api.MetricDescriptor()), ]; - client.innerApiCalls.listMetricDescriptors = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listMetricDescriptors = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listMetricDescriptors( request, @@ -1234,9 +1222,8 @@ describe('v3.MetricServiceClient', () => { generateSampleMessage(new protos.google.api.MetricDescriptor()), generateSampleMessage(new protos.google.api.MetricDescriptor()), ]; - client.descriptors.page.listMetricDescriptors.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listMetricDescriptors.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listMetricDescriptorsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.api.MetricDescriptor[] = []; @@ -1253,16 +1240,18 @@ describe('v3.MetricServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listMetricDescriptors - .createStream as SinonStub) + ( + client.descriptors.page.listMetricDescriptors + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listMetricDescriptors, request) ); assert.strictEqual( - (client.descriptors.page.listMetricDescriptors - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMetricDescriptors + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1279,10 +1268,8 @@ describe('v3.MetricServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listMetricDescriptors.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listMetricDescriptors.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listMetricDescriptorsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.api.MetricDescriptor[] = []; @@ -1298,16 +1285,18 @@ describe('v3.MetricServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listMetricDescriptors - .createStream as SinonStub) + ( + client.descriptors.page.listMetricDescriptors + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listMetricDescriptors, request) ); assert.strictEqual( - (client.descriptors.page.listMetricDescriptors - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMetricDescriptors + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1328,9 +1317,8 @@ describe('v3.MetricServiceClient', () => { generateSampleMessage(new protos.google.api.MetricDescriptor()), generateSampleMessage(new protos.google.api.MetricDescriptor()), ]; - client.descriptors.page.listMetricDescriptors.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listMetricDescriptors.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.api.IMetricDescriptor[] = []; const iterable = client.listMetricDescriptorsAsync(request); for await (const resource of iterable) { @@ -1338,15 +1326,17 @@ describe('v3.MetricServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listMetricDescriptors - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listMetricDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listMetricDescriptors - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMetricDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1363,10 +1353,8 @@ describe('v3.MetricServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listMetricDescriptors.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listMetricDescriptors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listMetricDescriptorsAsync(request); await assert.rejects(async () => { const responses: protos.google.api.IMetricDescriptor[] = []; @@ -1375,15 +1363,17 @@ describe('v3.MetricServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listMetricDescriptors - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listMetricDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listMetricDescriptors - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listMetricDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1446,9 +1436,8 @@ describe('v3.MetricServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.TimeSeries()), generateSampleMessage(new protos.google.monitoring.v3.TimeSeries()), ]; - client.innerApiCalls.listTimeSeries = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listTimeSeries = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listTimeSeries( request, @@ -1520,9 +1509,8 @@ describe('v3.MetricServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.TimeSeries()), generateSampleMessage(new protos.google.monitoring.v3.TimeSeries()), ]; - client.descriptors.page.listTimeSeries.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listTimeSeries.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listTimeSeriesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.TimeSeries[] = []; @@ -1547,10 +1535,9 @@ describe('v3.MetricServiceClient', () => { .calledWith(client.innerApiCalls.listTimeSeries, request) ); assert.strictEqual( - (client.descriptors.page.listTimeSeries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listTimeSeries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1567,10 +1554,8 @@ describe('v3.MetricServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listTimeSeries.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listTimeSeries.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listTimeSeriesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.TimeSeries[] = []; @@ -1594,10 +1579,9 @@ describe('v3.MetricServiceClient', () => { .calledWith(client.innerApiCalls.listTimeSeries, request) ); assert.strictEqual( - (client.descriptors.page.listTimeSeries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listTimeSeries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1618,9 +1602,8 @@ describe('v3.MetricServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.TimeSeries()), generateSampleMessage(new protos.google.monitoring.v3.TimeSeries()), ]; - client.descriptors.page.listTimeSeries.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listTimeSeries.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.ITimeSeries[] = []; const iterable = client.listTimeSeriesAsync(request); for await (const resource of iterable) { @@ -1628,15 +1611,15 @@ describe('v3.MetricServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listTimeSeries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listTimeSeries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1653,10 +1636,8 @@ describe('v3.MetricServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listTimeSeries.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listTimeSeries.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listTimeSeriesAsync(request); await assert.rejects(async () => { const responses: protos.google.monitoring.v3.ITimeSeries[] = []; @@ -1665,15 +1646,15 @@ describe('v3.MetricServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listTimeSeries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listTimeSeries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1705,8 +1686,10 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1716,21 +1699,24 @@ describe('v3.MetricServiceClient', () => { const result = client.matchFolderFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1764,47 +1750,52 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderAlertPolicyConditionName', () => { - const result = client.matchFolderFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchFolderFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromFolderAlertPolicyConditionName', () => { - const result = client.matchConditionFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1836,34 +1827,40 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderChannelDescriptorName', () => { - const result = client.matchFolderFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderChannelDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromFolderChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromFolderChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1944,34 +1941,38 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderMetricDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderMetricDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderMetricDescriptorName', () => { - const result = client.matchFolderFromFolderMetricDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderMetricDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderMetricDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderMetricDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromFolderMetricDescriptorName( - fakePath - ); + const result = + client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); assert.strictEqual(result, 'metricDescriptorValue'); assert( - (client.pathTemplates.folderMetricDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderMetricDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1989,12 +1990,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderMonitoredResourceDescriptorPath', () => { const result = client.folderMonitoredResourceDescriptorPath( @@ -2003,34 +2002,40 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchFolderFromFolderMonitoredResourceDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName( - fakePath - ); + const result = + client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName( + fakePath + ); assert.strictEqual(result, 'monitoredResourceDescriptorValue'); assert( - (client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2062,34 +2067,40 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderNotificationChannelName', () => { - const result = client.matchFolderFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchFolderFromFolderNotificationChannelName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromFolderNotificationChannelName', () => { - const result = client.matchNotificationChannelFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromFolderNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2157,12 +2168,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderServiceServiceLevelObjectivePath', () => { const result = client.folderServiceServiceLevelObjectivePath( @@ -2172,47 +2181,58 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchFolderFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchFolderFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2244,34 +2264,40 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderUptimeCheckConfigName', () => { - const result = client.matchFolderFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchFolderFromFolderUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromFolderUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2303,34 +2329,38 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2349,12 +2379,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAlertPolicyConditionPath', () => { const result = client.organizationAlertPolicyConditionPath( @@ -2364,47 +2392,58 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchConditionFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2422,12 +2461,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationChannelDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationChannelDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationChannelDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationChannelDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationChannelDescriptorPath', () => { const result = client.organizationChannelDescriptorPath( @@ -2436,34 +2473,42 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationChannelDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromOrganizationChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2495,21 +2540,24 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationGroupPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationGroupName', () => { - const result = client.matchOrganizationFromOrganizationGroupName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2519,8 +2567,10 @@ describe('v3.MetricServiceClient', () => { const result = client.matchGroupFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'groupValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2538,12 +2588,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationMetricDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationMetricDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationMetricDescriptorPath', () => { const result = client.organizationMetricDescriptorPath( @@ -2552,34 +2600,42 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationMetricDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationMetricDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationMetricDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMetricDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationMetricDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationMetricDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationMetricDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName( - fakePath - ); + const result = + client.matchMetricDescriptorFromOrganizationMetricDescriptorName( + fakePath + ); assert.strictEqual(result, 'metricDescriptorValue'); assert( - (client.pathTemplates.organizationMetricDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationMetricDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2597,12 +2653,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationMonitoredResourceDescriptorPath', () => { const result = client.organizationMonitoredResourceDescriptorPath( @@ -2611,37 +2665,45 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationMonitoredResourceDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationMonitoredResourceDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationMonitoredResourceDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationMonitoredResourceDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName( - fakePath - ); + const result = + client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName( + fakePath + ); assert.strictEqual(result, 'monitoredResourceDescriptorValue'); assert( - (client.pathTemplates - .organizationMonitoredResourceDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationMonitoredResourceDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2659,12 +2721,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationNotificationChannelPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationNotificationChannelPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationNotificationChannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationChannelPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationNotificationChannelPath', () => { const result = client.organizationNotificationChannelPath( @@ -2673,34 +2733,42 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationNotificationChannelName', () => { - const result = client.matchOrganizationFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromOrganizationNotificationChannelName', () => { - const result = client.matchNotificationChannelFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2732,21 +2800,24 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationServicePathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceName', () => { - const result = client.matchOrganizationFromOrganizationServiceName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2756,8 +2827,10 @@ describe('v3.MetricServiceClient', () => { const result = client.matchServiceFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2777,12 +2850,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationServiceServiceLevelObjectivePath', () => { const result = client.organizationServiceServiceLevelObjectivePath( @@ -2792,51 +2863,62 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2854,12 +2936,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationUptimeCheckConfigPath', () => { const result = client.organizationUptimeCheckConfigPath( @@ -2868,34 +2948,42 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchOrganizationFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2965,8 +3053,10 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -2976,21 +3066,24 @@ describe('v3.MetricServiceClient', () => { const result = client.matchProjectFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3009,9 +3102,8 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.projectAlertPolicyConditionPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -3024,47 +3116,52 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectAlertPolicyConditionName', () => { - const result = client.matchProjectFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchProjectFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromProjectAlertPolicyConditionName', () => { - const result = client.matchConditionFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3096,34 +3193,40 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectChannelDescriptorName', () => { - const result = client.matchProjectFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectChannelDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromProjectChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromProjectChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3204,34 +3307,38 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectMetricDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectMetricDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectMetricDescriptorName', () => { - const result = client.matchProjectFromProjectMetricDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectMetricDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectMetricDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectMetricDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromProjectMetricDescriptorName( - fakePath - ); + const result = + client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); assert.strictEqual(result, 'metricDescriptorValue'); assert( - (client.pathTemplates.projectMetricDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectMetricDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3249,12 +3356,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectMonitoredResourceDescriptorPath', () => { const result = client.projectMonitoredResourceDescriptorPath( @@ -3263,34 +3368,42 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchProjectFromProjectMonitoredResourceDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectMonitoredResourceDescriptorName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName( - fakePath - ); + const result = + client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName( + fakePath + ); assert.strictEqual(result, 'monitoredResourceDescriptorValue'); assert( - (client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3322,34 +3435,40 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectNotificationChannelName', () => { - const result = client.matchProjectFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchProjectFromProjectNotificationChannelName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromProjectNotificationChannelName', () => { - const result = client.matchNotificationChannelFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromProjectNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3420,12 +3539,10 @@ describe('v3.MetricServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectServiceServiceLevelObjectivePath', () => { const result = client.projectServiceServiceLevelObjectivePath( @@ -3435,47 +3552,58 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchProjectFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchProjectFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3507,8 +3635,10 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTimeSeriesPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTimeSeriesPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -3518,21 +3648,24 @@ describe('v3.MetricServiceClient', () => { const result = client.matchProjectFromProjectTimeSeriesName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTimeSeriesPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTimeSeriesPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchTimeSeriesFromProjectTimeSeriesName', () => { - const result = client.matchTimeSeriesFromProjectTimeSeriesName( - fakePath - ); + const result = + client.matchTimeSeriesFromProjectTimeSeriesName(fakePath); assert.strictEqual(result, 'timeSeriesValue'); assert( - (client.pathTemplates.projectTimeSeriesPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTimeSeriesPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3564,34 +3697,40 @@ describe('v3.MetricServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectUptimeCheckConfigName', () => { - const result = client.matchProjectFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchProjectFromProjectUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromProjectUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-monitoring/test/gapic_notification_channel_service_v3.ts b/packages/google-cloud-monitoring/test/gapic_notification_channel_service_v3.ts index d839aa0044c..6a8e7f73d41 100644 --- a/packages/google-cloud-monitoring/test/gapic_notification_channel_service_v3.ts +++ b/packages/google-cloud-monitoring/test/gapic_notification_channel_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; 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; @@ -136,49 +135,46 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('should create a client with no option', () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient(); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.notificationChannelServiceStub, undefined); await client.initialize(); assert(client.notificationChannelServiceStub); }); it('has close method', () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); const result = await client.getProjectId(); assert.strictEqual(result, fakeProjectId); @@ -187,12 +183,11 @@ describe('v3.NotificationChannelServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -211,12 +206,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('getNotificationChannelDescriptor', () => { it('invokes getNotificationChannelDescriptor without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelDescriptorRequest() @@ -233,9 +229,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannelDescriptor() ); - client.innerApiCalls.getNotificationChannelDescriptor = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getNotificationChannelDescriptor = + stubSimpleCall(expectedResponse); const [response] = await client.getNotificationChannelDescriptor(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -246,12 +241,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes getNotificationChannelDescriptor without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelDescriptorRequest() @@ -268,9 +264,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannelDescriptor() ); - client.innerApiCalls.getNotificationChannelDescriptor = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getNotificationChannelDescriptor = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getNotificationChannelDescriptor( request, @@ -296,12 +291,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes getNotificationChannelDescriptor with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelDescriptorRequest() @@ -334,12 +330,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('getNotificationChannel', () => { it('invokes getNotificationChannel without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelRequest() @@ -356,9 +353,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.getNotificationChannel = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getNotificationChannel = + stubSimpleCall(expectedResponse); const [response] = await client.getNotificationChannel(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -369,12 +365,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes getNotificationChannel without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelRequest() @@ -391,9 +388,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.getNotificationChannel = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getNotificationChannel = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getNotificationChannel( request, @@ -419,12 +415,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes getNotificationChannel with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelRequest() @@ -457,12 +454,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('createNotificationChannel', () => { it('invokes createNotificationChannel without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateNotificationChannelRequest() @@ -479,9 +477,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.createNotificationChannel = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.createNotificationChannel = + stubSimpleCall(expectedResponse); const [response] = await client.createNotificationChannel(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -492,12 +489,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes createNotificationChannel without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateNotificationChannelRequest() @@ -514,9 +512,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.createNotificationChannel = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createNotificationChannel = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createNotificationChannel( request, @@ -542,12 +539,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes createNotificationChannel with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateNotificationChannelRequest() @@ -580,12 +578,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('updateNotificationChannel', () => { it('invokes updateNotificationChannel without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateNotificationChannelRequest() @@ -603,9 +602,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.updateNotificationChannel = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateNotificationChannel = + stubSimpleCall(expectedResponse); const [response] = await client.updateNotificationChannel(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -616,12 +614,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes updateNotificationChannel without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateNotificationChannelRequest() @@ -639,9 +638,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.updateNotificationChannel = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateNotificationChannel = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateNotificationChannel( request, @@ -667,12 +665,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes updateNotificationChannel with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateNotificationChannelRequest() @@ -706,12 +705,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('deleteNotificationChannel', () => { it('invokes deleteNotificationChannel without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteNotificationChannelRequest() @@ -728,9 +728,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteNotificationChannel = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteNotificationChannel = + stubSimpleCall(expectedResponse); const [response] = await client.deleteNotificationChannel(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -741,12 +740,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes deleteNotificationChannel without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteNotificationChannelRequest() @@ -763,9 +763,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteNotificationChannel = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteNotificationChannel = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteNotificationChannel( request, @@ -791,12 +790,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes deleteNotificationChannel with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteNotificationChannelRequest() @@ -829,12 +829,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('sendNotificationChannelVerificationCode', () => { it('invokes sendNotificationChannelVerificationCode without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest() @@ -851,28 +852,30 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.sendNotificationChannelVerificationCode = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.sendNotificationChannelVerificationCode = + stubSimpleCall(expectedResponse); const [response] = await client.sendNotificationChannelVerificationCode( request ); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls - .sendNotificationChannelVerificationCode as SinonStub) + ( + client.innerApiCalls + .sendNotificationChannelVerificationCode as SinonStub + ) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); it('invokes sendNotificationChannelVerificationCode without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest() @@ -889,9 +892,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.sendNotificationChannelVerificationCode = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.sendNotificationChannelVerificationCode = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.sendNotificationChannelVerificationCode( request, @@ -910,20 +912,23 @@ describe('v3.NotificationChannelServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls - .sendNotificationChannelVerificationCode as SinonStub) + ( + client.innerApiCalls + .sendNotificationChannelVerificationCode as SinonStub + ) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); it('invokes sendNotificationChannelVerificationCode with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest() @@ -938,17 +943,17 @@ describe('v3.NotificationChannelServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.sendNotificationChannelVerificationCode = stubSimpleCall( - undefined, - expectedError - ); + client.innerApiCalls.sendNotificationChannelVerificationCode = + stubSimpleCall(undefined, expectedError); await assert.rejects( client.sendNotificationChannelVerificationCode(request), expectedError ); assert( - (client.innerApiCalls - .sendNotificationChannelVerificationCode as SinonStub) + ( + client.innerApiCalls + .sendNotificationChannelVerificationCode as SinonStub + ) .getCall(0) .calledWith(request, expectedOptions, undefined) ); @@ -957,12 +962,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('getNotificationChannelVerificationCode', () => { it('invokes getNotificationChannelVerificationCode without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest() @@ -979,28 +985,30 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse() ); - client.innerApiCalls.getNotificationChannelVerificationCode = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getNotificationChannelVerificationCode = + stubSimpleCall(expectedResponse); const [response] = await client.getNotificationChannelVerificationCode( request ); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls - .getNotificationChannelVerificationCode as SinonStub) + ( + client.innerApiCalls + .getNotificationChannelVerificationCode as SinonStub + ) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); it('invokes getNotificationChannelVerificationCode without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest() @@ -1017,9 +1025,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse() ); - client.innerApiCalls.getNotificationChannelVerificationCode = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getNotificationChannelVerificationCode = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getNotificationChannelVerificationCode( request, @@ -1038,20 +1045,23 @@ describe('v3.NotificationChannelServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls - .getNotificationChannelVerificationCode as SinonStub) + ( + client.innerApiCalls + .getNotificationChannelVerificationCode as SinonStub + ) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); it('invokes getNotificationChannelVerificationCode with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest() @@ -1066,17 +1076,17 @@ describe('v3.NotificationChannelServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getNotificationChannelVerificationCode = stubSimpleCall( - undefined, - expectedError - ); + client.innerApiCalls.getNotificationChannelVerificationCode = + stubSimpleCall(undefined, expectedError); await assert.rejects( client.getNotificationChannelVerificationCode(request), expectedError ); assert( - (client.innerApiCalls - .getNotificationChannelVerificationCode as SinonStub) + ( + client.innerApiCalls + .getNotificationChannelVerificationCode as SinonStub + ) .getCall(0) .calledWith(request, expectedOptions, undefined) ); @@ -1085,12 +1095,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('verifyNotificationChannel', () => { it('invokes verifyNotificationChannel without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.VerifyNotificationChannelRequest() @@ -1107,9 +1118,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.verifyNotificationChannel = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.verifyNotificationChannel = + stubSimpleCall(expectedResponse); const [response] = await client.verifyNotificationChannel(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1120,12 +1130,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes verifyNotificationChannel without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.VerifyNotificationChannelRequest() @@ -1142,9 +1153,8 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.NotificationChannel() ); - client.innerApiCalls.verifyNotificationChannel = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.verifyNotificationChannel = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.verifyNotificationChannel( request, @@ -1170,12 +1180,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes verifyNotificationChannel with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.VerifyNotificationChannelRequest() @@ -1208,12 +1219,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('listNotificationChannelDescriptors', () => { it('invokes listNotificationChannelDescriptors without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelDescriptorsRequest() @@ -1238,9 +1250,8 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannelDescriptor() ), ]; - client.innerApiCalls.listNotificationChannelDescriptors = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listNotificationChannelDescriptors = + stubSimpleCall(expectedResponse); const [response] = await client.listNotificationChannelDescriptors( request ); @@ -1253,12 +1264,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes listNotificationChannelDescriptors without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelDescriptorsRequest() @@ -1283,9 +1295,8 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannelDescriptor() ), ]; - client.innerApiCalls.listNotificationChannelDescriptors = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listNotificationChannelDescriptors = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listNotificationChannelDescriptors( request, @@ -1313,12 +1324,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes listNotificationChannelDescriptors with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelDescriptorsRequest() @@ -1349,12 +1361,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes listNotificationChannelDescriptorsStream without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelDescriptorsRequest() @@ -1372,12 +1385,12 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannelDescriptor() ), ]; - client.descriptors.page.listNotificationChannelDescriptors.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listNotificationChannelDescriptors.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listNotificationChannelDescriptorsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.monitoring.v3.NotificationChannelDescriptor[] = []; + const responses: protos.google.monitoring.v3.NotificationChannelDescriptor[] = + []; stream.on( 'data', ( @@ -1396,8 +1409,10 @@ describe('v3.NotificationChannelServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listNotificationChannelDescriptors - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationChannelDescriptors + .createStream as SinonStub + ) .getCall(0) .calledWith( client.innerApiCalls.listNotificationChannelDescriptors, @@ -1405,21 +1420,22 @@ describe('v3.NotificationChannelServiceClient', () => { ) ); assert.strictEqual( - (client.descriptors.page.listNotificationChannelDescriptors - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannelDescriptors + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listNotificationChannelDescriptorsStream with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelDescriptorsRequest() @@ -1427,13 +1443,12 @@ describe('v3.NotificationChannelServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationChannelDescriptors.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationChannelDescriptors.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listNotificationChannelDescriptorsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.monitoring.v3.NotificationChannelDescriptor[] = []; + const responses: protos.google.monitoring.v3.NotificationChannelDescriptor[] = + []; stream.on( 'data', ( @@ -1451,8 +1466,10 @@ describe('v3.NotificationChannelServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listNotificationChannelDescriptors - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationChannelDescriptors + .createStream as SinonStub + ) .getCall(0) .calledWith( client.innerApiCalls.listNotificationChannelDescriptors, @@ -1460,21 +1477,22 @@ describe('v3.NotificationChannelServiceClient', () => { ) ); assert.strictEqual( - (client.descriptors.page.listNotificationChannelDescriptors - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannelDescriptors + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listNotificationChannelDescriptors without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelDescriptorsRequest() @@ -1492,36 +1510,39 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannelDescriptor() ), ]; - client.descriptors.page.listNotificationChannelDescriptors.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.monitoring.v3.INotificationChannelDescriptor[] = []; + client.descriptors.page.listNotificationChannelDescriptors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.monitoring.v3.INotificationChannelDescriptor[] = + []; const iterable = client.listNotificationChannelDescriptorsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listNotificationChannelDescriptors - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationChannelDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationChannelDescriptors - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannelDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listNotificationChannelDescriptors with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelDescriptorsRequest() @@ -1529,27 +1550,28 @@ describe('v3.NotificationChannelServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationChannelDescriptors.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationChannelDescriptors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listNotificationChannelDescriptorsAsync(request); await assert.rejects(async () => { - const responses: protos.google.monitoring.v3.INotificationChannelDescriptor[] = []; + const responses: protos.google.monitoring.v3.INotificationChannelDescriptor[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listNotificationChannelDescriptors - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationChannelDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationChannelDescriptors - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannelDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1557,12 +1579,13 @@ describe('v3.NotificationChannelServiceClient', () => { describe('listNotificationChannels', () => { it('invokes listNotificationChannels without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelsRequest() @@ -1587,9 +1610,8 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannel() ), ]; - client.innerApiCalls.listNotificationChannels = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listNotificationChannels = + stubSimpleCall(expectedResponse); const [response] = await client.listNotificationChannels(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1600,12 +1622,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes listNotificationChannels without error using callback', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelsRequest() @@ -1630,9 +1653,8 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannel() ), ]; - client.innerApiCalls.listNotificationChannels = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listNotificationChannels = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listNotificationChannels( request, @@ -1658,12 +1680,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes listNotificationChannels with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelsRequest() @@ -1694,12 +1717,13 @@ describe('v3.NotificationChannelServiceClient', () => { }); it('invokes listNotificationChannelsStream without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelsRequest() @@ -1717,9 +1741,8 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannel() ), ]; - client.descriptors.page.listNotificationChannels.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listNotificationChannels.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listNotificationChannelsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.NotificationChannel[] = []; @@ -1739,27 +1762,30 @@ describe('v3.NotificationChannelServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listNotificationChannels - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationChannels + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listNotificationChannels, request) ); assert.strictEqual( - (client.descriptors.page.listNotificationChannels - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannels + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listNotificationChannelsStream with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelsRequest() @@ -1767,10 +1793,8 @@ describe('v3.NotificationChannelServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationChannels.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationChannels.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listNotificationChannelsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.NotificationChannel[] = []; @@ -1789,27 +1813,30 @@ describe('v3.NotificationChannelServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listNotificationChannels - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationChannels + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listNotificationChannels, request) ); assert.strictEqual( - (client.descriptors.page.listNotificationChannels - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannels + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listNotificationChannels without error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelsRequest() @@ -1827,9 +1854,8 @@ describe('v3.NotificationChannelServiceClient', () => { new protos.google.monitoring.v3.NotificationChannel() ), ]; - client.descriptors.page.listNotificationChannels.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listNotificationChannels.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.INotificationChannel[] = []; const iterable = client.listNotificationChannelsAsync(request); for await (const resource of iterable) { @@ -1837,26 +1863,29 @@ describe('v3.NotificationChannelServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listNotificationChannels - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationChannels + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationChannels - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannels + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listNotificationChannels with error', async () => { - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListNotificationChannelsRequest() @@ -1864,27 +1893,28 @@ describe('v3.NotificationChannelServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationChannels.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationChannels.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listNotificationChannelsAsync(request); await assert.rejects(async () => { - const responses: protos.google.monitoring.v3.INotificationChannel[] = []; + const responses: protos.google.monitoring.v3.INotificationChannel[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listNotificationChannels - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationChannels + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationChannels - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationChannels + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1897,12 +1927,13 @@ describe('v3.NotificationChannelServiceClient', () => { folder: 'folderValue', alert_policy: 'alertPolicyValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.folderAlertPolicyPathTemplate.render = sinon .stub() @@ -1918,8 +1949,10 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1929,21 +1962,24 @@ describe('v3.NotificationChannelServiceClient', () => { const result = client.matchFolderFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1957,12 +1993,13 @@ describe('v3.NotificationChannelServiceClient', () => { alert_policy: 'alertPolicyValue', condition: 'conditionValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.folderAlertPolicyConditionPathTemplate.render = sinon .stub() @@ -1979,47 +2016,52 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderAlertPolicyConditionName', () => { - const result = client.matchFolderFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchFolderFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromFolderAlertPolicyConditionName', () => { - const result = client.matchConditionFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2032,12 +2074,13 @@ describe('v3.NotificationChannelServiceClient', () => { folder: 'folderValue', channel_descriptor: 'channelDescriptorValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.folderChannelDescriptorPathTemplate.render = sinon .stub() @@ -2053,34 +2096,40 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderChannelDescriptorName', () => { - const result = client.matchFolderFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderChannelDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromFolderChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromFolderChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2093,12 +2142,13 @@ describe('v3.NotificationChannelServiceClient', () => { folder: 'folderValue', group: 'groupValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.folderGroupPathTemplate.render = sinon .stub() @@ -2144,12 +2194,13 @@ describe('v3.NotificationChannelServiceClient', () => { folder: 'folderValue', notification_channel: 'notificationChannelValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.folderNotificationChannelPathTemplate.render = sinon .stub() @@ -2165,34 +2216,40 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderNotificationChannelName', () => { - const result = client.matchFolderFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchFolderFromFolderNotificationChannelName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromFolderNotificationChannelName', () => { - const result = client.matchNotificationChannelFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromFolderNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2205,12 +2262,13 @@ describe('v3.NotificationChannelServiceClient', () => { folder: 'folderValue', service: 'serviceValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.folderServicePathTemplate.render = sinon .stub() @@ -2257,19 +2315,18 @@ describe('v3.NotificationChannelServiceClient', () => { service: 'serviceValue', service_level_objective: 'serviceLevelObjectiveValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderServiceServiceLevelObjectivePath', () => { const result = client.folderServiceServiceLevelObjectivePath( @@ -2279,47 +2336,58 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchFolderFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchFolderFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2332,12 +2400,13 @@ describe('v3.NotificationChannelServiceClient', () => { folder: 'folderValue', uptime_check_config: 'uptimeCheckConfigValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.folderUptimeCheckConfigPathTemplate.render = sinon .stub() @@ -2353,34 +2422,40 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderUptimeCheckConfigName', () => { - const result = client.matchFolderFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchFolderFromFolderUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromFolderUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2393,12 +2468,13 @@ describe('v3.NotificationChannelServiceClient', () => { organization: 'organizationValue', alert_policy: 'alertPolicyValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.organizationAlertPolicyPathTemplate.render = sinon .stub() @@ -2414,34 +2490,38 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2455,19 +2535,18 @@ describe('v3.NotificationChannelServiceClient', () => { alert_policy: 'alertPolicyValue', condition: 'conditionValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAlertPolicyConditionPath', () => { const result = client.organizationAlertPolicyConditionPath( @@ -2477,47 +2556,58 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchConditionFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2530,19 +2620,18 @@ describe('v3.NotificationChannelServiceClient', () => { organization: 'organizationValue', channel_descriptor: 'channelDescriptorValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.organizationChannelDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationChannelDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationChannelDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationChannelDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationChannelDescriptorPath', () => { const result = client.organizationChannelDescriptorPath( @@ -2551,34 +2640,42 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationChannelDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromOrganizationChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2591,12 +2688,13 @@ describe('v3.NotificationChannelServiceClient', () => { organization: 'organizationValue', group: 'groupValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.organizationGroupPathTemplate.render = sinon .stub() @@ -2612,21 +2710,24 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationGroupPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationGroupName', () => { - const result = client.matchOrganizationFromOrganizationGroupName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2636,8 +2737,10 @@ describe('v3.NotificationChannelServiceClient', () => { const result = client.matchGroupFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'groupValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2650,19 +2753,18 @@ describe('v3.NotificationChannelServiceClient', () => { organization: 'organizationValue', notification_channel: 'notificationChannelValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.organizationNotificationChannelPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationNotificationChannelPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationNotificationChannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationChannelPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationNotificationChannelPath', () => { const result = client.organizationNotificationChannelPath( @@ -2671,34 +2773,42 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationNotificationChannelName', () => { - const result = client.matchOrganizationFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromOrganizationNotificationChannelName', () => { - const result = client.matchNotificationChannelFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2711,12 +2821,13 @@ describe('v3.NotificationChannelServiceClient', () => { organization: 'organizationValue', service: 'serviceValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.organizationServicePathTemplate.render = sinon .stub() @@ -2732,21 +2843,24 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationServicePathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceName', () => { - const result = client.matchOrganizationFromOrganizationServiceName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2756,8 +2870,10 @@ describe('v3.NotificationChannelServiceClient', () => { const result = client.matchServiceFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2772,19 +2888,18 @@ describe('v3.NotificationChannelServiceClient', () => { service: 'serviceValue', service_level_objective: 'serviceLevelObjectiveValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationServiceServiceLevelObjectivePath', () => { const result = client.organizationServiceServiceLevelObjectivePath( @@ -2794,51 +2909,62 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2851,19 +2977,18 @@ describe('v3.NotificationChannelServiceClient', () => { organization: 'organizationValue', uptime_check_config: 'uptimeCheckConfigValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationUptimeCheckConfigPath', () => { const result = client.organizationUptimeCheckConfigPath( @@ -2872,34 +2997,42 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchOrganizationFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2911,12 +3044,13 @@ describe('v3.NotificationChannelServiceClient', () => { const expectedParameters = { project: 'projectValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectPathTemplate.render = sinon .stub() @@ -2952,12 +3086,13 @@ describe('v3.NotificationChannelServiceClient', () => { project: 'projectValue', alert_policy: 'alertPolicyValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectAlertPolicyPathTemplate.render = sinon .stub() @@ -2973,8 +3108,10 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -2984,21 +3121,24 @@ describe('v3.NotificationChannelServiceClient', () => { const result = client.matchProjectFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3012,16 +3152,16 @@ describe('v3.NotificationChannelServiceClient', () => { alert_policy: 'alertPolicyValue', condition: 'conditionValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.projectAlertPolicyConditionPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -3034,47 +3174,52 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectAlertPolicyConditionName', () => { - const result = client.matchProjectFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchProjectFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromProjectAlertPolicyConditionName', () => { - const result = client.matchConditionFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3087,12 +3232,13 @@ describe('v3.NotificationChannelServiceClient', () => { project: 'projectValue', channel_descriptor: 'channelDescriptorValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectChannelDescriptorPathTemplate.render = sinon .stub() @@ -3108,34 +3254,40 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectChannelDescriptorName', () => { - const result = client.matchProjectFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectChannelDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromProjectChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromProjectChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3148,12 +3300,13 @@ describe('v3.NotificationChannelServiceClient', () => { project: 'projectValue', group: 'groupValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectGroupPathTemplate.render = sinon .stub() @@ -3199,12 +3352,13 @@ describe('v3.NotificationChannelServiceClient', () => { project: 'projectValue', notification_channel: 'notificationChannelValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectNotificationChannelPathTemplate.render = sinon .stub() @@ -3220,34 +3374,40 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectNotificationChannelName', () => { - const result = client.matchProjectFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchProjectFromProjectNotificationChannelName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromProjectNotificationChannelName', () => { - const result = client.matchNotificationChannelFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromProjectNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3260,12 +3420,13 @@ describe('v3.NotificationChannelServiceClient', () => { project: 'projectValue', service: 'serviceValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectServicePathTemplate.render = sinon .stub() @@ -3315,19 +3476,18 @@ describe('v3.NotificationChannelServiceClient', () => { service: 'serviceValue', service_level_objective: 'serviceLevelObjectiveValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectServiceServiceLevelObjectivePath', () => { const result = client.projectServiceServiceLevelObjectivePath( @@ -3337,47 +3497,58 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchProjectFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchProjectFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3390,12 +3561,13 @@ describe('v3.NotificationChannelServiceClient', () => { project: 'projectValue', uptime_check_config: 'uptimeCheckConfigValue', }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectUptimeCheckConfigPathTemplate.render = sinon .stub() @@ -3411,34 +3583,40 @@ describe('v3.NotificationChannelServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectUptimeCheckConfigName', () => { - const result = client.matchProjectFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchProjectFromProjectUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromProjectUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-monitoring/test/gapic_query_service_v3.ts b/packages/google-cloud-monitoring/test/gapic_query_service_v3.ts index 311fbeb53d6..93db4341d2d 100644 --- a/packages/google-cloud-monitoring/test/gapic_query_service_v3.ts +++ b/packages/google-cloud-monitoring/test/gapic_query_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; 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; @@ -251,9 +250,8 @@ describe('v3.QueryServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.TimeSeriesData()), generateSampleMessage(new protos.google.monitoring.v3.TimeSeriesData()), ]; - client.innerApiCalls.queryTimeSeries = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.queryTimeSeries = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.queryTimeSeries( request, @@ -325,9 +323,8 @@ describe('v3.QueryServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.TimeSeriesData()), generateSampleMessage(new protos.google.monitoring.v3.TimeSeriesData()), ]; - client.descriptors.page.queryTimeSeries.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.queryTimeSeries.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.queryTimeSeriesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.TimeSeriesData[] = []; @@ -352,10 +349,9 @@ describe('v3.QueryServiceClient', () => { .calledWith(client.innerApiCalls.queryTimeSeries, request) ); assert.strictEqual( - (client.descriptors.page.queryTimeSeries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.queryTimeSeries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -372,10 +368,8 @@ describe('v3.QueryServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.queryTimeSeries.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.queryTimeSeries.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.queryTimeSeriesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.TimeSeriesData[] = []; @@ -399,10 +393,9 @@ describe('v3.QueryServiceClient', () => { .calledWith(client.innerApiCalls.queryTimeSeries, request) ); assert.strictEqual( - (client.descriptors.page.queryTimeSeries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.queryTimeSeries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -423,9 +416,8 @@ describe('v3.QueryServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.TimeSeriesData()), generateSampleMessage(new protos.google.monitoring.v3.TimeSeriesData()), ]; - client.descriptors.page.queryTimeSeries.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.queryTimeSeries.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.ITimeSeriesData[] = []; const iterable = client.queryTimeSeriesAsync(request); for await (const resource of iterable) { @@ -433,15 +425,15 @@ describe('v3.QueryServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.queryTimeSeries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.queryTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.queryTimeSeries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.queryTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -458,10 +450,8 @@ describe('v3.QueryServiceClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.queryTimeSeries.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.queryTimeSeries.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.queryTimeSeriesAsync(request); await assert.rejects(async () => { const responses: protos.google.monitoring.v3.ITimeSeriesData[] = []; @@ -470,15 +460,15 @@ describe('v3.QueryServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.queryTimeSeries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.queryTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.queryTimeSeries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.queryTimeSeries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -510,8 +500,10 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -521,21 +513,24 @@ describe('v3.QueryServiceClient', () => { const result = client.matchFolderFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -569,47 +564,52 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderAlertPolicyConditionName', () => { - const result = client.matchFolderFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchFolderFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromFolderAlertPolicyConditionName', () => { - const result = client.matchConditionFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -641,34 +641,40 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderChannelDescriptorName', () => { - const result = client.matchFolderFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderChannelDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromFolderChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromFolderChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -749,34 +755,40 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderNotificationChannelName', () => { - const result = client.matchFolderFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchFolderFromFolderNotificationChannelName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromFolderNotificationChannelName', () => { - const result = client.matchNotificationChannelFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromFolderNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -844,12 +856,10 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderServiceServiceLevelObjectivePath', () => { const result = client.folderServiceServiceLevelObjectivePath( @@ -859,47 +869,58 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchFolderFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchFolderFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -931,34 +952,40 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderUptimeCheckConfigName', () => { - const result = client.matchFolderFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchFolderFromFolderUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromFolderUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -990,34 +1017,38 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1036,12 +1067,10 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAlertPolicyConditionPath', () => { const result = client.organizationAlertPolicyConditionPath( @@ -1051,47 +1080,58 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchConditionFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1109,12 +1149,10 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationChannelDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationChannelDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationChannelDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationChannelDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationChannelDescriptorPath', () => { const result = client.organizationChannelDescriptorPath( @@ -1123,34 +1161,42 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationChannelDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromOrganizationChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1182,21 +1228,24 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationGroupPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationGroupName', () => { - const result = client.matchOrganizationFromOrganizationGroupName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1206,8 +1255,10 @@ describe('v3.QueryServiceClient', () => { const result = client.matchGroupFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'groupValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1225,12 +1276,10 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationNotificationChannelPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationNotificationChannelPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationNotificationChannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationChannelPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationNotificationChannelPath', () => { const result = client.organizationNotificationChannelPath( @@ -1239,34 +1288,42 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationNotificationChannelName', () => { - const result = client.matchOrganizationFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromOrganizationNotificationChannelName', () => { - const result = client.matchNotificationChannelFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1298,21 +1355,24 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationServicePathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceName', () => { - const result = client.matchOrganizationFromOrganizationServiceName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1322,8 +1382,10 @@ describe('v3.QueryServiceClient', () => { const result = client.matchServiceFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1343,12 +1405,10 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationServiceServiceLevelObjectivePath', () => { const result = client.organizationServiceServiceLevelObjectivePath( @@ -1358,51 +1418,62 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1420,12 +1491,10 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationUptimeCheckConfigPath', () => { const result = client.organizationUptimeCheckConfigPath( @@ -1434,34 +1503,42 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchOrganizationFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1493,8 +1570,10 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1504,21 +1583,24 @@ describe('v3.QueryServiceClient', () => { const result = client.matchProjectFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1537,9 +1619,8 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.projectAlertPolicyConditionPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -1552,47 +1633,52 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectAlertPolicyConditionName', () => { - const result = client.matchProjectFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchProjectFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromProjectAlertPolicyConditionName', () => { - const result = client.matchConditionFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1624,34 +1710,40 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectChannelDescriptorName', () => { - const result = client.matchProjectFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectChannelDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromProjectChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromProjectChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1732,34 +1824,40 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectNotificationChannelName', () => { - const result = client.matchProjectFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchProjectFromProjectNotificationChannelName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromProjectNotificationChannelName', () => { - const result = client.matchNotificationChannelFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromProjectNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1830,12 +1928,10 @@ describe('v3.QueryServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectServiceServiceLevelObjectivePath', () => { const result = client.projectServiceServiceLevelObjectivePath( @@ -1845,47 +1941,58 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchProjectFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchProjectFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1917,34 +2024,40 @@ describe('v3.QueryServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectUptimeCheckConfigName', () => { - const result = client.matchProjectFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchProjectFromProjectUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromProjectUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-monitoring/test/gapic_service_monitoring_service_v3.ts b/packages/google-cloud-monitoring/test/gapic_service_monitoring_service_v3.ts index 9e4c30e609a..7d99c191a16 100644 --- a/packages/google-cloud-monitoring/test/gapic_service_monitoring_service_v3.ts +++ b/packages/google-cloud-monitoring/test/gapic_service_monitoring_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; 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; @@ -136,49 +135,46 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('should create a client with no option', () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient(); + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.serviceMonitoringServiceStub, undefined); await client.initialize(); assert(client.serviceMonitoringServiceStub); }); it('has close method', () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); const result = await client.getProjectId(); assert.strictEqual(result, fakeProjectId); @@ -187,12 +183,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -211,12 +206,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('createService', () => { it('invokes createService without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateServiceRequest() @@ -244,12 +238,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes createService without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateServiceRequest() @@ -266,9 +259,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.Service() ); - client.innerApiCalls.createService = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createService = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createService( request, @@ -294,12 +286,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes createService with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateServiceRequest() @@ -329,12 +320,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('getService', () => { it('invokes getService without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetServiceRequest() @@ -362,12 +352,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes getService without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetServiceRequest() @@ -384,9 +373,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.Service() ); - client.innerApiCalls.getService = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getService = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getService( request, @@ -412,12 +400,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes getService with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetServiceRequest() @@ -447,12 +434,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('updateService', () => { it('invokes updateService without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateServiceRequest() @@ -481,12 +467,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes updateService without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateServiceRequest() @@ -504,9 +489,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.Service() ); - client.innerApiCalls.updateService = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateService = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateService( request, @@ -532,12 +516,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes updateService with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateServiceRequest() @@ -568,12 +551,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('deleteService', () => { it('invokes deleteService without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteServiceRequest() @@ -601,12 +583,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes deleteService without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteServiceRequest() @@ -623,9 +604,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteService = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteService = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteService( request, @@ -651,12 +631,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes deleteService with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteServiceRequest() @@ -686,12 +665,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('createServiceLevelObjective', () => { it('invokes createServiceLevelObjective without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateServiceLevelObjectiveRequest() @@ -708,9 +686,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.ServiceLevelObjective() ); - client.innerApiCalls.createServiceLevelObjective = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.createServiceLevelObjective = + stubSimpleCall(expectedResponse); const [response] = await client.createServiceLevelObjective(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -721,12 +698,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes createServiceLevelObjective without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateServiceLevelObjectiveRequest() @@ -743,9 +719,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.ServiceLevelObjective() ); - client.innerApiCalls.createServiceLevelObjective = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createServiceLevelObjective = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createServiceLevelObjective( request, @@ -771,12 +746,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes createServiceLevelObjective with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.CreateServiceLevelObjectiveRequest() @@ -809,12 +783,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('getServiceLevelObjective', () => { it('invokes getServiceLevelObjective without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetServiceLevelObjectiveRequest() @@ -831,9 +804,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.ServiceLevelObjective() ); - client.innerApiCalls.getServiceLevelObjective = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getServiceLevelObjective = + stubSimpleCall(expectedResponse); const [response] = await client.getServiceLevelObjective(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -844,12 +816,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes getServiceLevelObjective without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetServiceLevelObjectiveRequest() @@ -866,9 +837,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.ServiceLevelObjective() ); - client.innerApiCalls.getServiceLevelObjective = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getServiceLevelObjective = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getServiceLevelObjective( request, @@ -894,12 +864,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes getServiceLevelObjective with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.GetServiceLevelObjectiveRequest() @@ -932,12 +901,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('updateServiceLevelObjective', () => { it('invokes updateServiceLevelObjective without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateServiceLevelObjectiveRequest() @@ -955,9 +923,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.ServiceLevelObjective() ); - client.innerApiCalls.updateServiceLevelObjective = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateServiceLevelObjective = + stubSimpleCall(expectedResponse); const [response] = await client.updateServiceLevelObjective(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -968,12 +935,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes updateServiceLevelObjective without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateServiceLevelObjectiveRequest() @@ -991,9 +957,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.ServiceLevelObjective() ); - client.innerApiCalls.updateServiceLevelObjective = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateServiceLevelObjective = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateServiceLevelObjective( request, @@ -1019,12 +984,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes updateServiceLevelObjective with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.UpdateServiceLevelObjectiveRequest() @@ -1058,12 +1022,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('deleteServiceLevelObjective', () => { it('invokes deleteServiceLevelObjective without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteServiceLevelObjectiveRequest() @@ -1080,9 +1043,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteServiceLevelObjective = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteServiceLevelObjective = + stubSimpleCall(expectedResponse); const [response] = await client.deleteServiceLevelObjective(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1093,12 +1055,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes deleteServiceLevelObjective without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteServiceLevelObjectiveRequest() @@ -1115,9 +1076,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteServiceLevelObjective = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteServiceLevelObjective = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteServiceLevelObjective( request, @@ -1143,12 +1103,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes deleteServiceLevelObjective with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.DeleteServiceLevelObjectiveRequest() @@ -1181,12 +1140,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('listServices', () => { it('invokes listServices without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServicesRequest() @@ -1216,12 +1174,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes listServices without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServicesRequest() @@ -1240,9 +1197,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.Service()), generateSampleMessage(new protos.google.monitoring.v3.Service()), ]; - client.innerApiCalls.listServices = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listServices = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listServices( request, @@ -1268,12 +1224,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes listServices with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServicesRequest() @@ -1301,12 +1256,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes listServicesStream without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServicesRequest() @@ -1318,9 +1272,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.Service()), generateSampleMessage(new protos.google.monitoring.v3.Service()), ]; - client.descriptors.page.listServices.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listServices.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listServicesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.Service[] = []; @@ -1342,21 +1295,19 @@ describe('v3.ServiceMonitoringServiceClient', () => { .calledWith(client.innerApiCalls.listServices, request) ); assert.strictEqual( - (client.descriptors.page.listServices - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServices.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listServicesStream with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServicesRequest() @@ -1388,21 +1339,19 @@ describe('v3.ServiceMonitoringServiceClient', () => { .calledWith(client.innerApiCalls.listServices, request) ); assert.strictEqual( - (client.descriptors.page.listServices - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServices.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listServices without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServicesRequest() @@ -1414,9 +1363,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.Service()), generateSampleMessage(new protos.google.monitoring.v3.Service()), ]; - client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listServices.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.IService[] = []; const iterable = client.listServicesAsync(request); for await (const resource of iterable) { @@ -1424,26 +1372,25 @@ describe('v3.ServiceMonitoringServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listServices - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listServices.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listServices - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServices.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listServices with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServicesRequest() @@ -1451,10 +1398,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listServices.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listServicesAsync(request); await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IService[] = []; @@ -1463,15 +1408,15 @@ describe('v3.ServiceMonitoringServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listServices - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listServices.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listServices - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServices.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1479,12 +1424,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { describe('listServiceLevelObjectives', () => { it('invokes listServiceLevelObjectives without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServiceLevelObjectivesRequest() @@ -1509,9 +1453,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { new protos.google.monitoring.v3.ServiceLevelObjective() ), ]; - client.innerApiCalls.listServiceLevelObjectives = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listServiceLevelObjectives = + stubSimpleCall(expectedResponse); const [response] = await client.listServiceLevelObjectives(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1522,12 +1465,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes listServiceLevelObjectives without error using callback', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServiceLevelObjectivesRequest() @@ -1552,9 +1494,8 @@ describe('v3.ServiceMonitoringServiceClient', () => { new protos.google.monitoring.v3.ServiceLevelObjective() ), ]; - client.innerApiCalls.listServiceLevelObjectives = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listServiceLevelObjectives = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listServiceLevelObjectives( request, @@ -1580,12 +1521,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes listServiceLevelObjectives with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServiceLevelObjectivesRequest() @@ -1616,12 +1556,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); it('invokes listServiceLevelObjectivesStream without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServiceLevelObjectivesRequest() @@ -1639,12 +1578,12 @@ describe('v3.ServiceMonitoringServiceClient', () => { new protos.google.monitoring.v3.ServiceLevelObjective() ), ]; - client.descriptors.page.listServiceLevelObjectives.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listServiceLevelObjectives.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listServiceLevelObjectivesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.monitoring.v3.ServiceLevelObjective[] = []; + const responses: protos.google.monitoring.v3.ServiceLevelObjective[] = + []; stream.on( 'data', (response: protos.google.monitoring.v3.ServiceLevelObjective) => { @@ -1661,27 +1600,28 @@ describe('v3.ServiceMonitoringServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listServiceLevelObjectives - .createStream as SinonStub) + ( + client.descriptors.page.listServiceLevelObjectives + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listServiceLevelObjectives, request) ); assert.strictEqual( - (client.descriptors.page.listServiceLevelObjectives - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServiceLevelObjectives + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listServiceLevelObjectivesStream with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServiceLevelObjectivesRequest() @@ -1689,13 +1629,12 @@ describe('v3.ServiceMonitoringServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listServiceLevelObjectives.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listServiceLevelObjectives.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listServiceLevelObjectivesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.monitoring.v3.ServiceLevelObjective[] = []; + const responses: protos.google.monitoring.v3.ServiceLevelObjective[] = + []; stream.on( 'data', (response: protos.google.monitoring.v3.ServiceLevelObjective) => { @@ -1711,27 +1650,28 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listServiceLevelObjectives - .createStream as SinonStub) + ( + client.descriptors.page.listServiceLevelObjectives + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listServiceLevelObjectives, request) ); assert.strictEqual( - (client.descriptors.page.listServiceLevelObjectives - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServiceLevelObjectives + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listServiceLevelObjectives without error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServiceLevelObjectivesRequest() @@ -1749,36 +1689,37 @@ describe('v3.ServiceMonitoringServiceClient', () => { new protos.google.monitoring.v3.ServiceLevelObjective() ), ]; - client.descriptors.page.listServiceLevelObjectives.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.monitoring.v3.IServiceLevelObjective[] = []; + client.descriptors.page.listServiceLevelObjectives.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.monitoring.v3.IServiceLevelObjective[] = + []; const iterable = client.listServiceLevelObjectivesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listServiceLevelObjectives - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listServiceLevelObjectives + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listServiceLevelObjectives - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServiceLevelObjectives + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listServiceLevelObjectives with error', async () => { - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.monitoring.v3.ListServiceLevelObjectivesRequest() @@ -1786,27 +1727,28 @@ describe('v3.ServiceMonitoringServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listServiceLevelObjectives.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listServiceLevelObjectives.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listServiceLevelObjectivesAsync(request); await assert.rejects(async () => { - const responses: protos.google.monitoring.v3.IServiceLevelObjective[] = []; + const responses: protos.google.monitoring.v3.IServiceLevelObjective[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listServiceLevelObjectives - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listServiceLevelObjectives + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listServiceLevelObjectives - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listServiceLevelObjectives + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1819,12 +1761,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { folder: 'folderValue', alert_policy: 'alertPolicyValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.folderAlertPolicyPathTemplate.render = sinon .stub() @@ -1840,8 +1781,10 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1851,21 +1794,24 @@ describe('v3.ServiceMonitoringServiceClient', () => { const result = client.matchFolderFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1879,12 +1825,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { alert_policy: 'alertPolicyValue', condition: 'conditionValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.folderAlertPolicyConditionPathTemplate.render = sinon .stub() @@ -1901,47 +1846,52 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderAlertPolicyConditionName', () => { - const result = client.matchFolderFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchFolderFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromFolderAlertPolicyConditionName', () => { - const result = client.matchConditionFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1954,12 +1904,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { folder: 'folderValue', channel_descriptor: 'channelDescriptorValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.folderChannelDescriptorPathTemplate.render = sinon .stub() @@ -1975,34 +1924,40 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderChannelDescriptorName', () => { - const result = client.matchFolderFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderChannelDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromFolderChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromFolderChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2015,12 +1970,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { folder: 'folderValue', group: 'groupValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.folderGroupPathTemplate.render = sinon .stub() @@ -2066,12 +2020,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { folder: 'folderValue', notification_channel: 'notificationChannelValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.folderNotificationChannelPathTemplate.render = sinon .stub() @@ -2087,34 +2040,40 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderNotificationChannelName', () => { - const result = client.matchFolderFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchFolderFromFolderNotificationChannelName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromFolderNotificationChannelName', () => { - const result = client.matchNotificationChannelFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromFolderNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2127,12 +2086,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { folder: 'folderValue', service: 'serviceValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.folderServicePathTemplate.render = sinon .stub() @@ -2179,19 +2137,16 @@ describe('v3.ServiceMonitoringServiceClient', () => { service: 'serviceValue', service_level_objective: 'serviceLevelObjectiveValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderServiceServiceLevelObjectivePath', () => { const result = client.folderServiceServiceLevelObjectivePath( @@ -2201,47 +2156,58 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchFolderFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchFolderFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2254,12 +2220,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { folder: 'folderValue', uptime_check_config: 'uptimeCheckConfigValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.folderUptimeCheckConfigPathTemplate.render = sinon .stub() @@ -2275,34 +2240,40 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderUptimeCheckConfigName', () => { - const result = client.matchFolderFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchFolderFromFolderUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromFolderUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2315,12 +2286,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { organization: 'organizationValue', alert_policy: 'alertPolicyValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.organizationAlertPolicyPathTemplate.render = sinon .stub() @@ -2336,34 +2306,38 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2377,19 +2351,16 @@ describe('v3.ServiceMonitoringServiceClient', () => { alert_policy: 'alertPolicyValue', condition: 'conditionValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAlertPolicyConditionPath', () => { const result = client.organizationAlertPolicyConditionPath( @@ -2399,47 +2370,58 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchConditionFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2452,19 +2434,16 @@ describe('v3.ServiceMonitoringServiceClient', () => { organization: 'organizationValue', channel_descriptor: 'channelDescriptorValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.organizationChannelDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationChannelDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationChannelDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationChannelDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationChannelDescriptorPath', () => { const result = client.organizationChannelDescriptorPath( @@ -2473,34 +2452,42 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationChannelDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromOrganizationChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2513,12 +2500,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { organization: 'organizationValue', group: 'groupValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.organizationGroupPathTemplate.render = sinon .stub() @@ -2534,21 +2520,24 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationGroupPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationGroupName', () => { - const result = client.matchOrganizationFromOrganizationGroupName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2558,8 +2547,10 @@ describe('v3.ServiceMonitoringServiceClient', () => { const result = client.matchGroupFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'groupValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2572,19 +2563,16 @@ describe('v3.ServiceMonitoringServiceClient', () => { organization: 'organizationValue', notification_channel: 'notificationChannelValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.organizationNotificationChannelPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationNotificationChannelPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationNotificationChannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationChannelPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationNotificationChannelPath', () => { const result = client.organizationNotificationChannelPath( @@ -2593,34 +2581,42 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationNotificationChannelName', () => { - const result = client.matchOrganizationFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromOrganizationNotificationChannelName', () => { - const result = client.matchNotificationChannelFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2633,12 +2629,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { organization: 'organizationValue', service: 'serviceValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.organizationServicePathTemplate.render = sinon .stub() @@ -2654,21 +2649,24 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationServicePathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceName', () => { - const result = client.matchOrganizationFromOrganizationServiceName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2678,8 +2676,10 @@ describe('v3.ServiceMonitoringServiceClient', () => { const result = client.matchServiceFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2694,19 +2694,16 @@ describe('v3.ServiceMonitoringServiceClient', () => { service: 'serviceValue', service_level_objective: 'serviceLevelObjectiveValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationServiceServiceLevelObjectivePath', () => { const result = client.organizationServiceServiceLevelObjectivePath( @@ -2716,51 +2713,62 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2773,19 +2781,16 @@ describe('v3.ServiceMonitoringServiceClient', () => { organization: 'organizationValue', uptime_check_config: 'uptimeCheckConfigValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationUptimeCheckConfigPath', () => { const result = client.organizationUptimeCheckConfigPath( @@ -2794,34 +2799,42 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchOrganizationFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2833,12 +2846,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { const expectedParameters = { project: 'projectValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectPathTemplate.render = sinon .stub() @@ -2874,12 +2886,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { project: 'projectValue', alert_policy: 'alertPolicyValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectAlertPolicyPathTemplate.render = sinon .stub() @@ -2895,8 +2906,10 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -2906,21 +2919,24 @@ describe('v3.ServiceMonitoringServiceClient', () => { const result = client.matchProjectFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2934,16 +2950,14 @@ describe('v3.ServiceMonitoringServiceClient', () => { alert_policy: 'alertPolicyValue', condition: 'conditionValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.projectAlertPolicyConditionPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -2956,47 +2970,52 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectAlertPolicyConditionName', () => { - const result = client.matchProjectFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchProjectFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromProjectAlertPolicyConditionName', () => { - const result = client.matchConditionFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3009,12 +3028,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { project: 'projectValue', channel_descriptor: 'channelDescriptorValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectChannelDescriptorPathTemplate.render = sinon .stub() @@ -3030,34 +3048,40 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectChannelDescriptorName', () => { - const result = client.matchProjectFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectChannelDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromProjectChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromProjectChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3070,12 +3094,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { project: 'projectValue', group: 'groupValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectGroupPathTemplate.render = sinon .stub() @@ -3121,12 +3144,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { project: 'projectValue', notification_channel: 'notificationChannelValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectNotificationChannelPathTemplate.render = sinon .stub() @@ -3142,34 +3164,40 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectNotificationChannelName', () => { - const result = client.matchProjectFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchProjectFromProjectNotificationChannelName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromProjectNotificationChannelName', () => { - const result = client.matchNotificationChannelFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromProjectNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3182,12 +3210,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { project: 'projectValue', service: 'serviceValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectServicePathTemplate.render = sinon .stub() @@ -3237,19 +3264,16 @@ describe('v3.ServiceMonitoringServiceClient', () => { service: 'serviceValue', service_level_objective: 'serviceLevelObjectiveValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectServiceServiceLevelObjectivePath', () => { const result = client.projectServiceServiceLevelObjectivePath( @@ -3259,47 +3283,58 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchProjectFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchProjectFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3312,12 +3347,11 @@ describe('v3.ServiceMonitoringServiceClient', () => { project: 'projectValue', uptime_check_config: 'uptimeCheckConfigValue', }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( - { + const client = + new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectUptimeCheckConfigPathTemplate.render = sinon .stub() @@ -3333,34 +3367,40 @@ describe('v3.ServiceMonitoringServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectUptimeCheckConfigName', () => { - const result = client.matchProjectFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchProjectFromProjectUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromProjectUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-monitoring/test/gapic_uptime_check_service_v3.ts b/packages/google-cloud-monitoring/test/gapic_uptime_check_service_v3.ts index a21314d22e9..3c0de536ba0 100644 --- a/packages/google-cloud-monitoring/test/gapic_uptime_check_service_v3.ts +++ b/packages/google-cloud-monitoring/test/gapic_uptime_check_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; 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; @@ -218,9 +217,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.UptimeCheckConfig() ); - client.innerApiCalls.getUptimeCheckConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getUptimeCheckConfig = + stubSimpleCall(expectedResponse); const [response] = await client.getUptimeCheckConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -251,9 +249,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.UptimeCheckConfig() ); - client.innerApiCalls.getUptimeCheckConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getUptimeCheckConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getUptimeCheckConfig( request, @@ -332,9 +329,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.UptimeCheckConfig() ); - client.innerApiCalls.createUptimeCheckConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.createUptimeCheckConfig = + stubSimpleCall(expectedResponse); const [response] = await client.createUptimeCheckConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -365,9 +361,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.UptimeCheckConfig() ); - client.innerApiCalls.createUptimeCheckConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createUptimeCheckConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createUptimeCheckConfig( request, @@ -450,9 +445,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.UptimeCheckConfig() ); - client.innerApiCalls.updateUptimeCheckConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateUptimeCheckConfig = + stubSimpleCall(expectedResponse); const [response] = await client.updateUptimeCheckConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -484,9 +478,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.monitoring.v3.UptimeCheckConfig() ); - client.innerApiCalls.updateUptimeCheckConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateUptimeCheckConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateUptimeCheckConfig( request, @@ -569,9 +562,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteUptimeCheckConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteUptimeCheckConfig = + stubSimpleCall(expectedResponse); const [response] = await client.deleteUptimeCheckConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -602,9 +594,8 @@ describe('v3.UptimeCheckServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteUptimeCheckConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteUptimeCheckConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteUptimeCheckConfig( request, @@ -694,9 +685,8 @@ describe('v3.UptimeCheckServiceClient', () => { new protos.google.monitoring.v3.UptimeCheckConfig() ), ]; - client.innerApiCalls.listUptimeCheckConfigs = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listUptimeCheckConfigs = + stubSimpleCall(expectedResponse); const [response] = await client.listUptimeCheckConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -735,9 +725,8 @@ describe('v3.UptimeCheckServiceClient', () => { new protos.google.monitoring.v3.UptimeCheckConfig() ), ]; - client.innerApiCalls.listUptimeCheckConfigs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listUptimeCheckConfigs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listUptimeCheckConfigs( request, @@ -818,9 +807,8 @@ describe('v3.UptimeCheckServiceClient', () => { new protos.google.monitoring.v3.UptimeCheckConfig() ), ]; - client.descriptors.page.listUptimeCheckConfigs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listUptimeCheckConfigs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listUptimeCheckConfigsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.UptimeCheckConfig[] = []; @@ -840,16 +828,18 @@ describe('v3.UptimeCheckServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listUptimeCheckConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listUptimeCheckConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listUptimeCheckConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listUptimeCheckConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUptimeCheckConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -866,10 +856,8 @@ describe('v3.UptimeCheckServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listUptimeCheckConfigs.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listUptimeCheckConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listUptimeCheckConfigsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.UptimeCheckConfig[] = []; @@ -888,16 +876,18 @@ describe('v3.UptimeCheckServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listUptimeCheckConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listUptimeCheckConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listUptimeCheckConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listUptimeCheckConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUptimeCheckConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -924,9 +914,8 @@ describe('v3.UptimeCheckServiceClient', () => { new protos.google.monitoring.v3.UptimeCheckConfig() ), ]; - client.descriptors.page.listUptimeCheckConfigs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listUptimeCheckConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.IUptimeCheckConfig[] = []; const iterable = client.listUptimeCheckConfigsAsync(request); for await (const resource of iterable) { @@ -934,15 +923,17 @@ describe('v3.UptimeCheckServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listUptimeCheckConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listUptimeCheckConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listUptimeCheckConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUptimeCheckConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -959,10 +950,8 @@ describe('v3.UptimeCheckServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listUptimeCheckConfigs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listUptimeCheckConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listUptimeCheckConfigsAsync(request); await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IUptimeCheckConfig[] = []; @@ -971,15 +960,17 @@ describe('v3.UptimeCheckServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listUptimeCheckConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listUptimeCheckConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listUptimeCheckConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listUptimeCheckConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1001,9 +992,8 @@ describe('v3.UptimeCheckServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), ]; - client.innerApiCalls.listUptimeCheckIps = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listUptimeCheckIps = + stubSimpleCall(expectedResponse); const [response] = await client.listUptimeCheckIps(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1028,9 +1018,8 @@ describe('v3.UptimeCheckServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), ]; - client.innerApiCalls.listUptimeCheckIps = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listUptimeCheckIps = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listUptimeCheckIps( request, @@ -1092,9 +1081,8 @@ describe('v3.UptimeCheckServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), ]; - client.descriptors.page.listUptimeCheckIps.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listUptimeCheckIps.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listUptimeCheckIpsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.UptimeCheckIp[] = []; @@ -1130,10 +1118,8 @@ describe('v3.UptimeCheckServiceClient', () => { new protos.google.monitoring.v3.ListUptimeCheckIpsRequest() ); const expectedError = new Error('expected'); - client.descriptors.page.listUptimeCheckIps.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listUptimeCheckIps.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listUptimeCheckIpsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.monitoring.v3.UptimeCheckIp[] = []; @@ -1172,9 +1158,8 @@ describe('v3.UptimeCheckServiceClient', () => { generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), generateSampleMessage(new protos.google.monitoring.v3.UptimeCheckIp()), ]; - client.descriptors.page.listUptimeCheckIps.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listUptimeCheckIps.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.monitoring.v3.IUptimeCheckIp[] = []; const iterable = client.listUptimeCheckIpsAsync(request); for await (const resource of iterable) { @@ -1182,8 +1167,9 @@ describe('v3.UptimeCheckServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listUptimeCheckIps - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listUptimeCheckIps.asyncIterate as SinonStub + ).getCall(0).args[1], request ); }); @@ -1198,10 +1184,8 @@ describe('v3.UptimeCheckServiceClient', () => { new protos.google.monitoring.v3.ListUptimeCheckIpsRequest() ); const expectedError = new Error('expected'); - client.descriptors.page.listUptimeCheckIps.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listUptimeCheckIps.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listUptimeCheckIpsAsync(request); await assert.rejects(async () => { const responses: protos.google.monitoring.v3.IUptimeCheckIp[] = []; @@ -1210,8 +1194,9 @@ describe('v3.UptimeCheckServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listUptimeCheckIps - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listUptimeCheckIps.asyncIterate as SinonStub + ).getCall(0).args[1], request ); }); @@ -1243,8 +1228,10 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1254,21 +1241,24 @@ describe('v3.UptimeCheckServiceClient', () => { const result = client.matchFolderFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1302,47 +1292,52 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderAlertPolicyConditionName', () => { - const result = client.matchFolderFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchFolderFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromFolderAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromFolderAlertPolicyConditionName', () => { - const result = client.matchConditionFromFolderAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromFolderAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.folderAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1374,34 +1369,40 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderChannelDescriptorName', () => { - const result = client.matchFolderFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchFolderFromFolderChannelDescriptorName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromFolderChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromFolderChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromFolderChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.folderChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1482,34 +1483,40 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderNotificationChannelName', () => { - const result = client.matchFolderFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchFolderFromFolderNotificationChannelName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromFolderNotificationChannelName', () => { - const result = client.matchNotificationChannelFromFolderNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromFolderNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.folderNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1577,12 +1584,10 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('folderServiceServiceLevelObjectivePath', () => { const result = client.folderServiceServiceLevelObjectivePath( @@ -1592,47 +1597,58 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchFolderFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchFolderFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1664,34 +1680,40 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchFolderFromFolderUptimeCheckConfigName', () => { - const result = client.matchFolderFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchFolderFromFolderUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromFolderUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.folderUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.folderUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1723,34 +1745,38 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1769,12 +1795,10 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAlertPolicyConditionPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAlertPolicyConditionPath', () => { const result = client.organizationAlertPolicyConditionPath( @@ -1784,47 +1808,58 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchOrganizationFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromOrganizationAlertPolicyConditionName', () => { - const result = client.matchConditionFromOrganizationAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromOrganizationAlertPolicyConditionName( + fakePath + ); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.organizationAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1842,12 +1877,10 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationChannelDescriptorPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationChannelDescriptorPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationChannelDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationChannelDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationChannelDescriptorPath', () => { const result = client.organizationChannelDescriptorPath( @@ -1856,34 +1889,42 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationChannelDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromOrganizationChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromOrganizationChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromOrganizationChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.organizationChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1915,21 +1956,24 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationGroupPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationGroupName', () => { - const result = client.matchOrganizationFromOrganizationGroupName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1939,8 +1983,10 @@ describe('v3.UptimeCheckServiceClient', () => { const result = client.matchGroupFromOrganizationGroupName(fakePath); assert.strictEqual(result, 'groupValue'); assert( - (client.pathTemplates.organizationGroupPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationGroupPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1958,12 +2004,10 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationNotificationChannelPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationNotificationChannelPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationNotificationChannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationChannelPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationNotificationChannelPath', () => { const result = client.organizationNotificationChannelPath( @@ -1972,34 +2016,42 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationNotificationChannelName', () => { - const result = client.matchOrganizationFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromOrganizationNotificationChannelName', () => { - const result = client.matchNotificationChannelFromOrganizationNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromOrganizationNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.organizationNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2031,21 +2083,24 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationServicePathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceName', () => { - const result = client.matchOrganizationFromOrganizationServiceName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2055,8 +2110,10 @@ describe('v3.UptimeCheckServiceClient', () => { const result = client.matchServiceFromOrganizationServiceName(fakePath); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.organizationServicePathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2076,12 +2133,10 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationServiceServiceLevelObjectivePath', () => { const result = client.organizationServiceServiceLevelObjectivePath( @@ -2091,51 +2146,62 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates - .organizationServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2153,12 +2219,10 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationUptimeCheckConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationUptimeCheckConfigPath', () => { const result = client.organizationUptimeCheckConfigPath( @@ -2167,34 +2231,42 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchOrganizationFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.organizationUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2264,8 +2336,10 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -2275,21 +2349,24 @@ describe('v3.UptimeCheckServiceClient', () => { const result = client.matchProjectFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2308,9 +2385,8 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.projectAlertPolicyConditionPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.projectAlertPolicyConditionPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -2323,47 +2399,52 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectAlertPolicyConditionName', () => { - const result = client.matchProjectFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchProjectFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAlertPolicyFromProjectAlertPolicyConditionName', () => { - const result = client.matchAlertPolicyFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchAlertPolicyFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'alertPolicyValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchConditionFromProjectAlertPolicyConditionName', () => { - const result = client.matchConditionFromProjectAlertPolicyConditionName( - fakePath - ); + const result = + client.matchConditionFromProjectAlertPolicyConditionName(fakePath); assert.strictEqual(result, 'conditionValue'); assert( - (client.pathTemplates.projectAlertPolicyConditionPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectAlertPolicyConditionPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2395,34 +2476,40 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectChannelDescriptorName', () => { - const result = client.matchProjectFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchProjectFromProjectChannelDescriptorName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchChannelDescriptorFromProjectChannelDescriptorName', () => { - const result = client.matchChannelDescriptorFromProjectChannelDescriptorName( - fakePath - ); + const result = + client.matchChannelDescriptorFromProjectChannelDescriptorName( + fakePath + ); assert.strictEqual(result, 'channelDescriptorValue'); assert( - (client.pathTemplates.projectChannelDescriptorPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectChannelDescriptorPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2503,34 +2590,40 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectNotificationChannelName', () => { - const result = client.matchProjectFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchProjectFromProjectNotificationChannelName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationChannelFromProjectNotificationChannelName', () => { - const result = client.matchNotificationChannelFromProjectNotificationChannelName( - fakePath - ); + const result = + client.matchNotificationChannelFromProjectNotificationChannelName( + fakePath + ); assert.strictEqual(result, 'notificationChannelValue'); assert( - (client.pathTemplates.projectNotificationChannelPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectNotificationChannelPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2601,12 +2694,10 @@ describe('v3.UptimeCheckServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match = + sinon.stub().returns(expectedParameters); it('projectServiceServiceLevelObjectivePath', () => { const result = client.projectServiceServiceLevelObjectivePath( @@ -2616,47 +2707,58 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchProjectFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchProjectFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName', () => { - const result = client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( - fakePath - ); + const result = + client.matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + fakePath + ); assert.strictEqual(result, 'serviceLevelObjectiveValue'); assert( - (client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectServiceServiceLevelObjectivePathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2688,34 +2790,40 @@ describe('v3.UptimeCheckServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectUptimeCheckConfigName', () => { - const result = client.matchProjectFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchProjectFromProjectUptimeCheckConfigName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchUptimeCheckConfigFromProjectUptimeCheckConfigName', () => { - const result = client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( - fakePath - ); + const result = + client.matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + fakePath + ); assert.strictEqual(result, 'uptimeCheckConfigValue'); assert( - (client.pathTemplates.projectUptimeCheckConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectUptimeCheckConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) );