From f0ee9e17d069a2adf6df249ec1f81147813e7dc6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 12:27:46 -0800 Subject: [PATCH] fix(browser): check for fetch on window (#501) --- .../protos/protos.json | 554 ++++++++++++++++-- .../src/v3/alert_policy_service_client.ts | 70 ++- .../src/v3/group_service_client.ts | 84 +-- .../src/v3/metric_service_client.ts | 108 ++-- .../v3/notification_channel_service_client.ts | 124 ++-- .../v3/service_monitoring_service_client.ts | 124 ++-- .../src/v3/uptime_check_service_client.ts | 84 +-- .../google-cloud-monitoring/synth.metadata | 8 +- 8 files changed, 833 insertions(+), 323 deletions(-) diff --git a/packages/google-cloud-monitoring/protos/protos.json b/packages/google-cloud-monitoring/protos/protos.json index d4a31761fd8..56162dc2efa 100644 --- a/packages/google-cloud-monitoring/protos/protos.json +++ b/packages/google-cloud-monitoring/protos/protos.json @@ -364,7 +364,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*}/alertPolicies", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}/alertPolicies" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetAlertPolicy": { "requestType": "GetAlertPolicyRequest", @@ -372,7 +382,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/alertPolicies/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/alertPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CreateAlertPolicy": { "requestType": "CreateAlertPolicyRequest", @@ -381,7 +401,18 @@ "(google.api.http).post": "/v3/{name=projects/*}/alertPolicies", "(google.api.http).body": "alert_policy", "(google.api.method_signature)": "name,alert_policy" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*}/alertPolicies", + "body": "alert_policy" + } + }, + { + "(google.api.method_signature)": "name,alert_policy" + } + ] }, "DeleteAlertPolicy": { "requestType": "DeleteAlertPolicyRequest", @@ -389,7 +420,17 @@ "options": { "(google.api.http).delete": "/v3/{name=projects/*/alertPolicies/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/alertPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "UpdateAlertPolicy": { "requestType": "UpdateAlertPolicyRequest", @@ -398,7 +439,18 @@ "(google.api.http).patch": "/v3/{alert_policy.name=projects/*/alertPolicies/*}", "(google.api.http).body": "alert_policy", "(google.api.method_signature)": "update_mask,alert_policy" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{alert_policy.name=projects/*/alertPolicies/*}", + "body": "alert_policy" + } + }, + { + "(google.api.method_signature)": "update_mask,alert_policy" + } + ] } } }, @@ -550,7 +602,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*}/groups", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}/groups" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetGroup": { "requestType": "GetGroupRequest", @@ -558,7 +620,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/groups/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/groups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CreateGroup": { "requestType": "CreateGroupRequest", @@ -567,7 +639,18 @@ "(google.api.http).post": "/v3/{name=projects/*}/groups", "(google.api.http).body": "group", "(google.api.method_signature)": "name,group" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*}/groups", + "body": "group" + } + }, + { + "(google.api.method_signature)": "name,group" + } + ] }, "UpdateGroup": { "requestType": "UpdateGroupRequest", @@ -576,7 +659,18 @@ "(google.api.http).put": "/v3/{group.name=projects/*/groups/*}", "(google.api.http).body": "group", "(google.api.method_signature)": "group" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v3/{group.name=projects/*/groups/*}", + "body": "group" + } + }, + { + "(google.api.method_signature)": "group" + } + ] }, "DeleteGroup": { "requestType": "DeleteGroupRequest", @@ -584,7 +678,17 @@ "options": { "(google.api.http).delete": "/v3/{name=projects/*/groups/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/groups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListGroupMembers": { "requestType": "ListGroupMembersRequest", @@ -592,7 +696,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/groups/*}/members", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/groups/*}/members" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -959,7 +1073,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*}/monitoredResourceDescriptors", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}/monitoredResourceDescriptors" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetMonitoredResourceDescriptor": { "requestType": "GetMonitoredResourceDescriptorRequest", @@ -967,7 +1091,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/monitoredResourceDescriptors/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/monitoredResourceDescriptors/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListMetricDescriptors": { "requestType": "ListMetricDescriptorsRequest", @@ -975,7 +1109,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*}/metricDescriptors", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}/metricDescriptors" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetMetricDescriptor": { "requestType": "GetMetricDescriptorRequest", @@ -983,7 +1127,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/metricDescriptors/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/metricDescriptors/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CreateMetricDescriptor": { "requestType": "CreateMetricDescriptorRequest", @@ -992,7 +1146,18 @@ "(google.api.http).post": "/v3/{name=projects/*}/metricDescriptors", "(google.api.http).body": "metric_descriptor", "(google.api.method_signature)": "name,metric_descriptor" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*}/metricDescriptors", + "body": "metric_descriptor" + } + }, + { + "(google.api.method_signature)": "name,metric_descriptor" + } + ] }, "DeleteMetricDescriptor": { "requestType": "DeleteMetricDescriptorRequest", @@ -1000,7 +1165,17 @@ "options": { "(google.api.http).delete": "/v3/{name=projects/*/metricDescriptors/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/metricDescriptors/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListTimeSeries": { "requestType": "ListTimeSeriesRequest", @@ -1008,7 +1183,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*}/timeSeries", "(google.api.method_signature)": "name,filter,interval,view" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}/timeSeries" + } + }, + { + "(google.api.method_signature)": "name,filter,interval,view" + } + ] }, "CreateTimeSeries": { "requestType": "CreateTimeSeriesRequest", @@ -1017,7 +1202,18 @@ "(google.api.http).post": "/v3/{name=projects/*}/timeSeries", "(google.api.http).body": "*", "(google.api.method_signature)": "name,time_series" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*}/timeSeries", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,time_series" + } + ] } } }, @@ -1453,7 +1649,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*}/notificationChannelDescriptors", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}/notificationChannelDescriptors" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetNotificationChannelDescriptor": { "requestType": "GetNotificationChannelDescriptorRequest", @@ -1461,7 +1667,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/notificationChannelDescriptors/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/notificationChannelDescriptors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListNotificationChannels": { "requestType": "ListNotificationChannelsRequest", @@ -1469,7 +1685,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*}/notificationChannels", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}/notificationChannels" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetNotificationChannel": { "requestType": "GetNotificationChannelRequest", @@ -1477,7 +1703,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/notificationChannels/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/notificationChannels/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CreateNotificationChannel": { "requestType": "CreateNotificationChannelRequest", @@ -1486,7 +1722,18 @@ "(google.api.http).post": "/v3/{name=projects/*}/notificationChannels", "(google.api.http).body": "notification_channel", "(google.api.method_signature)": "name,notification_channel" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*}/notificationChannels", + "body": "notification_channel" + } + }, + { + "(google.api.method_signature)": "name,notification_channel" + } + ] }, "UpdateNotificationChannel": { "requestType": "UpdateNotificationChannelRequest", @@ -1495,7 +1742,18 @@ "(google.api.http).patch": "/v3/{notification_channel.name=projects/*/notificationChannels/*}", "(google.api.http).body": "notification_channel", "(google.api.method_signature)": "update_mask,notification_channel" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{notification_channel.name=projects/*/notificationChannels/*}", + "body": "notification_channel" + } + }, + { + "(google.api.method_signature)": "update_mask,notification_channel" + } + ] }, "DeleteNotificationChannel": { "requestType": "DeleteNotificationChannelRequest", @@ -1503,7 +1761,17 @@ "options": { "(google.api.http).delete": "/v3/{name=projects/*/notificationChannels/*}", "(google.api.method_signature)": "name,force" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/notificationChannels/*}" + } + }, + { + "(google.api.method_signature)": "name,force" + } + ] }, "SendNotificationChannelVerificationCode": { "requestType": "SendNotificationChannelVerificationCodeRequest", @@ -1512,7 +1780,18 @@ "(google.api.http).post": "/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode", "(google.api.http).body": "*", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetNotificationChannelVerificationCode": { "requestType": "GetNotificationChannelVerificationCodeRequest", @@ -1521,7 +1800,18 @@ "(google.api.http).post": "/v3/{name=projects/*/notificationChannels/*}:getVerificationCode", "(google.api.http).body": "*", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/notificationChannels/*}:getVerificationCode", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "VerifyNotificationChannel": { "requestType": "VerifyNotificationChannelRequest", @@ -1530,7 +1820,18 @@ "(google.api.http).post": "/v3/{name=projects/*/notificationChannels/*}:verify", "(google.api.http).body": "*", "(google.api.method_signature)": "name,code" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*/notificationChannels/*}:verify", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,code" + } + ] } } }, @@ -2131,7 +2432,18 @@ "(google.api.http).post": "/v3/{parent=*/*}/services", "(google.api.http).body": "service", "(google.api.method_signature)": "parent,service" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=*/*}/services", + "body": "service" + } + }, + { + "(google.api.method_signature)": "parent,service" + } + ] }, "GetService": { "requestType": "GetServiceRequest", @@ -2139,7 +2451,17 @@ "options": { "(google.api.http).get": "/v3/{name=*/*/services/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=*/*/services/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListServices": { "requestType": "ListServicesRequest", @@ -2147,7 +2469,17 @@ "options": { "(google.api.http).get": "/v3/{parent=*/*}/services", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=*/*}/services" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "UpdateService": { "requestType": "UpdateServiceRequest", @@ -2156,7 +2488,18 @@ "(google.api.http).patch": "/v3/{service.name=*/*/services/*}", "(google.api.http).body": "service", "(google.api.method_signature)": "service" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{service.name=*/*/services/*}", + "body": "service" + } + }, + { + "(google.api.method_signature)": "service" + } + ] }, "DeleteService": { "requestType": "DeleteServiceRequest", @@ -2164,7 +2507,17 @@ "options": { "(google.api.http).delete": "/v3/{name=*/*/services/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=*/*/services/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CreateServiceLevelObjective": { "requestType": "CreateServiceLevelObjectiveRequest", @@ -2173,7 +2526,18 @@ "(google.api.http).post": "/v3/{parent=*/*/services/*}/serviceLevelObjectives", "(google.api.http).body": "service_level_objective", "(google.api.method_signature)": "parent,service_level_objective" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=*/*/services/*}/serviceLevelObjectives", + "body": "service_level_objective" + } + }, + { + "(google.api.method_signature)": "parent,service_level_objective" + } + ] }, "GetServiceLevelObjective": { "requestType": "GetServiceLevelObjectiveRequest", @@ -2181,7 +2545,17 @@ "options": { "(google.api.http).get": "/v3/{name=*/*/services/*/serviceLevelObjectives/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListServiceLevelObjectives": { "requestType": "ListServiceLevelObjectivesRequest", @@ -2189,7 +2563,17 @@ "options": { "(google.api.http).get": "/v3/{parent=*/*/services/*}/serviceLevelObjectives", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "UpdateServiceLevelObjective": { "requestType": "UpdateServiceLevelObjectiveRequest", @@ -2198,7 +2582,18 @@ "(google.api.http).patch": "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}", "(google.api.http).body": "service_level_objective", "(google.api.method_signature)": "service_level_objective" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}", + "body": "service_level_objective" + } + }, + { + "(google.api.method_signature)": "service_level_objective" + } + ] }, "DeleteServiceLevelObjective": { "requestType": "DeleteServiceLevelObjectiveRequest", @@ -2206,7 +2601,17 @@ "options": { "(google.api.http).delete": "/v3/{name=*/*/services/*/serviceLevelObjectives/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -2704,7 +3109,17 @@ "options": { "(google.api.http).get": "/v3/{parent=projects/*}/uptimeCheckConfigs", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*}/uptimeCheckConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetUptimeCheckConfig": { "requestType": "GetUptimeCheckConfigRequest", @@ -2712,7 +3127,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/uptimeCheckConfigs/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/uptimeCheckConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CreateUptimeCheckConfig": { "requestType": "CreateUptimeCheckConfigRequest", @@ -2721,7 +3146,18 @@ "(google.api.http).post": "/v3/{parent=projects/*}/uptimeCheckConfigs", "(google.api.http).body": "uptime_check_config", "(google.api.method_signature)": "parent,uptime_check_config" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*}/uptimeCheckConfigs", + "body": "uptime_check_config" + } + }, + { + "(google.api.method_signature)": "parent,uptime_check_config" + } + ] }, "UpdateUptimeCheckConfig": { "requestType": "UpdateUptimeCheckConfigRequest", @@ -2730,7 +3166,18 @@ "(google.api.http).patch": "/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}", "(google.api.http).body": "uptime_check_config", "(google.api.method_signature)": "uptime_check_config" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}", + "body": "uptime_check_config" + } + }, + { + "(google.api.method_signature)": "uptime_check_config" + } + ] }, "DeleteUptimeCheckConfig": { "requestType": "DeleteUptimeCheckConfigRequest", @@ -2738,14 +3185,31 @@ "options": { "(google.api.http).delete": "/v3/{name=projects/*/uptimeCheckConfigs/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/uptimeCheckConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListUptimeCheckIps": { "requestType": "ListUptimeCheckIpsRequest", "responseType": "ListUptimeCheckIpsResponse", "options": { "(google.api.http).get": "/v3/uptimeCheckIps" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/uptimeCheckIps" + } + } + ] } } }, 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 76394756799..0b81a3b1c0a 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 @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3/alert_policy_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './alert_policy_service_client_config.json'; const version = require('../../../package.json').version; @@ -91,9 +97,9 @@ export class AlertPolicyServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -106,7 +112,9 @@ export class AlertPolicyServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -392,7 +400,7 @@ export class AlertPolicyServiceClient { // ------------------- getAlertPolicy( request: protos.google.monitoring.v3.IGetAlertPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IAlertPolicy, @@ -402,7 +410,7 @@ export class AlertPolicyServiceClient { >; getAlertPolicy( request: protos.google.monitoring.v3.IGetAlertPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IAlertPolicy, protos.google.monitoring.v3.IGetAlertPolicyRequest | null | undefined, @@ -439,7 +447,7 @@ export class AlertPolicyServiceClient { getAlertPolicy( request: protos.google.monitoring.v3.IGetAlertPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IAlertPolicy, protos.google.monitoring.v3.IGetAlertPolicyRequest | null | undefined, @@ -458,12 +466,12 @@ export class AlertPolicyServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -478,7 +486,7 @@ export class AlertPolicyServiceClient { } createAlertPolicy( request: protos.google.monitoring.v3.ICreateAlertPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IAlertPolicy, @@ -488,7 +496,7 @@ export class AlertPolicyServiceClient { >; createAlertPolicy( request: protos.google.monitoring.v3.ICreateAlertPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IAlertPolicy, protos.google.monitoring.v3.ICreateAlertPolicyRequest | null | undefined, @@ -536,7 +544,7 @@ export class AlertPolicyServiceClient { createAlertPolicy( request: protos.google.monitoring.v3.ICreateAlertPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IAlertPolicy, | protos.google.monitoring.v3.ICreateAlertPolicyRequest @@ -557,12 +565,12 @@ export class AlertPolicyServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -577,7 +585,7 @@ export class AlertPolicyServiceClient { } deleteAlertPolicy( request: protos.google.monitoring.v3.IDeleteAlertPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -587,7 +595,7 @@ export class AlertPolicyServiceClient { >; deleteAlertPolicy( request: protos.google.monitoring.v3.IDeleteAlertPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteAlertPolicyRequest | null | undefined, @@ -626,7 +634,7 @@ export class AlertPolicyServiceClient { deleteAlertPolicy( request: protos.google.monitoring.v3.IDeleteAlertPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteAlertPolicyRequest @@ -647,12 +655,12 @@ export class AlertPolicyServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -667,7 +675,7 @@ export class AlertPolicyServiceClient { } updateAlertPolicy( request: protos.google.monitoring.v3.IUpdateAlertPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IAlertPolicy, @@ -677,7 +685,7 @@ export class AlertPolicyServiceClient { >; updateAlertPolicy( request: protos.google.monitoring.v3.IUpdateAlertPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IAlertPolicy, protos.google.monitoring.v3.IUpdateAlertPolicyRequest | null | undefined, @@ -740,7 +748,7 @@ export class AlertPolicyServiceClient { updateAlertPolicy( request: protos.google.monitoring.v3.IUpdateAlertPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IAlertPolicy, | protos.google.monitoring.v3.IUpdateAlertPolicyRequest @@ -761,12 +769,12 @@ export class AlertPolicyServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -782,7 +790,7 @@ export class AlertPolicyServiceClient { listAlertPolicies( request: protos.google.monitoring.v3.IListAlertPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IAlertPolicy[], @@ -792,7 +800,7 @@ export class AlertPolicyServiceClient { >; listAlertPolicies( request: protos.google.monitoring.v3.IListAlertPoliciesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListAlertPoliciesRequest, protos.google.monitoring.v3.IListAlertPoliciesResponse | null | undefined, @@ -857,7 +865,7 @@ export class AlertPolicyServiceClient { listAlertPolicies( request: protos.google.monitoring.v3.IListAlertPoliciesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListAlertPoliciesRequest, | protos.google.monitoring.v3.IListAlertPoliciesResponse @@ -878,12 +886,12 @@ export class AlertPolicyServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -944,7 +952,7 @@ export class AlertPolicyServiceClient { */ listAlertPoliciesStream( request?: protos.google.monitoring.v3.IListAlertPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1017,7 +1025,7 @@ export class AlertPolicyServiceClient { */ listAlertPoliciesAsync( request?: protos.google.monitoring.v3.IListAlertPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; 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 60565bac44f..24463822985 100644 --- a/packages/google-cloud-monitoring/src/v3/group_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/group_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3/group_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './group_service_client_config.json'; const version = require('../../../package.json').version; @@ -94,9 +100,9 @@ export class GroupServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -109,7 +115,9 @@ export class GroupServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -401,7 +409,7 @@ export class GroupServiceClient { // ------------------- getGroup( request: protos.google.monitoring.v3.IGetGroupRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IGroup, @@ -411,7 +419,7 @@ export class GroupServiceClient { >; getGroup( request: protos.google.monitoring.v3.IGetGroupRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IGroup, protos.google.monitoring.v3.IGetGroupRequest | null | undefined, @@ -448,7 +456,7 @@ export class GroupServiceClient { getGroup( request: protos.google.monitoring.v3.IGetGroupRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IGroup, protos.google.monitoring.v3.IGetGroupRequest | null | undefined, @@ -467,12 +475,12 @@ export class GroupServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -487,7 +495,7 @@ export class GroupServiceClient { } createGroup( request: protos.google.monitoring.v3.ICreateGroupRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IGroup, @@ -497,7 +505,7 @@ export class GroupServiceClient { >; createGroup( request: protos.google.monitoring.v3.ICreateGroupRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IGroup, protos.google.monitoring.v3.ICreateGroupRequest | null | undefined, @@ -539,7 +547,7 @@ export class GroupServiceClient { createGroup( request: protos.google.monitoring.v3.ICreateGroupRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IGroup, protos.google.monitoring.v3.ICreateGroupRequest | null | undefined, @@ -558,12 +566,12 @@ export class GroupServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -578,7 +586,7 @@ export class GroupServiceClient { } updateGroup( request: protos.google.monitoring.v3.IUpdateGroupRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IGroup, @@ -588,7 +596,7 @@ export class GroupServiceClient { >; updateGroup( request: protos.google.monitoring.v3.IUpdateGroupRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IGroup, protos.google.monitoring.v3.IUpdateGroupRequest | null | undefined, @@ -627,7 +635,7 @@ export class GroupServiceClient { updateGroup( request: protos.google.monitoring.v3.IUpdateGroupRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IGroup, protos.google.monitoring.v3.IUpdateGroupRequest | null | undefined, @@ -646,12 +654,12 @@ export class GroupServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -666,7 +674,7 @@ export class GroupServiceClient { } deleteGroup( request: protos.google.monitoring.v3.IDeleteGroupRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -676,7 +684,7 @@ export class GroupServiceClient { >; deleteGroup( request: protos.google.monitoring.v3.IDeleteGroupRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteGroupRequest | null | undefined, @@ -717,7 +725,7 @@ export class GroupServiceClient { deleteGroup( request: protos.google.monitoring.v3.IDeleteGroupRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteGroupRequest | null | undefined, @@ -736,12 +744,12 @@ export class GroupServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -757,7 +765,7 @@ export class GroupServiceClient { listGroups( request: protos.google.monitoring.v3.IListGroupsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IGroup[], @@ -767,7 +775,7 @@ export class GroupServiceClient { >; listGroups( request: protos.google.monitoring.v3.IListGroupsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListGroupsRequest, protos.google.monitoring.v3.IListGroupsResponse | null | undefined, @@ -837,7 +845,7 @@ export class GroupServiceClient { listGroups( request: protos.google.monitoring.v3.IListGroupsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListGroupsRequest, protos.google.monitoring.v3.IListGroupsResponse | null | undefined, @@ -856,12 +864,12 @@ export class GroupServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -927,7 +935,7 @@ export class GroupServiceClient { */ listGroupsStream( request?: protos.google.monitoring.v3.IListGroupsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1005,7 +1013,7 @@ export class GroupServiceClient { */ listGroupsAsync( request?: protos.google.monitoring.v3.IListGroupsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1027,7 +1035,7 @@ export class GroupServiceClient { } listGroupMembers( request: protos.google.monitoring.v3.IListGroupMembersRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.api.IMonitoredResource[], @@ -1037,7 +1045,7 @@ export class GroupServiceClient { >; listGroupMembers( request: protos.google.monitoring.v3.IListGroupMembersRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListGroupMembersRequest, protos.google.monitoring.v3.IListGroupMembersResponse | null | undefined, @@ -1097,7 +1105,7 @@ export class GroupServiceClient { listGroupMembers( request: protos.google.monitoring.v3.IListGroupMembersRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListGroupMembersRequest, | protos.google.monitoring.v3.IListGroupMembersResponse @@ -1118,12 +1126,12 @@ export class GroupServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1179,7 +1187,7 @@ export class GroupServiceClient { */ listGroupMembersStream( request?: protos.google.monitoring.v3.IListGroupMembersRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1247,7 +1255,7 @@ export class GroupServiceClient { */ listGroupMembersAsync( request?: protos.google.monitoring.v3.IListGroupMembersRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; 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 707bcfcb6c0..84a3d72cea2 100644 --- a/packages/google-cloud-monitoring/src/v3/metric_service_client.ts +++ b/packages/google-cloud-monitoring/src/v3/metric_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3/metric_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './metric_service_client_config.json'; const version = require('../../../package.json').version; @@ -84,9 +90,9 @@ export class MetricServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -99,7 +105,9 @@ export class MetricServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -417,7 +425,7 @@ export class MetricServiceClient { // ------------------- getMonitoredResourceDescriptor( request: protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.api.IMonitoredResourceDescriptor, @@ -430,7 +438,7 @@ export class MetricServiceClient { >; getMonitoredResourceDescriptor( request: protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.api.IMonitoredResourceDescriptor, | protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest @@ -474,7 +482,7 @@ export class MetricServiceClient { getMonitoredResourceDescriptor( request: protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.api.IMonitoredResourceDescriptor, | protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest @@ -500,12 +508,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -524,7 +532,7 @@ export class MetricServiceClient { } getMetricDescriptor( request: protos.google.monitoring.v3.IGetMetricDescriptorRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.api.IMetricDescriptor, @@ -534,7 +542,7 @@ export class MetricServiceClient { >; getMetricDescriptor( request: protos.google.monitoring.v3.IGetMetricDescriptorRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.api.IMetricDescriptor, | protos.google.monitoring.v3.IGetMetricDescriptorRequest @@ -578,7 +586,7 @@ export class MetricServiceClient { getMetricDescriptor( request: protos.google.monitoring.v3.IGetMetricDescriptorRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.api.IMetricDescriptor, | protos.google.monitoring.v3.IGetMetricDescriptorRequest @@ -601,12 +609,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -621,7 +629,7 @@ export class MetricServiceClient { } createMetricDescriptor( request: protos.google.monitoring.v3.ICreateMetricDescriptorRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.api.IMetricDescriptor, @@ -631,7 +639,7 @@ export class MetricServiceClient { >; createMetricDescriptor( request: protos.google.monitoring.v3.ICreateMetricDescriptorRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.api.IMetricDescriptor, | protos.google.monitoring.v3.ICreateMetricDescriptorRequest @@ -677,7 +685,7 @@ export class MetricServiceClient { createMetricDescriptor( request: protos.google.monitoring.v3.ICreateMetricDescriptorRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.api.IMetricDescriptor, | protos.google.monitoring.v3.ICreateMetricDescriptorRequest @@ -700,12 +708,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -724,7 +732,7 @@ export class MetricServiceClient { } deleteMetricDescriptor( request: protos.google.monitoring.v3.IDeleteMetricDescriptorRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -734,7 +742,7 @@ export class MetricServiceClient { >; deleteMetricDescriptor( request: protos.google.monitoring.v3.IDeleteMetricDescriptorRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteMetricDescriptorRequest @@ -780,7 +788,7 @@ export class MetricServiceClient { deleteMetricDescriptor( request: protos.google.monitoring.v3.IDeleteMetricDescriptorRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteMetricDescriptorRequest @@ -803,12 +811,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -827,7 +835,7 @@ export class MetricServiceClient { } createTimeSeries( request: protos.google.monitoring.v3.ICreateTimeSeriesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -837,7 +845,7 @@ export class MetricServiceClient { >; createTimeSeries( request: protos.google.monitoring.v3.ICreateTimeSeriesRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ICreateTimeSeriesRequest | null | undefined, @@ -885,7 +893,7 @@ export class MetricServiceClient { createTimeSeries( request: protos.google.monitoring.v3.ICreateTimeSeriesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.ICreateTimeSeriesRequest @@ -906,12 +914,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -927,7 +935,7 @@ export class MetricServiceClient { listMonitoredResourceDescriptors( request: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.api.IMonitoredResourceDescriptor[], @@ -937,7 +945,7 @@ export class MetricServiceClient { >; listMonitoredResourceDescriptors( request: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, | protos.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse @@ -994,7 +1002,7 @@ export class MetricServiceClient { listMonitoredResourceDescriptors( request: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, | protos.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse @@ -1017,12 +1025,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1075,7 +1083,7 @@ export class MetricServiceClient { */ listMonitoredResourceDescriptorsStream( request?: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1136,7 +1144,7 @@ export class MetricServiceClient { */ listMonitoredResourceDescriptorsAsync( request?: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1158,7 +1166,7 @@ export class MetricServiceClient { } listMetricDescriptors( request: protos.google.monitoring.v3.IListMetricDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.api.IMetricDescriptor[], @@ -1168,7 +1176,7 @@ export class MetricServiceClient { >; listMetricDescriptors( request: protos.google.monitoring.v3.IListMetricDescriptorsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListMetricDescriptorsRequest, | protos.google.monitoring.v3.IListMetricDescriptorsResponse @@ -1227,7 +1235,7 @@ export class MetricServiceClient { listMetricDescriptors( request: protos.google.monitoring.v3.IListMetricDescriptorsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListMetricDescriptorsRequest, | protos.google.monitoring.v3.IListMetricDescriptorsResponse @@ -1250,12 +1258,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1306,7 +1314,7 @@ export class MetricServiceClient { */ listMetricDescriptorsStream( request?: protos.google.monitoring.v3.IListMetricDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1369,7 +1377,7 @@ export class MetricServiceClient { */ listMetricDescriptorsAsync( request?: protos.google.monitoring.v3.IListMetricDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1391,7 +1399,7 @@ export class MetricServiceClient { } listTimeSeries( request: protos.google.monitoring.v3.IListTimeSeriesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.ITimeSeries[], @@ -1401,7 +1409,7 @@ export class MetricServiceClient { >; listTimeSeries( request: protos.google.monitoring.v3.IListTimeSeriesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListTimeSeriesRequest, protos.google.monitoring.v3.IListTimeSeriesResponse | null | undefined, @@ -1474,7 +1482,7 @@ export class MetricServiceClient { listTimeSeries( request: protos.google.monitoring.v3.IListTimeSeriesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListTimeSeriesRequest, | protos.google.monitoring.v3.IListTimeSeriesResponse @@ -1495,12 +1503,12 @@ export class MetricServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1569,7 +1577,7 @@ export class MetricServiceClient { */ listTimeSeriesStream( request?: protos.google.monitoring.v3.IListTimeSeriesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1650,7 +1658,7 @@ export class MetricServiceClient { */ listTimeSeriesAsync( request?: protos.google.monitoring.v3.IListTimeSeriesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; 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 ab75d9e7322..0aa571da6aa 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 @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3/notification_channel_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './notification_channel_service_client_config.json'; const version = require('../../../package.json').version; @@ -84,9 +90,9 @@ export class NotificationChannelServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -100,7 +106,9 @@ export class NotificationChannelServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -396,7 +404,7 @@ export class NotificationChannelServiceClient { // ------------------- getNotificationChannelDescriptor( request: protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.INotificationChannelDescriptor, @@ -409,7 +417,7 @@ export class NotificationChannelServiceClient { >; getNotificationChannelDescriptor( request: protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.INotificationChannelDescriptor, | protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest @@ -451,7 +459,7 @@ export class NotificationChannelServiceClient { getNotificationChannelDescriptor( request: protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.INotificationChannelDescriptor, | protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest @@ -477,12 +485,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -501,7 +509,7 @@ export class NotificationChannelServiceClient { } getNotificationChannel( request: protos.google.monitoring.v3.IGetNotificationChannelRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.INotificationChannel, @@ -511,7 +519,7 @@ export class NotificationChannelServiceClient { >; getNotificationChannel( request: protos.google.monitoring.v3.IGetNotificationChannelRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.IGetNotificationChannelRequest @@ -556,7 +564,7 @@ export class NotificationChannelServiceClient { getNotificationChannel( request: protos.google.monitoring.v3.IGetNotificationChannelRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.IGetNotificationChannelRequest @@ -579,12 +587,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -603,7 +611,7 @@ export class NotificationChannelServiceClient { } createNotificationChannel( request: protos.google.monitoring.v3.ICreateNotificationChannelRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.INotificationChannel, @@ -613,7 +621,7 @@ export class NotificationChannelServiceClient { >; createNotificationChannel( request: protos.google.monitoring.v3.ICreateNotificationChannelRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.ICreateNotificationChannelRequest @@ -662,7 +670,7 @@ export class NotificationChannelServiceClient { createNotificationChannel( request: protos.google.monitoring.v3.ICreateNotificationChannelRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.ICreateNotificationChannelRequest @@ -685,12 +693,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -709,7 +717,7 @@ export class NotificationChannelServiceClient { } updateNotificationChannel( request: protos.google.monitoring.v3.IUpdateNotificationChannelRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.INotificationChannel, @@ -719,7 +727,7 @@ export class NotificationChannelServiceClient { >; updateNotificationChannel( request: protos.google.monitoring.v3.IUpdateNotificationChannelRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.IUpdateNotificationChannelRequest @@ -764,7 +772,7 @@ export class NotificationChannelServiceClient { updateNotificationChannel( request: protos.google.monitoring.v3.IUpdateNotificationChannelRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.IUpdateNotificationChannelRequest @@ -787,12 +795,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -811,7 +819,7 @@ export class NotificationChannelServiceClient { } deleteNotificationChannel( request: protos.google.monitoring.v3.IDeleteNotificationChannelRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -821,7 +829,7 @@ export class NotificationChannelServiceClient { >; deleteNotificationChannel( request: protos.google.monitoring.v3.IDeleteNotificationChannelRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteNotificationChannelRequest @@ -867,7 +875,7 @@ export class NotificationChannelServiceClient { deleteNotificationChannel( request: protos.google.monitoring.v3.IDeleteNotificationChannelRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteNotificationChannelRequest @@ -890,12 +898,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -914,7 +922,7 @@ export class NotificationChannelServiceClient { } sendNotificationChannelVerificationCode( request: protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -927,7 +935,7 @@ export class NotificationChannelServiceClient { >; sendNotificationChannelVerificationCode( request: protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest @@ -967,7 +975,7 @@ export class NotificationChannelServiceClient { sendNotificationChannelVerificationCode( request: protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest @@ -993,12 +1001,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1017,7 +1025,7 @@ export class NotificationChannelServiceClient { } getNotificationChannelVerificationCode( request: protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, @@ -1030,7 +1038,7 @@ export class NotificationChannelServiceClient { >; getNotificationChannelVerificationCode( request: protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, | protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest @@ -1101,7 +1109,7 @@ export class NotificationChannelServiceClient { getNotificationChannelVerificationCode( request: protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, | protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest @@ -1127,12 +1135,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1151,7 +1159,7 @@ export class NotificationChannelServiceClient { } verifyNotificationChannel( request: protos.google.monitoring.v3.IVerifyNotificationChannelRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.INotificationChannel, @@ -1161,7 +1169,7 @@ export class NotificationChannelServiceClient { >; verifyNotificationChannel( request: protos.google.monitoring.v3.IVerifyNotificationChannelRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.IVerifyNotificationChannelRequest @@ -1210,7 +1218,7 @@ export class NotificationChannelServiceClient { verifyNotificationChannel( request: protos.google.monitoring.v3.IVerifyNotificationChannelRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.INotificationChannel, | protos.google.monitoring.v3.IVerifyNotificationChannelRequest @@ -1233,12 +1241,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1258,7 +1266,7 @@ export class NotificationChannelServiceClient { listNotificationChannelDescriptors( request: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.INotificationChannelDescriptor[], @@ -1268,7 +1276,7 @@ export class NotificationChannelServiceClient { >; listNotificationChannelDescriptors( request: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, | protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse @@ -1327,7 +1335,7 @@ export class NotificationChannelServiceClient { listNotificationChannelDescriptors( request: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, | protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse @@ -1350,12 +1358,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1409,7 +1417,7 @@ export class NotificationChannelServiceClient { */ listNotificationChannelDescriptorsStream( request?: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1471,7 +1479,7 @@ export class NotificationChannelServiceClient { */ listNotificationChannelDescriptorsAsync( request?: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1495,7 +1503,7 @@ export class NotificationChannelServiceClient { } listNotificationChannels( request: protos.google.monitoring.v3.IListNotificationChannelsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.INotificationChannel[], @@ -1505,7 +1513,7 @@ export class NotificationChannelServiceClient { >; listNotificationChannels( request: protos.google.monitoring.v3.IListNotificationChannelsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListNotificationChannelsRequest, | protos.google.monitoring.v3.IListNotificationChannelsResponse @@ -1577,7 +1585,7 @@ export class NotificationChannelServiceClient { listNotificationChannels( request: protos.google.monitoring.v3.IListNotificationChannelsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListNotificationChannelsRequest, | protos.google.monitoring.v3.IListNotificationChannelsResponse @@ -1600,12 +1608,12 @@ export class NotificationChannelServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1673,7 +1681,7 @@ export class NotificationChannelServiceClient { */ listNotificationChannelsStream( request?: protos.google.monitoring.v3.IListNotificationChannelsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1749,7 +1757,7 @@ export class NotificationChannelServiceClient { */ listNotificationChannelsAsync( request?: protos.google.monitoring.v3.IListNotificationChannelsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; 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 5590bd92aeb..e4dad71a50b 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 @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3/service_monitoring_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './service_monitoring_service_client_config.json'; const version = require('../../../package.json').version; @@ -86,9 +92,9 @@ export class ServiceMonitoringServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -102,7 +108,9 @@ export class ServiceMonitoringServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -398,7 +406,7 @@ export class ServiceMonitoringServiceClient { // ------------------- createService( request: protos.google.monitoring.v3.ICreateServiceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IService, @@ -408,7 +416,7 @@ export class ServiceMonitoringServiceClient { >; createService( request: protos.google.monitoring.v3.ICreateServiceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IService, protos.google.monitoring.v3.ICreateServiceRequest | null | undefined, @@ -450,7 +458,7 @@ export class ServiceMonitoringServiceClient { createService( request: protos.google.monitoring.v3.ICreateServiceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IService, protos.google.monitoring.v3.ICreateServiceRequest | null | undefined, @@ -469,12 +477,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -489,7 +497,7 @@ export class ServiceMonitoringServiceClient { } getService( request: protos.google.monitoring.v3.IGetServiceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IService, @@ -499,7 +507,7 @@ export class ServiceMonitoringServiceClient { >; getService( request: protos.google.monitoring.v3.IGetServiceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IService, protos.google.monitoring.v3.IGetServiceRequest | null | undefined, @@ -536,7 +544,7 @@ export class ServiceMonitoringServiceClient { getService( request: protos.google.monitoring.v3.IGetServiceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IService, protos.google.monitoring.v3.IGetServiceRequest | null | undefined, @@ -555,12 +563,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -575,7 +583,7 @@ export class ServiceMonitoringServiceClient { } updateService( request: protos.google.monitoring.v3.IUpdateServiceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IService, @@ -585,7 +593,7 @@ export class ServiceMonitoringServiceClient { >; updateService( request: protos.google.monitoring.v3.IUpdateServiceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IService, protos.google.monitoring.v3.IUpdateServiceRequest | null | undefined, @@ -623,7 +631,7 @@ export class ServiceMonitoringServiceClient { updateService( request: protos.google.monitoring.v3.IUpdateServiceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IService, protos.google.monitoring.v3.IUpdateServiceRequest | null | undefined, @@ -642,12 +650,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -662,7 +670,7 @@ export class ServiceMonitoringServiceClient { } deleteService( request: protos.google.monitoring.v3.IDeleteServiceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -672,7 +680,7 @@ export class ServiceMonitoringServiceClient { >; deleteService( request: protos.google.monitoring.v3.IDeleteServiceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteServiceRequest | null | undefined, @@ -709,7 +717,7 @@ export class ServiceMonitoringServiceClient { deleteService( request: protos.google.monitoring.v3.IDeleteServiceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteServiceRequest | null | undefined, @@ -728,12 +736,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -748,7 +756,7 @@ export class ServiceMonitoringServiceClient { } createServiceLevelObjective( request: protos.google.monitoring.v3.ICreateServiceLevelObjectiveRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IServiceLevelObjective, @@ -761,7 +769,7 @@ export class ServiceMonitoringServiceClient { >; createServiceLevelObjective( request: protos.google.monitoring.v3.ICreateServiceLevelObjectiveRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IServiceLevelObjective, | protos.google.monitoring.v3.ICreateServiceLevelObjectiveRequest @@ -810,7 +818,7 @@ export class ServiceMonitoringServiceClient { createServiceLevelObjective( request: protos.google.monitoring.v3.ICreateServiceLevelObjectiveRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IServiceLevelObjective, | protos.google.monitoring.v3.ICreateServiceLevelObjectiveRequest @@ -836,12 +844,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -860,7 +868,7 @@ export class ServiceMonitoringServiceClient { } getServiceLevelObjective( request: protos.google.monitoring.v3.IGetServiceLevelObjectiveRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IServiceLevelObjective, @@ -870,7 +878,7 @@ export class ServiceMonitoringServiceClient { >; getServiceLevelObjective( request: protos.google.monitoring.v3.IGetServiceLevelObjectiveRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IServiceLevelObjective, | protos.google.monitoring.v3.IGetServiceLevelObjectiveRequest @@ -916,7 +924,7 @@ export class ServiceMonitoringServiceClient { getServiceLevelObjective( request: protos.google.monitoring.v3.IGetServiceLevelObjectiveRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IServiceLevelObjective, | protos.google.monitoring.v3.IGetServiceLevelObjectiveRequest @@ -939,12 +947,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -963,7 +971,7 @@ export class ServiceMonitoringServiceClient { } updateServiceLevelObjective( request: protos.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IServiceLevelObjective, @@ -976,7 +984,7 @@ export class ServiceMonitoringServiceClient { >; updateServiceLevelObjective( request: protos.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IServiceLevelObjective, | protos.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest @@ -1018,7 +1026,7 @@ export class ServiceMonitoringServiceClient { updateServiceLevelObjective( request: protos.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IServiceLevelObjective, | protos.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest @@ -1044,12 +1052,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1068,7 +1076,7 @@ export class ServiceMonitoringServiceClient { } deleteServiceLevelObjective( request: protos.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -1081,7 +1089,7 @@ export class ServiceMonitoringServiceClient { >; deleteServiceLevelObjective( request: protos.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest @@ -1122,7 +1130,7 @@ export class ServiceMonitoringServiceClient { deleteServiceLevelObjective( request: protos.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest @@ -1148,12 +1156,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1173,7 +1181,7 @@ export class ServiceMonitoringServiceClient { listServices( request: protos.google.monitoring.v3.IListServicesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IService[], @@ -1183,7 +1191,7 @@ export class ServiceMonitoringServiceClient { >; listServices( request: protos.google.monitoring.v3.IListServicesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListServicesRequest, protos.google.monitoring.v3.IListServicesResponse | null | undefined, @@ -1248,7 +1256,7 @@ export class ServiceMonitoringServiceClient { listServices( request: protos.google.monitoring.v3.IListServicesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListServicesRequest, protos.google.monitoring.v3.IListServicesResponse | null | undefined, @@ -1267,12 +1275,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1333,7 +1341,7 @@ export class ServiceMonitoringServiceClient { */ listServicesStream( request?: protos.google.monitoring.v3.IListServicesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1406,7 +1414,7 @@ export class ServiceMonitoringServiceClient { */ listServicesAsync( request?: protos.google.monitoring.v3.IListServicesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1428,7 +1436,7 @@ export class ServiceMonitoringServiceClient { } listServiceLevelObjectives( request: protos.google.monitoring.v3.IListServiceLevelObjectivesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IServiceLevelObjective[], @@ -1438,7 +1446,7 @@ export class ServiceMonitoringServiceClient { >; listServiceLevelObjectives( request: protos.google.monitoring.v3.IListServiceLevelObjectivesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListServiceLevelObjectivesRequest, | protos.google.monitoring.v3.IListServiceLevelObjectivesResponse @@ -1498,7 +1506,7 @@ export class ServiceMonitoringServiceClient { listServiceLevelObjectives( request: protos.google.monitoring.v3.IListServiceLevelObjectivesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListServiceLevelObjectivesRequest, | protos.google.monitoring.v3.IListServiceLevelObjectivesResponse @@ -1521,12 +1529,12 @@ export class ServiceMonitoringServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1582,7 +1590,7 @@ export class ServiceMonitoringServiceClient { */ listServiceLevelObjectivesStream( request?: protos.google.monitoring.v3.IListServiceLevelObjectivesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1646,7 +1654,7 @@ export class ServiceMonitoringServiceClient { */ listServiceLevelObjectivesAsync( request?: protos.google.monitoring.v3.IListServiceLevelObjectivesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; 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 a685f94efb3..12854f6a7b1 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 @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -30,6 +31,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3/uptime_check_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './uptime_check_service_client_config.json'; const version = require('../../../package.json').version; @@ -90,9 +96,9 @@ export class UptimeCheckServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -105,7 +111,9 @@ export class UptimeCheckServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -397,7 +405,7 @@ export class UptimeCheckServiceClient { // ------------------- getUptimeCheckConfig( request: protos.google.monitoring.v3.IGetUptimeCheckConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IUptimeCheckConfig, @@ -407,7 +415,7 @@ export class UptimeCheckServiceClient { >; getUptimeCheckConfig( request: protos.google.monitoring.v3.IGetUptimeCheckConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IUptimeCheckConfig, | protos.google.monitoring.v3.IGetUptimeCheckConfigRequest @@ -448,7 +456,7 @@ export class UptimeCheckServiceClient { getUptimeCheckConfig( request: protos.google.monitoring.v3.IGetUptimeCheckConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IUptimeCheckConfig, | protos.google.monitoring.v3.IGetUptimeCheckConfigRequest @@ -471,12 +479,12 @@ export class UptimeCheckServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -491,7 +499,7 @@ export class UptimeCheckServiceClient { } createUptimeCheckConfig( request: protos.google.monitoring.v3.ICreateUptimeCheckConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IUptimeCheckConfig, @@ -501,7 +509,7 @@ export class UptimeCheckServiceClient { >; createUptimeCheckConfig( request: protos.google.monitoring.v3.ICreateUptimeCheckConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IUptimeCheckConfig, | protos.google.monitoring.v3.ICreateUptimeCheckConfigRequest @@ -544,7 +552,7 @@ export class UptimeCheckServiceClient { createUptimeCheckConfig( request: protos.google.monitoring.v3.ICreateUptimeCheckConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IUptimeCheckConfig, | protos.google.monitoring.v3.ICreateUptimeCheckConfigRequest @@ -567,12 +575,12 @@ export class UptimeCheckServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -591,7 +599,7 @@ export class UptimeCheckServiceClient { } updateUptimeCheckConfig( request: protos.google.monitoring.v3.IUpdateUptimeCheckConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IUptimeCheckConfig, @@ -601,7 +609,7 @@ export class UptimeCheckServiceClient { >; updateUptimeCheckConfig( request: protos.google.monitoring.v3.IUpdateUptimeCheckConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.monitoring.v3.IUptimeCheckConfig, | protos.google.monitoring.v3.IUpdateUptimeCheckConfigRequest @@ -658,7 +666,7 @@ export class UptimeCheckServiceClient { updateUptimeCheckConfig( request: protos.google.monitoring.v3.IUpdateUptimeCheckConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.monitoring.v3.IUptimeCheckConfig, | protos.google.monitoring.v3.IUpdateUptimeCheckConfigRequest @@ -681,12 +689,12 @@ export class UptimeCheckServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -705,7 +713,7 @@ export class UptimeCheckServiceClient { } deleteUptimeCheckConfig( request: protos.google.monitoring.v3.IDeleteUptimeCheckConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -715,7 +723,7 @@ export class UptimeCheckServiceClient { >; deleteUptimeCheckConfig( request: protos.google.monitoring.v3.IDeleteUptimeCheckConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteUptimeCheckConfigRequest @@ -758,7 +766,7 @@ export class UptimeCheckServiceClient { deleteUptimeCheckConfig( request: protos.google.monitoring.v3.IDeleteUptimeCheckConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.monitoring.v3.IDeleteUptimeCheckConfigRequest @@ -781,12 +789,12 @@ export class UptimeCheckServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -806,7 +814,7 @@ export class UptimeCheckServiceClient { listUptimeCheckConfigs( request: protos.google.monitoring.v3.IListUptimeCheckConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IUptimeCheckConfig[], @@ -816,7 +824,7 @@ export class UptimeCheckServiceClient { >; listUptimeCheckConfigs( request: protos.google.monitoring.v3.IListUptimeCheckConfigsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListUptimeCheckConfigsRequest, | protos.google.monitoring.v3.IListUptimeCheckConfigsResponse @@ -870,7 +878,7 @@ export class UptimeCheckServiceClient { listUptimeCheckConfigs( request: protos.google.monitoring.v3.IListUptimeCheckConfigsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListUptimeCheckConfigsRequest, | protos.google.monitoring.v3.IListUptimeCheckConfigsResponse @@ -893,12 +901,12 @@ export class UptimeCheckServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -947,7 +955,7 @@ export class UptimeCheckServiceClient { */ listUptimeCheckConfigsStream( request?: protos.google.monitoring.v3.IListUptimeCheckConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1004,7 +1012,7 @@ export class UptimeCheckServiceClient { */ listUptimeCheckConfigsAsync( request?: protos.google.monitoring.v3.IListUptimeCheckConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1026,7 +1034,7 @@ export class UptimeCheckServiceClient { } listUptimeCheckIps( request: protos.google.monitoring.v3.IListUptimeCheckIpsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.monitoring.v3.IUptimeCheckIp[], @@ -1036,7 +1044,7 @@ export class UptimeCheckServiceClient { >; listUptimeCheckIps( request: protos.google.monitoring.v3.IListUptimeCheckIpsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.monitoring.v3.IListUptimeCheckIpsRequest, | protos.google.monitoring.v3.IListUptimeCheckIpsResponse @@ -1087,7 +1095,7 @@ export class UptimeCheckServiceClient { listUptimeCheckIps( request: protos.google.monitoring.v3.IListUptimeCheckIpsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.monitoring.v3.IListUptimeCheckIpsRequest, | protos.google.monitoring.v3.IListUptimeCheckIpsResponse @@ -1110,12 +1118,12 @@ export class UptimeCheckServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; this.initialize(); @@ -1151,7 +1159,7 @@ export class UptimeCheckServiceClient { */ listUptimeCheckIpsStream( request?: protos.google.monitoring.v3.IListUptimeCheckIpsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1199,7 +1207,7 @@ export class UptimeCheckServiceClient { */ listUptimeCheckIpsAsync( request?: protos.google.monitoring.v3.IListUptimeCheckIpsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-monitoring/synth.metadata b/packages/google-cloud-monitoring/synth.metadata index 898b09d2801..7dc3967e56c 100644 --- a/packages/google-cloud-monitoring/synth.metadata +++ b/packages/google-cloud-monitoring/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-monitoring.git", - "sha": "69f9bcf752172e6a5a793d0150176d6f9c6658b2" + "sha": "465f8982c765bb86dffe41a206da032edb973ba5" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", + "internalRef": "343187793" } }, { @@ -87,7 +87,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.592367270", "protos/google/monitoring/v3/alert.proto", "protos/google/monitoring/v3/alert_service.proto", "protos/google/monitoring/v3/common.proto", @@ -109,7 +108,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.4124165143", "src/index.ts", "src/v3/alert_policy_service_client.ts", "src/v3/alert_policy_service_client_config.json",