From 92dfc948f108a31270c8b275b2a03668af4ac6e8 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 13 Apr 2020 19:00:39 -0700 Subject: [PATCH 1/2] fix: process messages from all files --- .../v2/logging_service_v2_client.ts.baseline | 39 +++ .../v2/metrics_service_v2_client.ts.baseline | 39 +++ .../gapic_logging_service_v2_v2.ts.baseline | 38 +++ .../gapic_metrics_service_v2_v2.ts.baseline | 38 +++ .../alert_policy_service_client.ts.baseline | 234 ++++++++++++++++++ .../src/v3/group_service_client.ts.baseline | 234 ++++++++++++++++++ ...ication_channel_service_client.ts.baseline | 234 ++++++++++++++++++ ...vice_monitoring_service_client.ts.baseline | 234 ++++++++++++++++++ .../uptime_check_service_client.ts.baseline | 234 ++++++++++++++++++ .../gapic_alert_policy_service_v3.ts.baseline | 228 +++++++++++++++++ .../test/gapic_group_service_v3.ts.baseline | 228 +++++++++++++++++ ...otification_channel_service_v3.ts.baseline | 228 +++++++++++++++++ ..._service_monitoring_service_v3.ts.baseline | 228 +++++++++++++++++ .../gapic_uptime_check_service_v3.ts.baseline | 228 +++++++++++++++++ package.json | 2 + typescript/src/schema/api.ts | 16 +- typescript/src/schema/proto.ts | 23 +- typescript/test/unit/api.ts | 45 +++- typescript/test/unit/proto.ts | 10 +- 19 files changed, 2534 insertions(+), 26 deletions(-) diff --git a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline index a6cbe68e2..9a777fea7 100644 --- a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline @@ -169,6 +169,9 @@ export class LoggingServiceV2Client { folderSinkPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sinks/{sink}' ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), logMetricPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/metrics/{metric}' ), @@ -1551,6 +1554,42 @@ export class LoggingServiceV2Client { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; } + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + /** * Return a fully-qualified logMetric resource name string. * diff --git a/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline b/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline index db427859a..86199d832 100644 --- a/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline @@ -169,6 +169,9 @@ export class MetricsServiceV2Client { folderSinkPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sinks/{sink}' ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), logMetricPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/metrics/{metric}' ), @@ -1185,6 +1188,42 @@ export class MetricsServiceV2Client { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; } + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + /** * Return a fully-qualified logMetric resource name string. * diff --git a/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline b/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline index b557ef104..cbbe6a79e 100644 --- a/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline +++ b/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline @@ -1237,6 +1237,44 @@ describe('v2.LoggingServiceV2Client', () => { }); }); + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('logMetric', () => { const fakePath = "/rendered/path/logMetric"; const expectedParameters = { diff --git a/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline b/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline index 20f30d90c..f997da95b 100644 --- a/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline +++ b/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline @@ -1105,6 +1105,44 @@ describe('v2.MetricsServiceV2Client', () => { }); }); + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('logMetric', () => { const fakePath = "/rendered/path/logMetric"; const expectedParameters = { diff --git a/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline b/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline index 3109714fe..398dccbac 100644 --- a/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline @@ -159,6 +159,12 @@ export class AlertPolicyServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), + folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' + ), + folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -183,6 +189,12 @@ export class AlertPolicyServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), + organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' + ), + organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -207,6 +219,12 @@ export class AlertPolicyServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), + projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metricDescriptors/{metric_descriptor=**}' + ), + projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1068,6 +1086,78 @@ export class AlertPolicyServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } + /** + * Return a fully-qualified folderMetricDescriptor resource name string. + * + * @param {string} folder + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + folderMetricDescriptorPath(folder:string,metricDescriptor:string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ + folder: folder, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the folder from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; + } + + /** + * Parse the metric_descriptor from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. + * + * @param {string} folder + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ + folder: folder, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the folder from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; + } + + /** + * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1382,6 +1472,78 @@ export class AlertPolicyServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } + /** + * Return a fully-qualified organizationMetricDescriptor resource name string. + * + * @param {string} organization + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ + organization: organization, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; + } + + /** + * Parse the metric_descriptor from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. + * + * @param {string} organization + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ + organization: organization, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; + } + + /** + * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -1696,6 +1858,78 @@ export class AlertPolicyServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } + /** + * Return a fully-qualified projectMetricDescriptor resource name string. + * + * @param {string} project + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + projectMetricDescriptorPath(project:string,metricDescriptor:string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ + project: project, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the project from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; + } + + /** + * Parse the metric_descriptor from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. + * + * @param {string} project + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ + project: project, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the project from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; + } + + /** + * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/group_service_client.ts.baseline b/baselines/monitoring/src/v3/group_service_client.ts.baseline index 4cabc33c6..eda389c22 100644 --- a/baselines/monitoring/src/v3/group_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/group_service_client.ts.baseline @@ -162,6 +162,12 @@ export class GroupServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), + folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' + ), + folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -186,6 +192,12 @@ export class GroupServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), + organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' + ), + organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -210,6 +222,12 @@ export class GroupServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), + projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metricDescriptors/{metric_descriptor=**}' + ), + projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1251,6 +1269,78 @@ export class GroupServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } + /** + * Return a fully-qualified folderMetricDescriptor resource name string. + * + * @param {string} folder + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + folderMetricDescriptorPath(folder:string,metricDescriptor:string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ + folder: folder, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the folder from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; + } + + /** + * Parse the metric_descriptor from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. + * + * @param {string} folder + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ + folder: folder, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the folder from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; + } + + /** + * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1565,6 +1655,78 @@ export class GroupServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } + /** + * Return a fully-qualified organizationMetricDescriptor resource name string. + * + * @param {string} organization + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ + organization: organization, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; + } + + /** + * Parse the metric_descriptor from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. + * + * @param {string} organization + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ + organization: organization, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; + } + + /** + * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -1879,6 +2041,78 @@ export class GroupServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } + /** + * Return a fully-qualified projectMetricDescriptor resource name string. + * + * @param {string} project + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + projectMetricDescriptorPath(project:string,metricDescriptor:string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ + project: project, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the project from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; + } + + /** + * Parse the metric_descriptor from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. + * + * @param {string} project + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ + project: project, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the project from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; + } + + /** + * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline b/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline index 2d38fa7e7..2be39f903 100644 --- a/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline @@ -152,6 +152,12 @@ export class NotificationChannelServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), + folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' + ), + folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -176,6 +182,12 @@ export class NotificationChannelServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), + organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' + ), + organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -200,6 +212,12 @@ export class NotificationChannelServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), + projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metricDescriptors/{metric_descriptor=**}' + ), + projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1569,6 +1587,78 @@ export class NotificationChannelServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } + /** + * Return a fully-qualified folderMetricDescriptor resource name string. + * + * @param {string} folder + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + folderMetricDescriptorPath(folder:string,metricDescriptor:string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ + folder: folder, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the folder from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; + } + + /** + * Parse the metric_descriptor from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. + * + * @param {string} folder + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ + folder: folder, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the folder from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; + } + + /** + * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1883,6 +1973,78 @@ export class NotificationChannelServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } + /** + * Return a fully-qualified organizationMetricDescriptor resource name string. + * + * @param {string} organization + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ + organization: organization, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; + } + + /** + * Parse the metric_descriptor from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. + * + * @param {string} organization + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ + organization: organization, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; + } + + /** + * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -2197,6 +2359,78 @@ export class NotificationChannelServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } + /** + * Return a fully-qualified projectMetricDescriptor resource name string. + * + * @param {string} project + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + projectMetricDescriptorPath(project:string,metricDescriptor:string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ + project: project, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the project from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; + } + + /** + * Parse the metric_descriptor from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. + * + * @param {string} project + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ + project: project, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the project from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; + } + + /** + * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline b/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline index 96d611668..a5e5d4324 100644 --- a/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline @@ -154,6 +154,12 @@ export class ServiceMonitoringServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), + folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' + ), + folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -178,6 +184,12 @@ export class ServiceMonitoringServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), + organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' + ), + organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -202,6 +214,12 @@ export class ServiceMonitoringServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), + projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metricDescriptors/{metric_descriptor=**}' + ), + projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1518,6 +1536,78 @@ export class ServiceMonitoringServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } + /** + * Return a fully-qualified folderMetricDescriptor resource name string. + * + * @param {string} folder + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + folderMetricDescriptorPath(folder:string,metricDescriptor:string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ + folder: folder, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the folder from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; + } + + /** + * Parse the metric_descriptor from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. + * + * @param {string} folder + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ + folder: folder, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the folder from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; + } + + /** + * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1832,6 +1922,78 @@ export class ServiceMonitoringServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } + /** + * Return a fully-qualified organizationMetricDescriptor resource name string. + * + * @param {string} organization + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ + organization: organization, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; + } + + /** + * Parse the metric_descriptor from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. + * + * @param {string} organization + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ + organization: organization, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; + } + + /** + * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -2146,6 +2308,78 @@ export class ServiceMonitoringServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } + /** + * Return a fully-qualified projectMetricDescriptor resource name string. + * + * @param {string} project + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + projectMetricDescriptorPath(project:string,metricDescriptor:string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ + project: project, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the project from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; + } + + /** + * Parse the metric_descriptor from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. + * + * @param {string} project + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ + project: project, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the project from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; + } + + /** + * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline b/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline index 92104e070..3a5fc0185 100644 --- a/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline @@ -158,6 +158,12 @@ export class UptimeCheckServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), + folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' + ), + folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -182,6 +188,12 @@ export class UptimeCheckServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), + organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' + ), + organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -206,6 +218,12 @@ export class UptimeCheckServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), + projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metricDescriptors/{metric_descriptor=**}' + ), + projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1167,6 +1185,78 @@ export class UptimeCheckServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } + /** + * Return a fully-qualified folderMetricDescriptor resource name string. + * + * @param {string} folder + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + folderMetricDescriptorPath(folder:string,metricDescriptor:string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ + folder: folder, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the folder from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; + } + + /** + * Parse the metric_descriptor from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { + return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. + * + * @param {string} folder + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ + folder: folder, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the folder from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; + } + + /** + * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { + return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1481,6 +1571,78 @@ export class UptimeCheckServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } + /** + * Return a fully-qualified organizationMetricDescriptor resource name string. + * + * @param {string} organization + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ + organization: organization, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; + } + + /** + * Parse the metric_descriptor from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { + return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. + * + * @param {string} organization + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ + organization: organization, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; + } + + /** + * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { + return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -1795,6 +1957,78 @@ export class UptimeCheckServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } + /** + * Return a fully-qualified projectMetricDescriptor resource name string. + * + * @param {string} project + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + projectMetricDescriptorPath(project:string,metricDescriptor:string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ + project: project, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the project from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; + } + + /** + * Parse the metric_descriptor from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { + return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; + } + + /** + * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. + * + * @param {string} project + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ + project: project, + monitored_resource_descriptor: monitoredResourceDescriptor, + }); + } + + /** + * Parse the project from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; + } + + /** + * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { + return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; + } + /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline b/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline index 0980dc511..aad8de4b3 100644 --- a/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline @@ -888,6 +888,82 @@ describe('v3.AlertPolicyServiceClient', () => { }); }); + describe('folderMetricDescriptor', () => { + const fakePath = "/rendered/path/folderMetricDescriptor"; + const expectedParameters = { + folder: "folderValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMetricDescriptorPath', () => { + const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMetricDescriptorName', () => { + const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; + const expectedParameters = { + folder: "folderValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMonitoredResourceDescriptorPath', () => { + const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1208,6 +1284,82 @@ describe('v3.AlertPolicyServiceClient', () => { }); }); + describe('organizationMetricDescriptor', () => { + const fakePath = "/rendered/path/organizationMetricDescriptor"; + const expectedParameters = { + organization: "organizationValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMetricDescriptorPath', () => { + const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMetricDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; + const expectedParameters = { + organization: "organizationValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMonitoredResourceDescriptorPath', () => { + const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -1528,6 +1680,82 @@ describe('v3.AlertPolicyServiceClient', () => { }); }); + describe('projectMetricDescriptor', () => { + const fakePath = "/rendered/path/projectMetricDescriptor"; + const expectedParameters = { + project: "projectValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMetricDescriptorPath', () => { + const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMetricDescriptorName', () => { + const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; + const expectedParameters = { + project: "projectValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMonitoredResourceDescriptorPath', () => { + const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_group_service_v3.ts.baseline b/baselines/monitoring/test/gapic_group_service_v3.ts.baseline index 228f315a4..501282130 100644 --- a/baselines/monitoring/test/gapic_group_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_group_service_v3.ts.baseline @@ -1110,6 +1110,82 @@ describe('v3.GroupServiceClient', () => { }); }); + describe('folderMetricDescriptor', () => { + const fakePath = "/rendered/path/folderMetricDescriptor"; + const expectedParameters = { + folder: "folderValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMetricDescriptorPath', () => { + const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMetricDescriptorName', () => { + const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; + const expectedParameters = { + folder: "folderValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMonitoredResourceDescriptorPath', () => { + const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1430,6 +1506,82 @@ describe('v3.GroupServiceClient', () => { }); }); + describe('organizationMetricDescriptor', () => { + const fakePath = "/rendered/path/organizationMetricDescriptor"; + const expectedParameters = { + organization: "organizationValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMetricDescriptorPath', () => { + const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMetricDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; + const expectedParameters = { + organization: "organizationValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMonitoredResourceDescriptorPath', () => { + const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -1750,6 +1902,82 @@ describe('v3.GroupServiceClient', () => { }); }); + describe('projectMetricDescriptor', () => { + const fakePath = "/rendered/path/projectMetricDescriptor"; + const expectedParameters = { + project: "projectValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMetricDescriptorPath', () => { + const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMetricDescriptorName', () => { + const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; + const expectedParameters = { + project: "projectValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMonitoredResourceDescriptorPath', () => { + const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline b/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline index 5e0095a5e..614178261 100644 --- a/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline @@ -1446,6 +1446,82 @@ describe('v3.NotificationChannelServiceClient', () => { }); }); + describe('folderMetricDescriptor', () => { + const fakePath = "/rendered/path/folderMetricDescriptor"; + const expectedParameters = { + folder: "folderValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMetricDescriptorPath', () => { + const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMetricDescriptorName', () => { + const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; + const expectedParameters = { + folder: "folderValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMonitoredResourceDescriptorPath', () => { + const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1766,6 +1842,82 @@ describe('v3.NotificationChannelServiceClient', () => { }); }); + describe('organizationMetricDescriptor', () => { + const fakePath = "/rendered/path/organizationMetricDescriptor"; + const expectedParameters = { + organization: "organizationValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMetricDescriptorPath', () => { + const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMetricDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; + const expectedParameters = { + organization: "organizationValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMonitoredResourceDescriptorPath', () => { + const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -2086,6 +2238,82 @@ describe('v3.NotificationChannelServiceClient', () => { }); }); + describe('projectMetricDescriptor', () => { + const fakePath = "/rendered/path/projectMetricDescriptor"; + const expectedParameters = { + project: "projectValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMetricDescriptorPath', () => { + const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMetricDescriptorName', () => { + const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; + const expectedParameters = { + project: "projectValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMonitoredResourceDescriptorPath', () => { + const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline b/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline index 579d359c0..6c09e7d0a 100644 --- a/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline @@ -1449,6 +1449,82 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); }); + describe('folderMetricDescriptor', () => { + const fakePath = "/rendered/path/folderMetricDescriptor"; + const expectedParameters = { + folder: "folderValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMetricDescriptorPath', () => { + const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMetricDescriptorName', () => { + const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; + const expectedParameters = { + folder: "folderValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMonitoredResourceDescriptorPath', () => { + const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1769,6 +1845,82 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); }); + describe('organizationMetricDescriptor', () => { + const fakePath = "/rendered/path/organizationMetricDescriptor"; + const expectedParameters = { + organization: "organizationValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMetricDescriptorPath', () => { + const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMetricDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; + const expectedParameters = { + organization: "organizationValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMonitoredResourceDescriptorPath', () => { + const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -2089,6 +2241,82 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); }); + describe('projectMetricDescriptor', () => { + const fakePath = "/rendered/path/projectMetricDescriptor"; + const expectedParameters = { + project: "projectValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMetricDescriptorPath', () => { + const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMetricDescriptorName', () => { + const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; + const expectedParameters = { + project: "projectValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMonitoredResourceDescriptorPath', () => { + const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline b/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline index 24339c0af..e95f29608 100644 --- a/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline @@ -1058,6 +1058,82 @@ describe('v3.UptimeCheckServiceClient', () => { }); }); + describe('folderMetricDescriptor', () => { + const fakePath = "/rendered/path/folderMetricDescriptor"; + const expectedParameters = { + folder: "folderValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMetricDescriptorPath', () => { + const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMetricDescriptorName', () => { + const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; + const expectedParameters = { + folder: "folderValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMonitoredResourceDescriptorPath', () => { + const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1378,6 +1454,82 @@ describe('v3.UptimeCheckServiceClient', () => { }); }); + describe('organizationMetricDescriptor', () => { + const fakePath = "/rendered/path/organizationMetricDescriptor"; + const expectedParameters = { + organization: "organizationValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMetricDescriptorPath', () => { + const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMetricDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; + const expectedParameters = { + organization: "organizationValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMonitoredResourceDescriptorPath', () => { + const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -1698,6 +1850,82 @@ describe('v3.UptimeCheckServiceClient', () => { }); }); + describe('projectMetricDescriptor', () => { + const fakePath = "/rendered/path/projectMetricDescriptor"; + const expectedParameters = { + project: "projectValue", + metric_descriptor: "metricDescriptorValue", + }; + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMetricDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMetricDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMetricDescriptorPath', () => { + const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMetricDescriptorName', () => { + const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { + const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); + assert.strictEqual(result, "metricDescriptorValue"); + assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectMonitoredResourceDescriptor', () => { + const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; + const expectedParameters = { + project: "projectValue", + monitored_resource_descriptor: "monitoredResourceDescriptorValue", + }; + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMonitoredResourceDescriptorPath', () => { + const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { + const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); + assert.strictEqual(result, "monitoredResourceDescriptorValue"); + assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/package.json b/package.json index 727dd84de..66b74887c 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "@types/nunjucks": "^3.1.3", "@types/object-hash": "^1.3.1", "@types/rimraf": "^3.0.0", + "@types/sinon": "^9.0.0", "@types/yargs": "^15.0.4", "assert-rejects": "^1.0.0", "c8": "^7.1.0", @@ -68,6 +69,7 @@ "mocha": "^7.1.1", "ncp": "^2.0.0", "rimraf": "^3.0.2", + "sinon": "^9.0.2", "typescript": "~3.8.3" }, "engines": { diff --git a/typescript/src/schema/api.ts b/typescript/src/schema/api.ts index bd674406e..e57f329a9 100644 --- a/typescript/src/schema/api.ts +++ b/typescript/src/schema/api.ts @@ -15,7 +15,7 @@ import * as plugin from '../../../pbjs-genfiles/plugin'; import {Naming, Options as namingOptions} from './naming'; -import {Proto} from './proto'; +import {Proto, MessagesMap} from './proto'; import {ResourceDatabase, ResourceDescriptor} from './resource-database'; export interface ProtosMap { @@ -59,11 +59,20 @@ export class API { // users specify the actual package name, if not, set it to product name. this.publishName = options.publishName || this.naming.productName.toKebabCase(); - // construct resource map + const [allResourceDatabase, resourceDatabase] = getResourceDatabase( fileDescriptors ); - // parse resource map to Proto constructor + + const allMessages: MessagesMap = {}; + for (const fd of fileDescriptors) { + fd.messageType + ?.filter(message => message.name) + .forEach(message => { + allMessages['.' + fd.package! + '.' + message.name!] = message; + }); + } + this.protos = fileDescriptors .filter(fd => fd.name) .filter(fd => !API.isIgnoredService(fd)) @@ -71,6 +80,7 @@ export class API { map[fd.name!] = new Proto( fd, packageName, + allMessages, allResourceDatabase, resourceDatabase, options diff --git a/typescript/src/schema/proto.ts b/typescript/src/schema/proto.ts index d76b22ce8..e7ca85d61 100644 --- a/typescript/src/schema/proto.ts +++ b/typescript/src/schema/proto.ts @@ -85,10 +85,6 @@ export interface MessagesMap { [name: string]: plugin.google.protobuf.IDescriptorProto; } -export interface EnumsMap { - [name: string]: plugin.google.protobuf.IEnumDescriptorProto; -} - // The following functions are used to add some metadata such as idempotence // flag, long running operation info, pagination, and streaming, to all the // methods of the given service, to use in templates. @@ -566,7 +562,6 @@ export class Proto { filePB2: plugin.google.protobuf.IFileDescriptorProto; services: ServicesMap = {}; messages: MessagesMap = {}; - enums: EnumsMap = {}; fileToGenerate: boolean; // TODO: need to store metadata? address? @@ -575,29 +570,15 @@ export class Proto { constructor( fd: plugin.google.protobuf.IFileDescriptorProto, packageName: string, + allMessages: MessagesMap, allResourceDatabase: ResourceDatabase, resourceDatabase: ResourceDatabase, options: Options ) { - fd.enumType = fd.enumType || []; - fd.messageType = fd.messageType || []; fd.service = fd.service || []; this.filePB2 = fd; - - this.messages = fd.messageType - .filter(message => message.name) - .reduce((map, message) => { - map['.' + fd.package! + '.' + message.name!] = message; - return map; - }, {} as MessagesMap); - - this.enums = fd.enumType - .filter(enum_ => enum_.name) - .reduce((map, enum_) => { - map[enum_.name!] = enum_; - return map; - }, {} as EnumsMap); + this.messages = allMessages; this.fileToGenerate = fd.package ? fd.package.startsWith(packageName) : false; diff --git a/typescript/test/unit/api.ts b/typescript/test/unit/api.ts index 0750dab2e..d96c2e335 100644 --- a/typescript/test/unit/api.ts +++ b/typescript/test/unit/api.ts @@ -15,7 +15,9 @@ import {API} from '../../src/schema/api'; import * as plugin from '../../../pbjs-genfiles/plugin'; import * as assert from 'assert'; -import {describe, it} from 'mocha'; +import {afterEach, describe, it} from 'mocha'; +import * as sinon from 'sinon'; +import * as proto from '../../src/schema/proto'; describe('src/schema/api.ts', () => { it('should construct an API object and return list of protos', () => { @@ -157,4 +159,45 @@ describe('src/schema/api.ts', () => { assert(api); }); }); + + describe('Calling Proto constructor', () => { + afterEach(() => { + sinon.restore(); + }); + + it('should pass all messages to Proto constructor', () => { + const fd1 = new plugin.google.protobuf.FileDescriptorProto(); + fd1.name = 'google/cloud/example/v1/test.proto'; + fd1.package = 'google.cloud.example.v1'; + + fd1.service = [new plugin.google.protobuf.ServiceDescriptorProto()]; + fd1.service[0].name = 'Service'; + fd1.service[0].options = { + '.google.api.defaultHost': 'hostname.example.com:443', + }; + fd1.messageType = [new plugin.google.protobuf.MethodDescriptorProto()]; + fd1.messageType[0].name = 'MessageA'; + + const fd2 = new plugin.google.protobuf.FileDescriptorProto(); + fd2.name = 'google/cloud/example/v1/example.proto'; + fd2.package = 'google.cloud.example.v1'; + fd2.messageType = [new plugin.google.protobuf.MethodDescriptorProto()]; + fd2.messageType[0].name = 'MessageB'; + + const spy = sinon.spy(proto, 'Proto'); + + new API([fd1, fd2], 'google.cloud.example.v1', { + grpcServiceConfig: new plugin.grpc.service_config.ServiceConfig(), + }); + + assert(spy.calledWithNew()); + assert.strictEqual(spy.callCount, 2); // one Proto object created for each fd + const firstCallMessages = spy.getCall(0).args[2]; + const secondCallMessages = spy.getCall(1).args[2]; + assert('.google.cloud.example.v1.MessageA' in firstCallMessages); + assert('.google.cloud.example.v1.MessageB' in firstCallMessages); + assert('.google.cloud.example.v1.MessageA' in secondCallMessages); + assert('.google.cloud.example.v1.MessageB' in secondCallMessages); + }); + }); }); diff --git a/typescript/test/unit/proto.ts b/typescript/test/unit/proto.ts index 9119637c5..fb2490e0f 100644 --- a/typescript/test/unit/proto.ts +++ b/typescript/test/unit/proto.ts @@ -15,7 +15,7 @@ import * as assert from 'assert'; import {describe, it} from 'mocha'; import * as plugin from '../../../pbjs-genfiles/plugin'; -import {getHeaderRequestParams} from '../../src/schema/proto'; +import {getHeaderRequestParams, MessagesMap} from '../../src/schema/proto'; import {Proto} from '../../src/schema/proto'; import {Options} from '../../src/schema/naming'; @@ -96,6 +96,7 @@ describe('src/schema/proto.ts', () => { ); }); }); + describe('special work around for talent API', () => { it('The pagingFieldName should be undefined for SearchJobs & SearchProfiles rpc', () => { const fd = new plugin.google.protobuf.FileDescriptorProto(); @@ -141,9 +142,16 @@ describe('src/schema/proto.ts', () => { const options: Options = { grpcServiceConfig: new plugin.grpc.service_config.ServiceConfig(), }; + const allMessages: MessagesMap = {}; + fd.messageType + .filter(message => message.name) + .forEach(message => { + allMessages['.' + fd.package! + '.' + message.name!] = message; + }); const proto = new Proto( fd, 'google.cloud.talent.v4beta1', + allMessages, new ResourceDatabase(), new ResourceDatabase(), options From 01ae6adadbc3b4b71e7c9aff523f4ff72c7d59e2 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 14 Apr 2020 11:57:00 -0700 Subject: [PATCH 2/2] fix: use local messages for resources --- .../v2/logging_service_v2_client.ts.baseline | 39 --- .../v2/metrics_service_v2_client.ts.baseline | 39 --- .../gapic_logging_service_v2_v2.ts.baseline | 38 --- .../gapic_metrics_service_v2_v2.ts.baseline | 38 --- .../alert_policy_service_client.ts.baseline | 234 ------------------ .../src/v3/group_service_client.ts.baseline | 234 ------------------ ...ication_channel_service_client.ts.baseline | 234 ------------------ ...vice_monitoring_service_client.ts.baseline | 234 ------------------ .../uptime_check_service_client.ts.baseline | 234 ------------------ .../gapic_alert_policy_service_v3.ts.baseline | 228 ----------------- .../test/gapic_group_service_v3.ts.baseline | 228 ----------------- ...otification_channel_service_v3.ts.baseline | 228 ----------------- ..._service_monitoring_service_v3.ts.baseline | 228 ----------------- .../gapic_uptime_check_service_v3.ts.baseline | 228 ----------------- typescript/src/schema/api.ts | 6 +- typescript/src/schema/proto.ts | 165 +++++++----- typescript/test/unit/api.ts | 4 +- typescript/test/unit/proto.ts | 12 +- 18 files changed, 110 insertions(+), 2541 deletions(-) diff --git a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline index 9a777fea7..a6cbe68e2 100644 --- a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline @@ -169,9 +169,6 @@ export class LoggingServiceV2Client { folderSinkPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sinks/{sink}' ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), logMetricPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/metrics/{metric}' ), @@ -1554,42 +1551,6 @@ export class LoggingServiceV2Client { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; } - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - /** * Return a fully-qualified logMetric resource name string. * diff --git a/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline b/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline index 86199d832..db427859a 100644 --- a/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline @@ -169,9 +169,6 @@ export class MetricsServiceV2Client { folderSinkPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sinks/{sink}' ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), logMetricPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/metrics/{metric}' ), @@ -1188,42 +1185,6 @@ export class MetricsServiceV2Client { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; } - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - /** * Return a fully-qualified logMetric resource name string. * diff --git a/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline b/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline index cbbe6a79e..b557ef104 100644 --- a/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline +++ b/baselines/logging/test/gapic_logging_service_v2_v2.ts.baseline @@ -1237,44 +1237,6 @@ describe('v2.LoggingServiceV2Client', () => { }); }); - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('logMetric', () => { const fakePath = "/rendered/path/logMetric"; const expectedParameters = { diff --git a/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline b/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline index f997da95b..20f30d90c 100644 --- a/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline +++ b/baselines/logging/test/gapic_metrics_service_v2_v2.ts.baseline @@ -1105,44 +1105,6 @@ describe('v2.MetricsServiceV2Client', () => { }); }); - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('logMetric', () => { const fakePath = "/rendered/path/logMetric"; const expectedParameters = { diff --git a/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline b/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline index 398dccbac..3109714fe 100644 --- a/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline @@ -159,12 +159,6 @@ export class AlertPolicyServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), - folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' - ), - folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -189,12 +183,6 @@ export class AlertPolicyServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' - ), - organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -219,12 +207,6 @@ export class AlertPolicyServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), - projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/metricDescriptors/{metric_descriptor=**}' - ), - projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1086,78 +1068,6 @@ export class AlertPolicyServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } - /** - * Return a fully-qualified folderMetricDescriptor resource name string. - * - * @param {string} folder - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - folderMetricDescriptorPath(folder:string,metricDescriptor:string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ - folder: folder, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the folder from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; - } - - /** - * Parse the metric_descriptor from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. - * - * @param {string} folder - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ - folder: folder, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the folder from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; - } - - /** - * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1472,78 +1382,6 @@ export class AlertPolicyServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } - /** - * Return a fully-qualified organizationMetricDescriptor resource name string. - * - * @param {string} organization - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ - organization: organization, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; - } - - /** - * Parse the metric_descriptor from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. - * - * @param {string} organization - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ - organization: organization, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; - } - - /** - * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -1858,78 +1696,6 @@ export class AlertPolicyServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } - /** - * Return a fully-qualified projectMetricDescriptor resource name string. - * - * @param {string} project - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - projectMetricDescriptorPath(project:string,metricDescriptor:string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ - project: project, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the project from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; - } - - /** - * Parse the metric_descriptor from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. - * - * @param {string} project - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ - project: project, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the project from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; - } - - /** - * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/group_service_client.ts.baseline b/baselines/monitoring/src/v3/group_service_client.ts.baseline index eda389c22..4cabc33c6 100644 --- a/baselines/monitoring/src/v3/group_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/group_service_client.ts.baseline @@ -162,12 +162,6 @@ export class GroupServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), - folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' - ), - folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -192,12 +186,6 @@ export class GroupServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' - ), - organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -222,12 +210,6 @@ export class GroupServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), - projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/metricDescriptors/{metric_descriptor=**}' - ), - projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1269,78 +1251,6 @@ export class GroupServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } - /** - * Return a fully-qualified folderMetricDescriptor resource name string. - * - * @param {string} folder - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - folderMetricDescriptorPath(folder:string,metricDescriptor:string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ - folder: folder, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the folder from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; - } - - /** - * Parse the metric_descriptor from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. - * - * @param {string} folder - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ - folder: folder, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the folder from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; - } - - /** - * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1655,78 +1565,6 @@ export class GroupServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } - /** - * Return a fully-qualified organizationMetricDescriptor resource name string. - * - * @param {string} organization - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ - organization: organization, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; - } - - /** - * Parse the metric_descriptor from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. - * - * @param {string} organization - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ - organization: organization, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; - } - - /** - * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -2041,78 +1879,6 @@ export class GroupServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } - /** - * Return a fully-qualified projectMetricDescriptor resource name string. - * - * @param {string} project - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - projectMetricDescriptorPath(project:string,metricDescriptor:string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ - project: project, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the project from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; - } - - /** - * Parse the metric_descriptor from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. - * - * @param {string} project - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ - project: project, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the project from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; - } - - /** - * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline b/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline index 2be39f903..2d38fa7e7 100644 --- a/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline @@ -152,12 +152,6 @@ export class NotificationChannelServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), - folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' - ), - folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -182,12 +176,6 @@ export class NotificationChannelServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' - ), - organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -212,12 +200,6 @@ export class NotificationChannelServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), - projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/metricDescriptors/{metric_descriptor=**}' - ), - projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1587,78 +1569,6 @@ export class NotificationChannelServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } - /** - * Return a fully-qualified folderMetricDescriptor resource name string. - * - * @param {string} folder - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - folderMetricDescriptorPath(folder:string,metricDescriptor:string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ - folder: folder, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the folder from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; - } - - /** - * Parse the metric_descriptor from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. - * - * @param {string} folder - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ - folder: folder, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the folder from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; - } - - /** - * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1973,78 +1883,6 @@ export class NotificationChannelServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } - /** - * Return a fully-qualified organizationMetricDescriptor resource name string. - * - * @param {string} organization - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ - organization: organization, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; - } - - /** - * Parse the metric_descriptor from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. - * - * @param {string} organization - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ - organization: organization, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; - } - - /** - * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -2359,78 +2197,6 @@ export class NotificationChannelServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } - /** - * Return a fully-qualified projectMetricDescriptor resource name string. - * - * @param {string} project - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - projectMetricDescriptorPath(project:string,metricDescriptor:string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ - project: project, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the project from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; - } - - /** - * Parse the metric_descriptor from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. - * - * @param {string} project - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ - project: project, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the project from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; - } - - /** - * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline b/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline index a5e5d4324..96d611668 100644 --- a/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline @@ -154,12 +154,6 @@ export class ServiceMonitoringServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), - folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' - ), - folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -184,12 +178,6 @@ export class ServiceMonitoringServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' - ), - organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -214,12 +202,6 @@ export class ServiceMonitoringServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), - projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/metricDescriptors/{metric_descriptor=**}' - ), - projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1536,78 +1518,6 @@ export class ServiceMonitoringServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } - /** - * Return a fully-qualified folderMetricDescriptor resource name string. - * - * @param {string} folder - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - folderMetricDescriptorPath(folder:string,metricDescriptor:string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ - folder: folder, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the folder from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; - } - - /** - * Parse the metric_descriptor from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. - * - * @param {string} folder - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ - folder: folder, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the folder from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; - } - - /** - * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1922,78 +1832,6 @@ export class ServiceMonitoringServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } - /** - * Return a fully-qualified organizationMetricDescriptor resource name string. - * - * @param {string} organization - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ - organization: organization, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; - } - - /** - * Parse the metric_descriptor from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. - * - * @param {string} organization - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ - organization: organization, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; - } - - /** - * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -2308,78 +2146,6 @@ export class ServiceMonitoringServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } - /** - * Return a fully-qualified projectMetricDescriptor resource name string. - * - * @param {string} project - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - projectMetricDescriptorPath(project:string,metricDescriptor:string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ - project: project, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the project from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; - } - - /** - * Parse the metric_descriptor from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. - * - * @param {string} project - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ - project: project, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the project from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; - } - - /** - * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline b/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline index 3a5fc0185..92104e070 100644 --- a/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline @@ -158,12 +158,6 @@ export class UptimeCheckServiceClient { folderGroupPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/groups/{group}' ), - folderMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' - ), - folderMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), folderNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/notificationChannels/{notification_channel}' ), @@ -188,12 +182,6 @@ export class UptimeCheckServiceClient { organizationGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/groups/{group}' ), - organizationMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' - ), - organizationMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), organizationNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationChannels/{notification_channel}' ), @@ -218,12 +206,6 @@ export class UptimeCheckServiceClient { projectGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/groups/{group}' ), - projectMetricDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/metricDescriptors/{metric_descriptor=**}' - ), - projectMonitoredResourceDescriptorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), projectNotificationChannelPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/notificationChannels/{notification_channel}' ), @@ -1185,78 +1167,6 @@ export class UptimeCheckServiceClient { return this.pathTemplates.folderGroupPathTemplate.match(folderGroupName).group; } - /** - * Return a fully-qualified folderMetricDescriptor resource name string. - * - * @param {string} folder - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - folderMetricDescriptorPath(folder:string,metricDescriptor:string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.render({ - folder: folder, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the folder from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).folder; - } - - /** - * Parse the metric_descriptor from FolderMetricDescriptor resource. - * - * @param {string} folderMetricDescriptorName - * A fully-qualified path representing folder_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromFolderMetricDescriptorName(folderMetricDescriptorName: string) { - return this.pathTemplates.folderMetricDescriptorPathTemplate.match(folderMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. - * - * @param {string} folder - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - folderMonitoredResourceDescriptorPath(folder:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render({ - folder: folder, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the folder from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).folder; - } - - /** - * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. - * - * @param {string} folderMonitoredResourceDescriptorName - * A fully-qualified path representing folder_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(folderMonitoredResourceDescriptorName: string) { - return this.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match(folderMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified folderNotificationChannel resource name string. * @@ -1571,78 +1481,6 @@ export class UptimeCheckServiceClient { return this.pathTemplates.organizationGroupPathTemplate.match(organizationGroupName).group; } - /** - * Return a fully-qualified organizationMetricDescriptor resource name string. - * - * @param {string} organization - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - organizationMetricDescriptorPath(organization:string,metricDescriptor:string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.render({ - organization: organization, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).organization; - } - - /** - * Parse the metric_descriptor from OrganizationMetricDescriptor resource. - * - * @param {string} organizationMetricDescriptorName - * A fully-qualified path representing organization_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromOrganizationMetricDescriptorName(organizationMetricDescriptorName: string) { - return this.pathTemplates.organizationMetricDescriptorPathTemplate.match(organizationMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. - * - * @param {string} organization - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - organizationMonitoredResourceDescriptorPath(organization:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render({ - organization: organization, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the organization from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).organization; - } - - /** - * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. - * - * @param {string} organizationMonitoredResourceDescriptorName - * A fully-qualified path representing organization_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(organizationMonitoredResourceDescriptorName: string) { - return this.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match(organizationMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified organizationNotificationChannel resource name string. * @@ -1957,78 +1795,6 @@ export class UptimeCheckServiceClient { return this.pathTemplates.projectGroupPathTemplate.match(projectGroupName).group; } - /** - * Return a fully-qualified projectMetricDescriptor resource name string. - * - * @param {string} project - * @param {string} metric_descriptor - * @returns {string} Resource name string. - */ - projectMetricDescriptorPath(project:string,metricDescriptor:string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.render({ - project: project, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Parse the project from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).project; - } - - /** - * Parse the metric_descriptor from ProjectMetricDescriptor resource. - * - * @param {string} projectMetricDescriptorName - * A fully-qualified path representing project_metric_descriptor resource. - * @returns {string} A string representing the metric_descriptor. - */ - matchMetricDescriptorFromProjectMetricDescriptorName(projectMetricDescriptorName: string) { - return this.pathTemplates.projectMetricDescriptorPathTemplate.match(projectMetricDescriptorName).metric_descriptor; - } - - /** - * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. - * - * @param {string} project - * @param {string} monitored_resource_descriptor - * @returns {string} Resource name string. - */ - projectMonitoredResourceDescriptorPath(project:string,monitoredResourceDescriptor:string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render({ - project: project, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Parse the project from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).project; - } - - /** - * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. - * - * @param {string} projectMonitoredResourceDescriptorName - * A fully-qualified path representing project_monitored_resource_descriptor resource. - * @returns {string} A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(projectMonitoredResourceDescriptorName: string) { - return this.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match(projectMonitoredResourceDescriptorName).monitored_resource_descriptor; - } - /** * Return a fully-qualified projectNotificationChannel resource name string. * diff --git a/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline b/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline index aad8de4b3..0980dc511 100644 --- a/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_alert_policy_service_v3.ts.baseline @@ -888,82 +888,6 @@ describe('v3.AlertPolicyServiceClient', () => { }); }); - describe('folderMetricDescriptor', () => { - const fakePath = "/rendered/path/folderMetricDescriptor"; - const expectedParameters = { - folder: "folderValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMetricDescriptorPath', () => { - const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMetricDescriptorName', () => { - const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; - const expectedParameters = { - folder: "folderValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMonitoredResourceDescriptorPath', () => { - const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1284,82 +1208,6 @@ describe('v3.AlertPolicyServiceClient', () => { }); }); - describe('organizationMetricDescriptor', () => { - const fakePath = "/rendered/path/organizationMetricDescriptor"; - const expectedParameters = { - organization: "organizationValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMetricDescriptorPath', () => { - const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMetricDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; - const expectedParameters = { - organization: "organizationValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMonitoredResourceDescriptorPath', () => { - const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -1680,82 +1528,6 @@ describe('v3.AlertPolicyServiceClient', () => { }); }); - describe('projectMetricDescriptor', () => { - const fakePath = "/rendered/path/projectMetricDescriptor"; - const expectedParameters = { - project: "projectValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMetricDescriptorPath', () => { - const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMetricDescriptorName', () => { - const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; - const expectedParameters = { - project: "projectValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMonitoredResourceDescriptorPath', () => { - const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_group_service_v3.ts.baseline b/baselines/monitoring/test/gapic_group_service_v3.ts.baseline index 501282130..228f315a4 100644 --- a/baselines/monitoring/test/gapic_group_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_group_service_v3.ts.baseline @@ -1110,82 +1110,6 @@ describe('v3.GroupServiceClient', () => { }); }); - describe('folderMetricDescriptor', () => { - const fakePath = "/rendered/path/folderMetricDescriptor"; - const expectedParameters = { - folder: "folderValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new groupserviceModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMetricDescriptorPath', () => { - const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMetricDescriptorName', () => { - const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; - const expectedParameters = { - folder: "folderValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new groupserviceModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMonitoredResourceDescriptorPath', () => { - const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1506,82 +1430,6 @@ describe('v3.GroupServiceClient', () => { }); }); - describe('organizationMetricDescriptor', () => { - const fakePath = "/rendered/path/organizationMetricDescriptor"; - const expectedParameters = { - organization: "organizationValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new groupserviceModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMetricDescriptorPath', () => { - const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMetricDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; - const expectedParameters = { - organization: "organizationValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new groupserviceModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMonitoredResourceDescriptorPath', () => { - const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -1902,82 +1750,6 @@ describe('v3.GroupServiceClient', () => { }); }); - describe('projectMetricDescriptor', () => { - const fakePath = "/rendered/path/projectMetricDescriptor"; - const expectedParameters = { - project: "projectValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new groupserviceModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMetricDescriptorPath', () => { - const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMetricDescriptorName', () => { - const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; - const expectedParameters = { - project: "projectValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new groupserviceModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMonitoredResourceDescriptorPath', () => { - const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline b/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline index 614178261..5e0095a5e 100644 --- a/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_notification_channel_service_v3.ts.baseline @@ -1446,82 +1446,6 @@ describe('v3.NotificationChannelServiceClient', () => { }); }); - describe('folderMetricDescriptor', () => { - const fakePath = "/rendered/path/folderMetricDescriptor"; - const expectedParameters = { - folder: "folderValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMetricDescriptorPath', () => { - const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMetricDescriptorName', () => { - const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; - const expectedParameters = { - folder: "folderValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMonitoredResourceDescriptorPath', () => { - const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1842,82 +1766,6 @@ describe('v3.NotificationChannelServiceClient', () => { }); }); - describe('organizationMetricDescriptor', () => { - const fakePath = "/rendered/path/organizationMetricDescriptor"; - const expectedParameters = { - organization: "organizationValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMetricDescriptorPath', () => { - const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMetricDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; - const expectedParameters = { - organization: "organizationValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMonitoredResourceDescriptorPath', () => { - const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -2238,82 +2086,6 @@ describe('v3.NotificationChannelServiceClient', () => { }); }); - describe('projectMetricDescriptor', () => { - const fakePath = "/rendered/path/projectMetricDescriptor"; - const expectedParameters = { - project: "projectValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMetricDescriptorPath', () => { - const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMetricDescriptorName', () => { - const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; - const expectedParameters = { - project: "projectValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMonitoredResourceDescriptorPath', () => { - const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline b/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline index 6c09e7d0a..579d359c0 100644 --- a/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_service_monitoring_service_v3.ts.baseline @@ -1449,82 +1449,6 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); }); - describe('folderMetricDescriptor', () => { - const fakePath = "/rendered/path/folderMetricDescriptor"; - const expectedParameters = { - folder: "folderValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMetricDescriptorPath', () => { - const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMetricDescriptorName', () => { - const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; - const expectedParameters = { - folder: "folderValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMonitoredResourceDescriptorPath', () => { - const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1845,82 +1769,6 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); }); - describe('organizationMetricDescriptor', () => { - const fakePath = "/rendered/path/organizationMetricDescriptor"; - const expectedParameters = { - organization: "organizationValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMetricDescriptorPath', () => { - const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMetricDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; - const expectedParameters = { - organization: "organizationValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMonitoredResourceDescriptorPath', () => { - const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -2241,82 +2089,6 @@ describe('v3.ServiceMonitoringServiceClient', () => { }); }); - describe('projectMetricDescriptor', () => { - const fakePath = "/rendered/path/projectMetricDescriptor"; - const expectedParameters = { - project: "projectValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMetricDescriptorPath', () => { - const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMetricDescriptorName', () => { - const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; - const expectedParameters = { - project: "projectValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMonitoredResourceDescriptorPath', () => { - const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline b/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline index e95f29608..24339c0af 100644 --- a/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline +++ b/baselines/monitoring/test/gapic_uptime_check_service_v3.ts.baseline @@ -1058,82 +1058,6 @@ describe('v3.UptimeCheckServiceClient', () => { }); }); - describe('folderMetricDescriptor', () => { - const fakePath = "/rendered/path/folderMetricDescriptor"; - const expectedParameters = { - folder: "folderValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMetricDescriptorPath', () => { - const result = client.folderMetricDescriptorPath("folderValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMetricDescriptorName', () => { - const result = client.matchFolderFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromFolderMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromFolderMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.folderMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/folderMonitoredResourceDescriptor"; - const expectedParameters = { - folder: "folderValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMonitoredResourceDescriptorPath', () => { - const result = client.folderMonitoredResourceDescriptorPath("folderValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchFolderFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('folderNotificationChannel', () => { const fakePath = "/rendered/path/folderNotificationChannel"; const expectedParameters = { @@ -1454,82 +1378,6 @@ describe('v3.UptimeCheckServiceClient', () => { }); }); - describe('organizationMetricDescriptor', () => { - const fakePath = "/rendered/path/organizationMetricDescriptor"; - const expectedParameters = { - organization: "organizationValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMetricDescriptorPath', () => { - const result = client.organizationMetricDescriptorPath("organizationValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMetricDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromOrganizationMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromOrganizationMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.organizationMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/organizationMonitoredResourceDescriptor"; - const expectedParameters = { - organization: "organizationValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMonitoredResourceDescriptorPath', () => { - const result = client.organizationMonitoredResourceDescriptorPath("organizationValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchOrganizationFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('organizationNotificationChannel', () => { const fakePath = "/rendered/path/organizationNotificationChannel"; const expectedParameters = { @@ -1850,82 +1698,6 @@ describe('v3.UptimeCheckServiceClient', () => { }); }); - describe('projectMetricDescriptor', () => { - const fakePath = "/rendered/path/projectMetricDescriptor"; - const expectedParameters = { - project: "projectValue", - metric_descriptor: "metricDescriptorValue", - }; - const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMetricDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMetricDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMetricDescriptorPath', () => { - const result = client.projectMetricDescriptorPath("projectValue", "metricDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMetricDescriptorName', () => { - const result = client.matchProjectFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetricDescriptorFromProjectMetricDescriptorName', () => { - const result = client.matchMetricDescriptorFromProjectMetricDescriptorName(fakePath); - assert.strictEqual(result, "metricDescriptorValue"); - assert((client.pathTemplates.projectMetricDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectMonitoredResourceDescriptor', () => { - const fakePath = "/rendered/path/projectMonitoredResourceDescriptor"; - const expectedParameters = { - project: "projectValue", - monitored_resource_descriptor: "monitoredResourceDescriptorValue", - }; - const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMonitoredResourceDescriptorPath', () => { - const result = client.projectMonitoredResourceDescriptorPath("projectValue", "monitoredResourceDescriptorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchProjectFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName', () => { - const result = client.matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName(fakePath); - assert.strictEqual(result, "monitoredResourceDescriptorValue"); - assert((client.pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - describe('projectNotificationChannel', () => { const fakePath = "/rendered/path/projectNotificationChannel"; const expectedParameters = { diff --git a/typescript/src/schema/api.ts b/typescript/src/schema/api.ts index e57f329a9..35b2d2090 100644 --- a/typescript/src/schema/api.ts +++ b/typescript/src/schema/api.ts @@ -77,14 +77,14 @@ export class API { .filter(fd => fd.name) .filter(fd => !API.isIgnoredService(fd)) .reduce((map, fd) => { - map[fd.name!] = new Proto( + map[fd.name!] = new Proto({ fd, packageName, allMessages, allResourceDatabase, resourceDatabase, - options - ); + options, + }); return map; }, {} as ProtosMap); diff --git a/typescript/src/schema/proto.ts b/typescript/src/schema/proto.ts index e7ca85d61..5532c5a2b 100644 --- a/typescript/src/schema/proto.ts +++ b/typescript/src/schema/proto.ts @@ -287,34 +287,43 @@ function getMethodConfig( return result; } +interface AugmentMethodParameters { + allMessages: MessagesMap; + localMessages: MessagesMap; + service: ServiceDescriptorProto; +} + function augmentMethod( - messages: MessagesMap, - service: ServiceDescriptorProto, + parameters: AugmentMethodParameters, method: MethodDescriptorProto ) { method = Object.assign( { longRunning: longrunning(method), longRunningResponseType: longRunningResponseType( - service.packageName, + parameters.service.packageName, method ), longRunningMetadataType: longRunningMetadataType( - service.packageName, + parameters.service.packageName, method ), streaming: streaming(method), - pagingFieldName: pagingFieldName(messages, method, service), - pagingResponseType: pagingResponseType(messages, method), + pagingFieldName: pagingFieldName( + parameters.allMessages, + method, + parameters.service + ), + pagingResponseType: pagingResponseType(parameters.allMessages, method), inputInterface: method.inputType!, outputInterface: method.outputType!, - comments: service.commentsMap.getMethodComments( - service.name!, + comments: parameters.service.commentsMap.getMethodComments( + parameters.service.name!, method.name! ), methodConfig: getMethodConfig( - service.grpcServiceConfig, - `${service.packageName}.${service.name!}`, + parameters.service.grpcServiceConfig, + `${parameters.service.packageName}.${parameters.service.name!}`, method.name! ), retryableCodesName: defaultNonIdempotentRetryCodesName, @@ -322,11 +331,11 @@ function augmentMethod( }, method ) as MethodDescriptorProto; - const bundleConfigs = service.bundleConfigs; + const bundleConfigs = parameters.service.bundleConfigs; if (bundleConfigs) { for (const bc of bundleConfigs) { if (bc.methodName === method.name) { - const inputType = messages[method.inputType!]; + const inputType = parameters.allMessages[method.inputType!]; const repeatedFields = inputType.field!.filter( field => field.label === @@ -339,12 +348,12 @@ function augmentMethod( } } } - if (method.inputType && messages[method.inputType]?.field) { + if (method.inputType && parameters.allMessages[method.inputType]?.field) { const paramComment: Comment[] = []; - const inputType = messages[method.inputType!]; + const inputType = parameters.allMessages[method.inputType!]; const inputmessageName = toMessageName(method.inputType); for (const field of inputType.field!) { - const comment = service.commentsMap.getParamComments( + const comment = parameters.service.commentsMap.getParamComments( inputmessageName, field.name! ); @@ -353,7 +362,7 @@ function augmentMethod( method.paramComment = paramComment; } if (method.methodConfig.retryPolicy?.retryableStatusCodes) { - method.retryableCodesName = service.retryableCodeMap.getRetryableCodesName( + method.retryableCodesName = parameters.service.retryableCodeMap.getRetryableCodesName( method.methodConfig.retryPolicy.retryableStatusCodes ); } @@ -384,7 +393,7 @@ function augmentMethod( defaultParameters.max_rpc_timeout_millis; retryParams.total_timeout_millis = defaultParameters.total_timeout_millis; - method.retryParamsName = service.retryableCodeMap.getParamsName( + method.retryParamsName = parameters.service.retryableCodeMap.getParamsName( retryParams ); } @@ -429,27 +438,39 @@ export function getHeaderRequestParams( return result; } -function augmentService( - messages: MessagesMap, - packageName: string, - service: plugin.google.protobuf.IServiceDescriptorProto, - commentsMap: CommentsMap, - allResourceDatabase: ResourceDatabase, - resourceDatabase: ResourceDatabase, - options: Options -) { - const augmentedService = service as ServiceDescriptorProto; - augmentedService.packageName = packageName; - augmentedService.iamService = options.iamService ?? false; - augmentedService.comments = commentsMap.getServiceComment(service.name!); - augmentedService.commentsMap = commentsMap; +interface AugmentServiceParameters { + allMessages: MessagesMap; + localMessages: MessagesMap; + packageName: string; + service: plugin.google.protobuf.IServiceDescriptorProto; + commentsMap: CommentsMap; + allResourceDatabase: ResourceDatabase; + resourceDatabase: ResourceDatabase; + options: Options; +} + +function augmentService(parameters: AugmentServiceParameters) { + const augmentedService = parameters.service as ServiceDescriptorProto; + augmentedService.packageName = parameters.packageName; + augmentedService.iamService = parameters.options.iamService ?? false; + augmentedService.comments = parameters.commentsMap.getServiceComment( + parameters.service.name! + ); + augmentedService.commentsMap = parameters.commentsMap; augmentedService.retryableCodeMap = new RetryableCodeMap(); - augmentedService.grpcServiceConfig = options.grpcServiceConfig; - augmentedService.bundleConfigs = options.bundleConfigs?.filter( - bc => bc.serviceName === service.name + augmentedService.grpcServiceConfig = parameters.options.grpcServiceConfig; + augmentedService.bundleConfigs = parameters.options.bundleConfigs?.filter( + bc => bc.serviceName === parameters.service.name ); augmentedService.method = augmentedService.method.map(method => - augmentMethod(messages, augmentedService, method) + augmentMethod( + { + allMessages: parameters.allMessages, + localMessages: parameters.localMessages, + service: augmentedService, + }, + method + ) ); augmentedService.bundleConfigsMethods = augmentedService.method.filter( method => method.bundleConfig @@ -501,21 +522,22 @@ function augmentService( // resourceDatabase: all resources defined by `google.api.resource` or `google.api.resource_definition` const uniqueResources: {[name: string]: ResourceDescriptor} = {}; // Copy all resources in resourceDatabase to uniqueResources - const allPatterns = resourceDatabase.patterns; + const allPatterns = parameters.resourceDatabase.patterns; for (const pattern of Object.keys(allPatterns)) { const resource = allPatterns[pattern]; uniqueResources[resource.name] = resource; } // Copy all resources definination which are referenced into unique resources map. - for (const property of Object.keys(messages)) { - const errorLocation = `service ${service.name} message ${property}`; - for (const fieldDescriptor of messages[property].field ?? []) { + for (const property of Object.keys(parameters.localMessages)) { + const errorLocation = `service ${parameters.service.name} message ${property}`; + for (const fieldDescriptor of parameters.localMessages[property].field ?? + []) { // note: ResourceDatabase can accept `undefined` values, so we happily use optional chaining here. const resourceReference = fieldDescriptor.options?.['.google.api.resourceReference']; // 1. If this resource reference has .child_type, figure out if we have any known parent resources. - const parentResources = allResourceDatabase.getParentResourcesByChildType( + const parentResources = parameters.allResourceDatabase.getParentResourcesByChildType( resourceReference?.childType, errorLocation ); @@ -525,7 +547,7 @@ function augmentService( // 2. If this resource reference has .type, we should have a known resource with this type, check two maps. if (!resourceReference || !resourceReference.type) continue; - const resourceByType = allResourceDatabase.getResourceByType( + const resourceByType = parameters.allResourceDatabase.getResourceByType( resourceReference?.type, errorLocation ); @@ -533,7 +555,7 @@ function augmentService( // For multi pattern resources, we look up the type first, and get the [pattern] from resource, // look up pattern map for all resources. for (const pattern of resourceByType!.pattern!) { - const resourceByPattern = allResourceDatabase.getResourceByPattern( + const resourceByPattern = parameters.allResourceDatabase.getResourceByPattern( pattern ); if (!resourceByPattern) continue; @@ -558,43 +580,54 @@ function augmentService( return augmentedService; } +interface ProtoParameters { + fd: plugin.google.protobuf.IFileDescriptorProto; + packageName: string; + allMessages: MessagesMap; + allResourceDatabase: ResourceDatabase; + resourceDatabase: ResourceDatabase; + options: Options; +} + export class Proto { filePB2: plugin.google.protobuf.IFileDescriptorProto; services: ServicesMap = {}; - messages: MessagesMap = {}; + allMessages: MessagesMap = {}; + localMessages: MessagesMap = {}; fileToGenerate: boolean; // TODO: need to store metadata? address? // allResourceDatabase: resources that defined by `google.api.resource` // resourceDatabase: all resources defined by `google.api.resource` or `google.api.resource_definition` - constructor( - fd: plugin.google.protobuf.IFileDescriptorProto, - packageName: string, - allMessages: MessagesMap, - allResourceDatabase: ResourceDatabase, - resourceDatabase: ResourceDatabase, - options: Options - ) { - fd.service = fd.service || []; - - this.filePB2 = fd; - this.messages = allMessages; - this.fileToGenerate = fd.package - ? fd.package.startsWith(packageName) + constructor(parameters: ProtoParameters) { + parameters.fd.service = parameters.fd.service || []; + parameters.fd.messageType = parameters.fd.messageType || []; + + this.filePB2 = parameters.fd; + this.allMessages = parameters.allMessages; + this.localMessages = parameters.fd.messageType + .filter(message => message.name) + .reduce((map, message) => { + map[`.${parameters.fd.package!}.${message.name!}`] = message; + return map; + }, {} as MessagesMap); + this.fileToGenerate = parameters.fd.package + ? parameters.fd.package.startsWith(parameters.packageName) : false; - const commentsMap = new CommentsMap(fd); - this.services = fd.service + const commentsMap = new CommentsMap(parameters.fd); + this.services = parameters.fd.service .filter(service => service.name) .map(service => - augmentService( - this.messages, - packageName, + augmentService({ + allMessages: this.allMessages, + localMessages: this.localMessages, + packageName: parameters.packageName, service, commentsMap, - allResourceDatabase, - resourceDatabase, - options - ) + allResourceDatabase: parameters.allResourceDatabase, + resourceDatabase: parameters.resourceDatabase, + options: parameters.options, + }) ) .reduce((map, service) => { map[service.name!] = service; diff --git a/typescript/test/unit/api.ts b/typescript/test/unit/api.ts index d96c2e335..9d9304f19 100644 --- a/typescript/test/unit/api.ts +++ b/typescript/test/unit/api.ts @@ -192,8 +192,8 @@ describe('src/schema/api.ts', () => { assert(spy.calledWithNew()); assert.strictEqual(spy.callCount, 2); // one Proto object created for each fd - const firstCallMessages = spy.getCall(0).args[2]; - const secondCallMessages = spy.getCall(1).args[2]; + const firstCallMessages = spy.getCall(0).args[0].allMessages; + const secondCallMessages = spy.getCall(1).args[0].allMessages; assert('.google.cloud.example.v1.MessageA' in firstCallMessages); assert('.google.cloud.example.v1.MessageB' in firstCallMessages); assert('.google.cloud.example.v1.MessageA' in secondCallMessages); diff --git a/typescript/test/unit/proto.ts b/typescript/test/unit/proto.ts index fb2490e0f..491f3f424 100644 --- a/typescript/test/unit/proto.ts +++ b/typescript/test/unit/proto.ts @@ -148,14 +148,14 @@ describe('src/schema/proto.ts', () => { .forEach(message => { allMessages['.' + fd.package! + '.' + message.name!] = message; }); - const proto = new Proto( + const proto = new Proto({ fd, - 'google.cloud.talent.v4beta1', + packageName: 'google.cloud.talent.v4beta1', allMessages, - new ResourceDatabase(), - new ResourceDatabase(), - options - ); + allResourceDatabase: new ResourceDatabase(), + resourceDatabase: new ResourceDatabase(), + options, + }); assert.deepStrictEqual( proto.services['service'].method[0].pagingFieldName, undefined