From 401e3b56771a773538aa78e7a4996b75a1aad185 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 Feb 2020 11:47:15 -0800 Subject: [PATCH] fix: sort path templates, ignore useless templates (#231) Co-authored-by: Summer Ji --- typescript/src/schema/proto.ts | 16 +- typescript/src/schema/resourceDatabase.ts | 12 +- .../dlp/src/v2/dlp_service_client.ts.baseline | 342 ++++++++--------- ...vice_monitoring_service_client.ts.baseline | 363 +++++++++--------- .../uptime_check_service_client.ts.baseline | 363 +++++++++--------- 5 files changed, 546 insertions(+), 550 deletions(-) diff --git a/typescript/src/schema/proto.ts b/typescript/src/schema/proto.ts index a62ab9fef..90195eaf9 100644 --- a/typescript/src/schema/proto.ts +++ b/typescript/src/schema/proto.ts @@ -611,7 +611,21 @@ function augmentService( } } } - augmentedService.pathTemplates = Object.values(uniqueResources).sort(); + augmentedService.pathTemplates = Object.values(uniqueResources).sort( + (resourceA, resourceB) => { + // Path templates names can be cased differently + // (e.g. 'Project' and 'project_deidentify_template'), + // so we use camel case for comparison. + if (resourceA.name.toCamelCase() < resourceB.name.toCamelCase()) { + return -1; + } + if (resourceA.name.toCamelCase() > resourceB.name.toCamelCase()) { + return 1; + } + return 0; + } + ); + console.warn(augmentedService.pathTemplates); return augmentedService; } diff --git a/typescript/src/schema/resourceDatabase.ts b/typescript/src/schema/resourceDatabase.ts index d79443d0b..12c2a5c6c 100644 --- a/typescript/src/schema/resourceDatabase.ts +++ b/typescript/src/schema/resourceDatabase.ts @@ -74,8 +74,11 @@ export class ResourceDatabase { params, resource ); - this.patterns[patterns?.[0]] = resourceDescriptor; - this.types[resourceDescriptor.type!] = resourceDescriptor; + // We ignore resources with no parameters (e.g. pattern = '*'). + if (params.length > 0) { + this.patterns[patterns?.[0]] = resourceDescriptor; + this.types[resourceDescriptor.type!] = resourceDescriptor; + } } // resource: {name, type, pattern: [p1, p2]} // register resource does: in type map {type: { name, type, pattern: [p1, p2]} } @@ -83,6 +86,10 @@ export class ResourceDatabase { else { for (const pattern of patterns!) { const params = this.getParams(pattern); + // We ignore resources with no parameters (e.g. pattern = '*'). + if (params.length === 0) { + continue; + } const name = params.join('_'); let resourceDescriptor: ResourceDescriptor = { name, @@ -177,6 +184,7 @@ export class ResourceDatabase { params = params.map(p => p.replace(/{([a-zA-Z_]+).*/, '$1')); return params; } + private getResourceDescriptor( name: string, params: string[], diff --git a/typescript/test/testdata/dlp/src/v2/dlp_service_client.ts.baseline b/typescript/test/testdata/dlp/src/v2/dlp_service_client.ts.baseline index 22bc8ddac..d61345e0b 100644 --- a/typescript/test/testdata/dlp/src/v2/dlp_service_client.ts.baseline +++ b/typescript/test/testdata/dlp/src/v2/dlp_service_client.ts.baseline @@ -139,35 +139,35 @@ export class DlpServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - organizationInspectTemplatePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/inspectTemplates/{inspect_template}' + dlpJobPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/dlpJobs/{dlp_job}' ), - projectInspectTemplatePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/inspectTemplates/{inspect_template}' + jobTriggerPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/jobTriggers/{job_trigger}' + ), + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' ), organizationDeidentifyTemplatePathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/deidentifyTemplates/{deidentify_template}' ), - projectDeidentifyTemplatePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/deidentifyTemplates/{deidentify_template}' - ), - jobTriggerPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/jobTriggers/{job_trigger}' - ), - dlpJobPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/dlpJobs/{dlp_job}' + organizationInspectTemplatePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/inspectTemplates/{inspect_template}' ), organizationStoredInfoTypePathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/storedInfoTypes/{stored_info_type}' ), - projectStoredInfoTypePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/storedInfoTypes/{stored_info_type}' - ), projectPathTemplate: new gaxModule.PathTemplate( 'projects/{project}' ), - organizationPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}' + projectDeidentifyTemplatePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/deidentifyTemplates/{deidentify_template}' + ), + projectInspectTemplatePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/inspectTemplates/{inspect_template}' + ), + projectStoredInfoTypePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/storedInfoTypes/{stored_info_type}' ), }; @@ -2985,75 +2985,98 @@ export class DlpServiceClient { // -------------------- /** - * Return a fully-qualified organizationInspectTemplate resource name string. + * Return a fully-qualified dlpJob resource name string. * - * @param {string} organization - * @param {string} inspect_template + * @param {string} project + * @param {string} dlp_job * @returns {string} Resource name string. */ - organizationInspectTemplatePath(organization:string,inspectTemplate:string) { - return this._pathTemplates.organizationInspectTemplatePathTemplate.render({ - organization: organization, - inspect_template: inspectTemplate, + dlpJobPath(project:string,dlpJob:string) { + return this._pathTemplates.dlpJobPathTemplate.render({ + project: project, + dlp_job: dlpJob, }); } /** - * Parse the organization from OrganizationInspectTemplate resource. + * Parse the project from DlpJob resource. * - * @param {string} organizationInspectTemplateName - * A fully-qualified path representing organization_inspect_template resource. - * @returns {string} A string representing the organization. + * @param {string} dlpJobName + * A fully-qualified path representing DlpJob resource. + * @returns {string} A string representing the project. */ - matchOrganizationFromOrganizationInspectTemplateName(organizationInspectTemplateName: string) { - return this._pathTemplates.organizationInspectTemplatePathTemplate.match(organizationInspectTemplateName).organization; + matchProjectFromDlpJobName(dlpJobName: string) { + return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).project; } /** - * Parse the inspect_template from OrganizationInspectTemplate resource. + * Parse the dlp_job from DlpJob resource. * - * @param {string} organizationInspectTemplateName - * A fully-qualified path representing organization_inspect_template resource. - * @returns {string} A string representing the inspect_template. + * @param {string} dlpJobName + * A fully-qualified path representing DlpJob resource. + * @returns {string} A string representing the dlp_job. */ - matchInspectTemplateFromOrganizationInspectTemplateName(organizationInspectTemplateName: string) { - return this._pathTemplates.organizationInspectTemplatePathTemplate.match(organizationInspectTemplateName).inspect_template; + matchDlpJobFromDlpJobName(dlpJobName: string) { + return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).dlp_job; } /** - * Return a fully-qualified projectInspectTemplate resource name string. + * Return a fully-qualified jobTrigger resource name string. * * @param {string} project - * @param {string} inspect_template + * @param {string} job_trigger * @returns {string} Resource name string. */ - projectInspectTemplatePath(project:string,inspectTemplate:string) { - return this._pathTemplates.projectInspectTemplatePathTemplate.render({ + jobTriggerPath(project:string,jobTrigger:string) { + return this._pathTemplates.jobTriggerPathTemplate.render({ project: project, - inspect_template: inspectTemplate, + job_trigger: jobTrigger, }); } /** - * Parse the project from ProjectInspectTemplate resource. + * Parse the project from JobTrigger resource. * - * @param {string} projectInspectTemplateName - * A fully-qualified path representing project_inspect_template resource. + * @param {string} jobTriggerName + * A fully-qualified path representing JobTrigger resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectInspectTemplateName(projectInspectTemplateName: string) { - return this._pathTemplates.projectInspectTemplatePathTemplate.match(projectInspectTemplateName).project; + matchProjectFromJobTriggerName(jobTriggerName: string) { + return this._pathTemplates.jobTriggerPathTemplate.match(jobTriggerName).project; } /** - * Parse the inspect_template from ProjectInspectTemplate resource. + * Parse the job_trigger from JobTrigger resource. * - * @param {string} projectInspectTemplateName - * A fully-qualified path representing project_inspect_template resource. - * @returns {string} A string representing the inspect_template. + * @param {string} jobTriggerName + * A fully-qualified path representing JobTrigger resource. + * @returns {string} A string representing the job_trigger. */ - matchInspectTemplateFromProjectInspectTemplateName(projectInspectTemplateName: string) { - return this._pathTemplates.projectInspectTemplatePathTemplate.match(projectInspectTemplateName).inspect_template; + matchJobTriggerFromJobTriggerName(jobTriggerName: string) { + return this._pathTemplates.jobTriggerPathTemplate.match(jobTriggerName).job_trigger; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization:string) { + return this._pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName).organization; } /** @@ -3093,147 +3116,170 @@ export class DlpServiceClient { } /** - * Return a fully-qualified projectDeidentifyTemplate resource name string. + * Return a fully-qualified organizationInspectTemplate resource name string. * - * @param {string} project - * @param {string} deidentify_template + * @param {string} organization + * @param {string} inspect_template * @returns {string} Resource name string. */ - projectDeidentifyTemplatePath(project:string,deidentifyTemplate:string) { - return this._pathTemplates.projectDeidentifyTemplatePathTemplate.render({ - project: project, - deidentify_template: deidentifyTemplate, + organizationInspectTemplatePath(organization:string,inspectTemplate:string) { + return this._pathTemplates.organizationInspectTemplatePathTemplate.render({ + organization: organization, + inspect_template: inspectTemplate, }); } /** - * Parse the project from ProjectDeidentifyTemplate resource. + * Parse the organization from OrganizationInspectTemplate resource. * - * @param {string} projectDeidentifyTemplateName - * A fully-qualified path representing project_deidentify_template resource. - * @returns {string} A string representing the project. + * @param {string} organizationInspectTemplateName + * A fully-qualified path representing organization_inspect_template resource. + * @returns {string} A string representing the organization. */ - matchProjectFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName: string) { - return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(projectDeidentifyTemplateName).project; + matchOrganizationFromOrganizationInspectTemplateName(organizationInspectTemplateName: string) { + return this._pathTemplates.organizationInspectTemplatePathTemplate.match(organizationInspectTemplateName).organization; } /** - * Parse the deidentify_template from ProjectDeidentifyTemplate resource. + * Parse the inspect_template from OrganizationInspectTemplate resource. * - * @param {string} projectDeidentifyTemplateName - * A fully-qualified path representing project_deidentify_template resource. - * @returns {string} A string representing the deidentify_template. + * @param {string} organizationInspectTemplateName + * A fully-qualified path representing organization_inspect_template resource. + * @returns {string} A string representing the inspect_template. */ - matchDeidentifyTemplateFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName: string) { - return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(projectDeidentifyTemplateName).deidentify_template; + matchInspectTemplateFromOrganizationInspectTemplateName(organizationInspectTemplateName: string) { + return this._pathTemplates.organizationInspectTemplatePathTemplate.match(organizationInspectTemplateName).inspect_template; } /** - * Return a fully-qualified jobTrigger resource name string. + * Return a fully-qualified organizationStoredInfoType resource name string. * - * @param {string} project - * @param {string} job_trigger + * @param {string} organization + * @param {string} stored_info_type * @returns {string} Resource name string. */ - jobTriggerPath(project:string,jobTrigger:string) { - return this._pathTemplates.jobTriggerPathTemplate.render({ - project: project, - job_trigger: jobTrigger, + organizationStoredInfoTypePath(organization:string,storedInfoType:string) { + return this._pathTemplates.organizationStoredInfoTypePathTemplate.render({ + organization: organization, + stored_info_type: storedInfoType, }); } /** - * Parse the project from JobTrigger resource. + * Parse the organization from OrganizationStoredInfoType resource. * - * @param {string} jobTriggerName - * A fully-qualified path representing JobTrigger resource. - * @returns {string} A string representing the project. + * @param {string} organizationStoredInfoTypeName + * A fully-qualified path representing organization_stored_info_type resource. + * @returns {string} A string representing the organization. */ - matchProjectFromJobTriggerName(jobTriggerName: string) { - return this._pathTemplates.jobTriggerPathTemplate.match(jobTriggerName).project; + matchOrganizationFromOrganizationStoredInfoTypeName(organizationStoredInfoTypeName: string) { + return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(organizationStoredInfoTypeName).organization; } /** - * Parse the job_trigger from JobTrigger resource. + * Parse the stored_info_type from OrganizationStoredInfoType resource. * - * @param {string} jobTriggerName - * A fully-qualified path representing JobTrigger resource. - * @returns {string} A string representing the job_trigger. + * @param {string} organizationStoredInfoTypeName + * A fully-qualified path representing organization_stored_info_type resource. + * @returns {string} A string representing the stored_info_type. */ - matchJobTriggerFromJobTriggerName(jobTriggerName: string) { - return this._pathTemplates.jobTriggerPathTemplate.match(jobTriggerName).job_trigger; + matchStoredInfoTypeFromOrganizationStoredInfoTypeName(organizationStoredInfoTypeName: string) { + return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(organizationStoredInfoTypeName).stored_info_type; } /** - * Return a fully-qualified dlpJob resource name string. + * Return a fully-qualified project resource name string. * * @param {string} project - * @param {string} dlp_job * @returns {string} Resource name string. */ - dlpJobPath(project:string,dlpJob:string) { - return this._pathTemplates.dlpJobPathTemplate.render({ + projectPath(project:string) { + return this._pathTemplates.projectPathTemplate.render({ project: project, - dlp_job: dlpJob, }); } /** - * Parse the project from DlpJob resource. + * Parse the project from Project resource. * - * @param {string} dlpJobName - * A fully-qualified path representing DlpJob resource. + * @param {string} projectName + * A fully-qualified path representing Project resource. * @returns {string} A string representing the project. */ - matchProjectFromDlpJobName(dlpJobName: string) { - return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).project; + matchProjectFromProjectName(projectName: string) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; } /** - * Parse the dlp_job from DlpJob resource. + * Return a fully-qualified projectDeidentifyTemplate resource name string. * - * @param {string} dlpJobName - * A fully-qualified path representing DlpJob resource. - * @returns {string} A string representing the dlp_job. + * @param {string} project + * @param {string} deidentify_template + * @returns {string} Resource name string. */ - matchDlpJobFromDlpJobName(dlpJobName: string) { - return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).dlp_job; + projectDeidentifyTemplatePath(project:string,deidentifyTemplate:string) { + return this._pathTemplates.projectDeidentifyTemplatePathTemplate.render({ + project: project, + deidentify_template: deidentifyTemplate, + }); } /** - * Return a fully-qualified organizationStoredInfoType resource name string. + * Parse the project from ProjectDeidentifyTemplate resource. * - * @param {string} organization - * @param {string} stored_info_type + * @param {string} projectDeidentifyTemplateName + * A fully-qualified path representing project_deidentify_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName: string) { + return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(projectDeidentifyTemplateName).project; + } + + /** + * Parse the deidentify_template from ProjectDeidentifyTemplate resource. + * + * @param {string} projectDeidentifyTemplateName + * A fully-qualified path representing project_deidentify_template resource. + * @returns {string} A string representing the deidentify_template. + */ + matchDeidentifyTemplateFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName: string) { + return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(projectDeidentifyTemplateName).deidentify_template; + } + + /** + * Return a fully-qualified projectInspectTemplate resource name string. + * + * @param {string} project + * @param {string} inspect_template * @returns {string} Resource name string. */ - organizationStoredInfoTypePath(organization:string,storedInfoType:string) { - return this._pathTemplates.organizationStoredInfoTypePathTemplate.render({ - organization: organization, - stored_info_type: storedInfoType, + projectInspectTemplatePath(project:string,inspectTemplate:string) { + return this._pathTemplates.projectInspectTemplatePathTemplate.render({ + project: project, + inspect_template: inspectTemplate, }); } /** - * Parse the organization from OrganizationStoredInfoType resource. + * Parse the project from ProjectInspectTemplate resource. * - * @param {string} organizationStoredInfoTypeName - * A fully-qualified path representing organization_stored_info_type resource. - * @returns {string} A string representing the organization. + * @param {string} projectInspectTemplateName + * A fully-qualified path representing project_inspect_template resource. + * @returns {string} A string representing the project. */ - matchOrganizationFromOrganizationStoredInfoTypeName(organizationStoredInfoTypeName: string) { - return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(organizationStoredInfoTypeName).organization; + matchProjectFromProjectInspectTemplateName(projectInspectTemplateName: string) { + return this._pathTemplates.projectInspectTemplatePathTemplate.match(projectInspectTemplateName).project; } /** - * Parse the stored_info_type from OrganizationStoredInfoType resource. + * Parse the inspect_template from ProjectInspectTemplate resource. * - * @param {string} organizationStoredInfoTypeName - * A fully-qualified path representing organization_stored_info_type resource. - * @returns {string} A string representing the stored_info_type. + * @param {string} projectInspectTemplateName + * A fully-qualified path representing project_inspect_template resource. + * @returns {string} A string representing the inspect_template. */ - matchStoredInfoTypeFromOrganizationStoredInfoTypeName(organizationStoredInfoTypeName: string) { - return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(organizationStoredInfoTypeName).stored_info_type; + matchInspectTemplateFromProjectInspectTemplateName(projectInspectTemplateName: string) { + return this._pathTemplates.projectInspectTemplatePathTemplate.match(projectInspectTemplateName).inspect_template; } /** @@ -3272,52 +3318,6 @@ export class DlpServiceClient { return this._pathTemplates.projectStoredInfoTypePathTemplate.match(projectStoredInfoTypeName).stored_info_type; } - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified organization resource name string. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationPath(organization:string) { - return this._pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); - } - - /** - * Parse the organization from Organization resource. - * - * @param {string} organizationName - * A fully-qualified path representing Organization resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationName(organizationName: string) { - return this._pathTemplates.organizationPathTemplate.match(organizationName).organization; - } - /** * Terminate the GRPC channel and close the client. * diff --git a/typescript/test/testdata/monitoring/src/v3/service_monitoring_service_client.ts.baseline b/typescript/test/testdata/monitoring/src/v3/service_monitoring_service_client.ts.baseline index 2cb638e2d..79b7e19e8 100644 --- a/typescript/test/testdata/monitoring/src/v3/service_monitoring_service_client.ts.baseline +++ b/typescript/test/testdata/monitoring/src/v3/service_monitoring_service_client.ts.baseline @@ -134,35 +134,32 @@ export class ServiceMonitoringServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectServicePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/services/{service}' - ), - organizationServicePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}' - ), folderServicePathTemplate: new gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - PathTemplate: new gaxModule.PathTemplate( - '*' + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' ), - projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' ), organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' ), - folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' - ), organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' ), - folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( - 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), }; @@ -1089,170 +1086,160 @@ export class ServiceMonitoringServiceClient { // -------------------- /** - * Return a fully-qualified projectService resource name string. + * Return a fully-qualified folderService resource name string. * - * @param {string} project + * @param {string} folder * @param {string} service * @returns {string} Resource name string. */ - projectServicePath(project:string,service:string) { - return this._pathTemplates.projectServicePathTemplate.render({ - project: project, + folderServicePath(folder:string,service:string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder: folder, service: service, }); } /** - * Parse the project from ProjectService resource. + * Parse the folder from FolderService resource. * - * @param {string} projectServiceName - * A fully-qualified path representing project_service resource. - * @returns {string} A string representing the project. + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. */ - matchProjectFromProjectServiceName(projectServiceName: string) { - return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).project; + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).folder; } /** - * Parse the service from ProjectService resource. + * Parse the service from FolderService resource. * - * @param {string} projectServiceName - * A fully-qualified path representing project_service resource. + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. * @returns {string} A string representing the service. */ - matchServiceFromProjectServiceName(projectServiceName: string) { - return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).service; + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).service; } /** - * Return a fully-qualified organizationService resource name string. + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. * - * @param {string} organization + * @param {string} folder * @param {string} service + * @param {string} service_level_objective * @returns {string} Resource name string. */ - organizationServicePath(organization:string,service:string) { - return this._pathTemplates.organizationServicePathTemplate.render({ - organization: organization, + folderServiceServiceLevelObjectivePath(folder:string,service:string,serviceLevelObjective:string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render({ + folder: folder, service: service, + service_level_objective: serviceLevelObjective, }); } /** - * Parse the organization from OrganizationService resource. + * Parse the folder from FolderServiceServiceLevelObjective resource. * - * @param {string} organizationServiceName - * A fully-qualified path representing organization_service resource. - * @returns {string} A string representing the organization. + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromOrganizationServiceName(organizationServiceName: string) { - return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).organization; + matchFolderFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).folder; } /** - * Parse the service from OrganizationService resource. + * Parse the service from FolderServiceServiceLevelObjective resource. * - * @param {string} organizationServiceName - * A fully-qualified path representing organization_service resource. + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. * @returns {string} A string representing the service. */ - matchServiceFromOrganizationServiceName(organizationServiceName: string) { - return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).service; + matchServiceFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service; } /** - * Return a fully-qualified folderService resource name string. + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. * - * @param {string} folder - * @param {string} service - * @returns {string} Resource name string. + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. */ - folderServicePath(folder:string,service:string) { - return this._pathTemplates.folderServicePathTemplate.render({ - folder: folder, - service: service, - }); + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service_level_objective; } /** - * Parse the folder from FolderService resource. + * Return a fully-qualified folderUptimeCheckConfig resource name string. * - * @param {string} folderServiceName - * A fully-qualified path representing folder_service resource. - * @returns {string} A string representing the folder. + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. */ - matchFolderFromFolderServiceName(folderServiceName: string) { - return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).folder; + folderUptimeCheckConfigPath(folder:string,uptimeCheckConfig:string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder: folder, + uptime_check_config: uptimeCheckConfig, + }); } /** - * Parse the service from FolderService resource. + * Parse the folder from FolderUptimeCheckConfig resource. * - * @param {string} folderServiceName - * A fully-qualified path representing folder_service resource. - * @returns {string} A string representing the service. + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. */ - matchServiceFromFolderServiceName(folderServiceName: string) { - return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).service; + matchFolderFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).folder; } /** - * Return a fully-qualified resource name string. + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. * - * @returns {string} Resource name string. + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. */ - Path() { - return this._pathTemplates.PathTemplate.render({ - }); + matchUptimeCheckConfigFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).uptime_check_config; } /** - * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * Return a fully-qualified organizationService resource name string. * - * @param {string} project + * @param {string} organization * @param {string} service - * @param {string} service_level_objective * @returns {string} Resource name string. */ - projectServiceServiceLevelObjectivePath(project:string,service:string,serviceLevelObjective:string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render({ - project: project, + organizationServicePath(organization:string,service:string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization: organization, service: service, - service_level_objective: serviceLevelObjective, }); } /** - * Parse the project from ProjectServiceServiceLevelObjective resource. + * Parse the organization from OrganizationService resource. * - * @param {string} projectServiceServiceLevelObjectiveName - * A fully-qualified path representing project_service_service_level_objective resource. - * @returns {string} A string representing the project. + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. */ - matchProjectFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).project; + matchOrganizationFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).organization; } /** - * Parse the service from ProjectServiceServiceLevelObjective resource. + * Parse the service from OrganizationService resource. * - * @param {string} projectServiceServiceLevelObjectiveName - * A fully-qualified path representing project_service_service_level_objective resource. + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. * @returns {string} A string representing the service. */ - matchServiceFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service; - } - - /** - * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. - * - * @param {string} projectServiceServiceLevelObjectiveName - * A fully-qualified path representing project_service_service_level_objective resource. - * @returns {string} A string representing the service_level_objective. - */ - matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service_level_objective; + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).service; } /** @@ -1305,160 +1292,160 @@ export class ServiceMonitoringServiceClient { } /** - * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * Return a fully-qualified organizationUptimeCheckConfig resource name string. * - * @param {string} folder - * @param {string} service - * @param {string} service_level_objective + * @param {string} organization + * @param {string} uptime_check_config * @returns {string} Resource name string. */ - folderServiceServiceLevelObjectivePath(folder:string,service:string,serviceLevelObjective:string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render({ - folder: folder, - service: service, - service_level_objective: serviceLevelObjective, + organizationUptimeCheckConfigPath(organization:string,uptimeCheckConfig:string) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render({ + organization: organization, + uptime_check_config: uptimeCheckConfig, }); } /** - * Parse the folder from FolderServiceServiceLevelObjective resource. - * - * @param {string} folderServiceServiceLevelObjectiveName - * A fully-qualified path representing folder_service_service_level_objective resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).folder; - } - - /** - * Parse the service from FolderServiceServiceLevelObjective resource. + * Parse the organization from OrganizationUptimeCheckConfig resource. * - * @param {string} folderServiceServiceLevelObjectiveName - * A fully-qualified path representing folder_service_service_level_objective resource. - * @returns {string} A string representing the service. + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. */ - matchServiceFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service; + matchOrganizationFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).organization; } /** - * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. * - * @param {string} folderServiceServiceLevelObjectiveName - * A fully-qualified path representing folder_service_service_level_objective resource. - * @returns {string} A string representing the service_level_objective. + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. */ - matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service_level_objective; + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).uptime_check_config; } /** - * Return a fully-qualified projectUptimeCheckConfig resource name string. + * Return a fully-qualified projectService resource name string. * * @param {string} project - * @param {string} uptime_check_config + * @param {string} service * @returns {string} Resource name string. */ - projectUptimeCheckConfigPath(project:string,uptimeCheckConfig:string) { - return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + projectServicePath(project:string,service:string) { + return this._pathTemplates.projectServicePathTemplate.render({ project: project, - uptime_check_config: uptimeCheckConfig, + service: service, }); } /** - * Parse the project from ProjectUptimeCheckConfig resource. + * Parse the project from ProjectService resource. * - * @param {string} projectUptimeCheckConfigName - * A fully-qualified path representing project_uptime_check_config resource. + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { - return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).project; + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).project; } /** - * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * Parse the service from ProjectService resource. * - * @param {string} projectUptimeCheckConfigName - * A fully-qualified path representing project_uptime_check_config resource. - * @returns {string} A string representing the uptime_check_config. + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. */ - matchUptimeCheckConfigFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { - return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).uptime_check_config; + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).service; } /** - * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. * - * @param {string} organization - * @param {string} uptime_check_config + * @param {string} project + * @param {string} service + * @param {string} service_level_objective * @returns {string} Resource name string. */ - organizationUptimeCheckConfigPath(organization:string,uptimeCheckConfig:string) { - return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render({ - organization: organization, - uptime_check_config: uptimeCheckConfig, + projectServiceServiceLevelObjectivePath(project:string,service:string,serviceLevelObjective:string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render({ + project: project, + service: service, + service_level_objective: serviceLevelObjective, }); } /** - * Parse the organization from OrganizationUptimeCheckConfig resource. + * Parse the project from ProjectServiceServiceLevelObjective resource. * - * @param {string} organizationUptimeCheckConfigName - * A fully-qualified path representing organization_uptime_check_config resource. - * @returns {string} A string representing the organization. + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. */ - matchOrganizationFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { - return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).organization; + matchProjectFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).project; } /** - * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * Parse the service from ProjectServiceServiceLevelObjective resource. * - * @param {string} organizationUptimeCheckConfigName - * A fully-qualified path representing organization_uptime_check_config resource. - * @returns {string} A string representing the uptime_check_config. + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. */ - matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { - return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).uptime_check_config; + matchServiceFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service; } /** - * Return a fully-qualified folderUptimeCheckConfig resource name string. + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. * - * @param {string} folder + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project * @param {string} uptime_check_config * @returns {string} Resource name string. */ - folderUptimeCheckConfigPath(folder:string,uptimeCheckConfig:string) { - return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ - folder: folder, + projectUptimeCheckConfigPath(project:string,uptimeCheckConfig:string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project: project, uptime_check_config: uptimeCheckConfig, }); } /** - * Parse the folder from FolderUptimeCheckConfig resource. + * Parse the project from ProjectUptimeCheckConfig resource. * - * @param {string} folderUptimeCheckConfigName - * A fully-qualified path representing folder_uptime_check_config resource. - * @returns {string} A string representing the folder. + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. */ - matchFolderFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { - return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).folder; + matchProjectFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).project; } /** - * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. * - * @param {string} folderUptimeCheckConfigName - * A fully-qualified path representing folder_uptime_check_config resource. + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. * @returns {string} A string representing the uptime_check_config. */ - matchUptimeCheckConfigFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { - return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).uptime_check_config; + matchUptimeCheckConfigFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).uptime_check_config; } /** diff --git a/typescript/test/testdata/monitoring/src/v3/uptime_check_service_client.ts.baseline b/typescript/test/testdata/monitoring/src/v3/uptime_check_service_client.ts.baseline index 69075e7c8..62847a240 100644 --- a/typescript/test/testdata/monitoring/src/v3/uptime_check_service_client.ts.baseline +++ b/typescript/test/testdata/monitoring/src/v3/uptime_check_service_client.ts.baseline @@ -138,35 +138,32 @@ export class UptimeCheckServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectServicePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/services/{service}' - ), - organizationServicePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/services/{service}' - ), folderServicePathTemplate: new gaxModule.PathTemplate( 'folders/{folder}/services/{service}' ), - PathTemplate: new gaxModule.PathTemplate( - '*' + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' ), - projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' ), organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' ), - folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( - 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' - ), organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' ), - folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( - 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' ), }; @@ -804,170 +801,160 @@ export class UptimeCheckServiceClient { // -------------------- /** - * Return a fully-qualified projectService resource name string. + * Return a fully-qualified folderService resource name string. * - * @param {string} project + * @param {string} folder * @param {string} service * @returns {string} Resource name string. */ - projectServicePath(project:string,service:string) { - return this._pathTemplates.projectServicePathTemplate.render({ - project: project, + folderServicePath(folder:string,service:string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder: folder, service: service, }); } /** - * Parse the project from ProjectService resource. + * Parse the folder from FolderService resource. * - * @param {string} projectServiceName - * A fully-qualified path representing project_service resource. - * @returns {string} A string representing the project. + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. */ - matchProjectFromProjectServiceName(projectServiceName: string) { - return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).project; + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).folder; } /** - * Parse the service from ProjectService resource. + * Parse the service from FolderService resource. * - * @param {string} projectServiceName - * A fully-qualified path representing project_service resource. + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. * @returns {string} A string representing the service. */ - matchServiceFromProjectServiceName(projectServiceName: string) { - return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).service; + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).service; } /** - * Return a fully-qualified organizationService resource name string. + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. * - * @param {string} organization + * @param {string} folder * @param {string} service + * @param {string} service_level_objective * @returns {string} Resource name string. */ - organizationServicePath(organization:string,service:string) { - return this._pathTemplates.organizationServicePathTemplate.render({ - organization: organization, + folderServiceServiceLevelObjectivePath(folder:string,service:string,serviceLevelObjective:string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render({ + folder: folder, service: service, + service_level_objective: serviceLevelObjective, }); } /** - * Parse the organization from OrganizationService resource. + * Parse the folder from FolderServiceServiceLevelObjective resource. * - * @param {string} organizationServiceName - * A fully-qualified path representing organization_service resource. - * @returns {string} A string representing the organization. + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromOrganizationServiceName(organizationServiceName: string) { - return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).organization; + matchFolderFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).folder; } /** - * Parse the service from OrganizationService resource. + * Parse the service from FolderServiceServiceLevelObjective resource. * - * @param {string} organizationServiceName - * A fully-qualified path representing organization_service resource. + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. * @returns {string} A string representing the service. */ - matchServiceFromOrganizationServiceName(organizationServiceName: string) { - return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).service; + matchServiceFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service; } /** - * Return a fully-qualified folderService resource name string. + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. * - * @param {string} folder - * @param {string} service - * @returns {string} Resource name string. + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. */ - folderServicePath(folder:string,service:string) { - return this._pathTemplates.folderServicePathTemplate.render({ - folder: folder, - service: service, - }); + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service_level_objective; } /** - * Parse the folder from FolderService resource. + * Return a fully-qualified folderUptimeCheckConfig resource name string. * - * @param {string} folderServiceName - * A fully-qualified path representing folder_service resource. - * @returns {string} A string representing the folder. + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. */ - matchFolderFromFolderServiceName(folderServiceName: string) { - return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).folder; + folderUptimeCheckConfigPath(folder:string,uptimeCheckConfig:string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder: folder, + uptime_check_config: uptimeCheckConfig, + }); } /** - * Parse the service from FolderService resource. + * Parse the folder from FolderUptimeCheckConfig resource. * - * @param {string} folderServiceName - * A fully-qualified path representing folder_service resource. - * @returns {string} A string representing the service. + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. */ - matchServiceFromFolderServiceName(folderServiceName: string) { - return this._pathTemplates.folderServicePathTemplate.match(folderServiceName).service; + matchFolderFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).folder; } /** - * Return a fully-qualified resource name string. + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. * - * @returns {string} Resource name string. + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. */ - Path() { - return this._pathTemplates.PathTemplate.render({ - }); + matchUptimeCheckConfigFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).uptime_check_config; } /** - * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * Return a fully-qualified organizationService resource name string. * - * @param {string} project + * @param {string} organization * @param {string} service - * @param {string} service_level_objective * @returns {string} Resource name string. */ - projectServiceServiceLevelObjectivePath(project:string,service:string,serviceLevelObjective:string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render({ - project: project, + organizationServicePath(organization:string,service:string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization: organization, service: service, - service_level_objective: serviceLevelObjective, }); } /** - * Parse the project from ProjectServiceServiceLevelObjective resource. + * Parse the organization from OrganizationService resource. * - * @param {string} projectServiceServiceLevelObjectiveName - * A fully-qualified path representing project_service_service_level_objective resource. - * @returns {string} A string representing the project. + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. */ - matchProjectFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).project; + matchOrganizationFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).organization; } /** - * Parse the service from ProjectServiceServiceLevelObjective resource. + * Parse the service from OrganizationService resource. * - * @param {string} projectServiceServiceLevelObjectiveName - * A fully-qualified path representing project_service_service_level_objective resource. + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. * @returns {string} A string representing the service. */ - matchServiceFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service; - } - - /** - * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. - * - * @param {string} projectServiceServiceLevelObjectiveName - * A fully-qualified path representing project_service_service_level_objective resource. - * @returns {string} A string representing the service_level_objective. - */ - matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service_level_objective; + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match(organizationServiceName).service; } /** @@ -1020,160 +1007,160 @@ export class UptimeCheckServiceClient { } /** - * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * Return a fully-qualified organizationUptimeCheckConfig resource name string. * - * @param {string} folder - * @param {string} service - * @param {string} service_level_objective + * @param {string} organization + * @param {string} uptime_check_config * @returns {string} Resource name string. */ - folderServiceServiceLevelObjectivePath(folder:string,service:string,serviceLevelObjective:string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render({ - folder: folder, - service: service, - service_level_objective: serviceLevelObjective, + organizationUptimeCheckConfigPath(organization:string,uptimeCheckConfig:string) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render({ + organization: organization, + uptime_check_config: uptimeCheckConfig, }); } /** - * Parse the folder from FolderServiceServiceLevelObjective resource. - * - * @param {string} folderServiceServiceLevelObjectiveName - * A fully-qualified path representing folder_service_service_level_objective resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).folder; - } - - /** - * Parse the service from FolderServiceServiceLevelObjective resource. + * Parse the organization from OrganizationUptimeCheckConfig resource. * - * @param {string} folderServiceServiceLevelObjectiveName - * A fully-qualified path representing folder_service_service_level_objective resource. - * @returns {string} A string representing the service. + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. */ - matchServiceFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service; + matchOrganizationFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).organization; } /** - * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. * - * @param {string} folderServiceServiceLevelObjectiveName - * A fully-qualified path representing folder_service_service_level_objective resource. - * @returns {string} A string representing the service_level_objective. + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. */ - matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string) { - return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match(folderServiceServiceLevelObjectiveName).service_level_objective; + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).uptime_check_config; } /** - * Return a fully-qualified projectUptimeCheckConfig resource name string. + * Return a fully-qualified projectService resource name string. * * @param {string} project - * @param {string} uptime_check_config + * @param {string} service * @returns {string} Resource name string. */ - projectUptimeCheckConfigPath(project:string,uptimeCheckConfig:string) { - return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + projectServicePath(project:string,service:string) { + return this._pathTemplates.projectServicePathTemplate.render({ project: project, - uptime_check_config: uptimeCheckConfig, + service: service, }); } /** - * Parse the project from ProjectUptimeCheckConfig resource. + * Parse the project from ProjectService resource. * - * @param {string} projectUptimeCheckConfigName - * A fully-qualified path representing project_uptime_check_config resource. + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { - return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).project; + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).project; } /** - * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * Parse the service from ProjectService resource. * - * @param {string} projectUptimeCheckConfigName - * A fully-qualified path representing project_uptime_check_config resource. - * @returns {string} A string representing the uptime_check_config. + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. */ - matchUptimeCheckConfigFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { - return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).uptime_check_config; + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match(projectServiceName).service; } /** - * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. * - * @param {string} organization - * @param {string} uptime_check_config + * @param {string} project + * @param {string} service + * @param {string} service_level_objective * @returns {string} Resource name string. */ - organizationUptimeCheckConfigPath(organization:string,uptimeCheckConfig:string) { - return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render({ - organization: organization, - uptime_check_config: uptimeCheckConfig, + projectServiceServiceLevelObjectivePath(project:string,service:string,serviceLevelObjective:string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render({ + project: project, + service: service, + service_level_objective: serviceLevelObjective, }); } /** - * Parse the organization from OrganizationUptimeCheckConfig resource. + * Parse the project from ProjectServiceServiceLevelObjective resource. * - * @param {string} organizationUptimeCheckConfigName - * A fully-qualified path representing organization_uptime_check_config resource. - * @returns {string} A string representing the organization. + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. */ - matchOrganizationFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { - return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).organization; + matchProjectFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).project; } /** - * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * Parse the service from ProjectServiceServiceLevelObjective resource. * - * @param {string} organizationUptimeCheckConfigName - * A fully-qualified path representing organization_uptime_check_config resource. - * @returns {string} A string representing the uptime_check_config. + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. */ - matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string) { - return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match(organizationUptimeCheckConfigName).uptime_check_config; + matchServiceFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service; } /** - * Return a fully-qualified folderUptimeCheckConfig resource name string. + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. * - * @param {string} folder + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match(projectServiceServiceLevelObjectiveName).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project * @param {string} uptime_check_config * @returns {string} Resource name string. */ - folderUptimeCheckConfigPath(folder:string,uptimeCheckConfig:string) { - return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ - folder: folder, + projectUptimeCheckConfigPath(project:string,uptimeCheckConfig:string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project: project, uptime_check_config: uptimeCheckConfig, }); } /** - * Parse the folder from FolderUptimeCheckConfig resource. + * Parse the project from ProjectUptimeCheckConfig resource. * - * @param {string} folderUptimeCheckConfigName - * A fully-qualified path representing folder_uptime_check_config resource. - * @returns {string} A string representing the folder. + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. */ - matchFolderFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { - return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).folder; + matchProjectFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).project; } /** - * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. * - * @param {string} folderUptimeCheckConfigName - * A fully-qualified path representing folder_uptime_check_config resource. + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. * @returns {string} A string representing the uptime_check_config. */ - matchUptimeCheckConfigFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string) { - return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match(folderUptimeCheckConfigName).uptime_check_config; + matchUptimeCheckConfigFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match(projectUptimeCheckConfigName).uptime_check_config; } /**