Skip to content

Commit

Permalink
chore: re-order template utils (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and callmehiphop committed Apr 26, 2019
1 parent c64857b commit af65208
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 147 deletions.
284 changes: 142 additions & 142 deletions packages/google-privacy-dlp/src/v2/dlp_service_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,31 +108,31 @@ class DlpServiceClient {
// identifiers to uniquely identify resources within the API.
// Create useful helper objects for these.
this._pathTemplates = {
dlpJobPathTemplate: new gax.PathTemplate(
'projects/{project}/dlpJobs/{dlp_job}'
),
organizationPathTemplate: new gax.PathTemplate(
'organizations/{organization}'
),
organizationDeidentifyTemplatePathTemplate: new gax.PathTemplate(
'organizations/{organization}/deidentifyTemplates/{deidentify_template}'
),
projectDeidentifyTemplatePathTemplate: new gax.PathTemplate(
'projects/{project}/deidentifyTemplates/{deidentify_template}'
),
organizationInspectTemplatePathTemplate: new gax.PathTemplate(
'organizations/{organization}/inspectTemplates/{inspect_template}'
),
organizationStoredInfoTypePathTemplate: new gax.PathTemplate(
'organizations/{organization}/storedInfoTypes/{stored_info_type}'
),
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
projectDeidentifyTemplatePathTemplate: new gax.PathTemplate(
'projects/{project}/deidentifyTemplates/{deidentify_template}'
),
projectInspectTemplatePathTemplate: new gax.PathTemplate(
'projects/{project}/inspectTemplates/{inspect_template}'
),
projectJobTriggerPathTemplate: new gax.PathTemplate(
'projects/{project}/jobTriggers/{job_trigger}'
),
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
dlpJobPathTemplate: new gax.PathTemplate(
'projects/{project}/dlpJobs/{dlp_job}'
),
organizationStoredInfoTypePathTemplate: new gax.PathTemplate(
'organizations/{organization}/storedInfoTypes/{stored_info_type}'
),
projectStoredInfoTypePathTemplate: new gax.PathTemplate(
'projects/{project}/storedInfoTypes/{stored_info_type}'
),
Expand Down Expand Up @@ -2895,6 +2895,20 @@ class DlpServiceClient {
// -- Path templates --
// --------------------

/**
* Return a fully-qualified dlp_job resource name string.
*
* @param {String} project
* @param {String} dlpJob
* @returns {String}
*/
dlpJobPath(project, dlpJob) {
return this._pathTemplates.dlpJobPathTemplate.render({
project: project,
dlp_job: dlpJob,
});
}

/**
* Return a fully-qualified organization resource name string.
*
Expand Down Expand Up @@ -2923,20 +2937,6 @@ class DlpServiceClient {
);
}

/**
* Return a fully-qualified project_deidentify_template resource name string.
*
* @param {String} project
* @param {String} deidentifyTemplate
* @returns {String}
*/
projectDeidentifyTemplatePath(project, deidentifyTemplate) {
return this._pathTemplates.projectDeidentifyTemplatePathTemplate.render({
project: project,
deidentify_template: deidentifyTemplate,
});
}

/**
* Return a fully-qualified organization_inspect_template resource name string.
*
Expand All @@ -2952,70 +2952,70 @@ class DlpServiceClient {
}

/**
* Return a fully-qualified project_inspect_template resource name string.
* Return a fully-qualified organization_stored_info_type resource name string.
*
* @param {String} project
* @param {String} inspectTemplate
* @param {String} organization
* @param {String} storedInfoType
* @returns {String}
*/
projectInspectTemplatePath(project, inspectTemplate) {
return this._pathTemplates.projectInspectTemplatePathTemplate.render({
project: project,
inspect_template: inspectTemplate,
organizationStoredInfoTypePath(organization, storedInfoType) {
return this._pathTemplates.organizationStoredInfoTypePathTemplate.render({
organization: organization,
stored_info_type: storedInfoType,
});
}

/**
* Return a fully-qualified project_job_trigger resource name string.
* Return a fully-qualified project resource name string.
*
* @param {String} project
* @param {String} jobTrigger
* @returns {String}
*/
projectJobTriggerPath(project, jobTrigger) {
return this._pathTemplates.projectJobTriggerPathTemplate.render({
projectPath(project) {
return this._pathTemplates.projectPathTemplate.render({
project: project,
job_trigger: jobTrigger,
});
}

/**
* Return a fully-qualified project resource name string.
* Return a fully-qualified project_deidentify_template resource name string.
*
* @param {String} project
* @param {String} deidentifyTemplate
* @returns {String}
*/
projectPath(project) {
return this._pathTemplates.projectPathTemplate.render({
projectDeidentifyTemplatePath(project, deidentifyTemplate) {
return this._pathTemplates.projectDeidentifyTemplatePathTemplate.render({
project: project,
deidentify_template: deidentifyTemplate,
});
}

/**
* Return a fully-qualified dlp_job resource name string.
* Return a fully-qualified project_inspect_template resource name string.
*
* @param {String} project
* @param {String} dlpJob
* @param {String} inspectTemplate
* @returns {String}
*/
dlpJobPath(project, dlpJob) {
return this._pathTemplates.dlpJobPathTemplate.render({
projectInspectTemplatePath(project, inspectTemplate) {
return this._pathTemplates.projectInspectTemplatePathTemplate.render({
project: project,
dlp_job: dlpJob,
inspect_template: inspectTemplate,
});
}

/**
* Return a fully-qualified organization_stored_info_type resource name string.
* Return a fully-qualified project_job_trigger resource name string.
*
* @param {String} organization
* @param {String} storedInfoType
* @param {String} project
* @param {String} jobTrigger
* @returns {String}
*/
organizationStoredInfoTypePath(organization, storedInfoType) {
return this._pathTemplates.organizationStoredInfoTypePathTemplate.render({
organization: organization,
stored_info_type: storedInfoType,
projectJobTriggerPath(project, jobTrigger) {
return this._pathTemplates.projectJobTriggerPathTemplate.render({
project: project,
job_trigger: jobTrigger,
});
}

Expand All @@ -3033,6 +3033,28 @@ class DlpServiceClient {
});
}

/**
* Parse the dlpJobName from a dlp_job resource.
*
* @param {String} dlpJobName
* A fully-qualified path representing a dlp_job resources.
* @returns {String} - A string representing the project.
*/
matchProjectFromDlpJobName(dlpJobName) {
return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).project;
}

/**
* Parse the dlpJobName from a dlp_job resource.
*
* @param {String} dlpJobName
* A fully-qualified path representing a dlp_job resources.
* @returns {String} - A string representing the dlp_job.
*/
matchDlpJobFromDlpJobName(dlpJobName) {
return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).dlp_job;
}

/**
* Parse the organizationName from a organization resource.
*
Expand Down Expand Up @@ -3075,34 +3097,6 @@ class DlpServiceClient {
).deidentify_template;
}

/**
* Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.
*
* @param {String} projectDeidentifyTemplateName
* A fully-qualified path representing a project_deidentify_template resources.
* @returns {String} - A string representing the project.
*/
matchProjectFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName) {
return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(
projectDeidentifyTemplateName
).project;
}

/**
* Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.
*
* @param {String} projectDeidentifyTemplateName
* A fully-qualified path representing a project_deidentify_template resources.
* @returns {String} - A string representing the deidentify_template.
*/
matchDeidentifyTemplateFromProjectDeidentifyTemplateName(
projectDeidentifyTemplateName
) {
return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(
projectDeidentifyTemplateName
).deidentify_template;
}

/**
* Parse the organizationInspectTemplateName from a organization_inspect_template resource.
*
Expand Down Expand Up @@ -3133,6 +3127,75 @@ class DlpServiceClient {
).inspect_template;
}

/**
* Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource.
*
* @param {String} organizationStoredInfoTypeName
* A fully-qualified path representing a organization_stored_info_type resources.
* @returns {String} - A string representing the organization.
*/
matchOrganizationFromOrganizationStoredInfoTypeName(
organizationStoredInfoTypeName
) {
return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(
organizationStoredInfoTypeName
).organization;
}

/**
* Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource.
*
* @param {String} organizationStoredInfoTypeName
* A fully-qualified path representing a organization_stored_info_type resources.
* @returns {String} - A string representing the stored_info_type.
*/
matchStoredInfoTypeFromOrganizationStoredInfoTypeName(
organizationStoredInfoTypeName
) {
return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(
organizationStoredInfoTypeName
).stored_info_type;
}

/**
* Parse the projectName from a project resource.
*
* @param {String} projectName
* A fully-qualified path representing a project resources.
* @returns {String} - A string representing the project.
*/
matchProjectFromProjectName(projectName) {
return this._pathTemplates.projectPathTemplate.match(projectName).project;
}

/**
* Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.
*
* @param {String} projectDeidentifyTemplateName
* A fully-qualified path representing a project_deidentify_template resources.
* @returns {String} - A string representing the project.
*/
matchProjectFromProjectDeidentifyTemplateName(projectDeidentifyTemplateName) {
return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(
projectDeidentifyTemplateName
).project;
}

/**
* Parse the projectDeidentifyTemplateName from a project_deidentify_template resource.
*
* @param {String} projectDeidentifyTemplateName
* A fully-qualified path representing a project_deidentify_template resources.
* @returns {String} - A string representing the deidentify_template.
*/
matchDeidentifyTemplateFromProjectDeidentifyTemplateName(
projectDeidentifyTemplateName
) {
return this._pathTemplates.projectDeidentifyTemplatePathTemplate.match(
projectDeidentifyTemplateName
).deidentify_template;
}

/**
* Parse the projectInspectTemplateName from a project_inspect_template resource.
*
Expand Down Expand Up @@ -3187,69 +3250,6 @@ class DlpServiceClient {
).job_trigger;
}

/**
* Parse the projectName from a project resource.
*
* @param {String} projectName
* A fully-qualified path representing a project resources.
* @returns {String} - A string representing the project.
*/
matchProjectFromProjectName(projectName) {
return this._pathTemplates.projectPathTemplate.match(projectName).project;
}

/**
* Parse the dlpJobName from a dlp_job resource.
*
* @param {String} dlpJobName
* A fully-qualified path representing a dlp_job resources.
* @returns {String} - A string representing the project.
*/
matchProjectFromDlpJobName(dlpJobName) {
return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).project;
}

/**
* Parse the dlpJobName from a dlp_job resource.
*
* @param {String} dlpJobName
* A fully-qualified path representing a dlp_job resources.
* @returns {String} - A string representing the dlp_job.
*/
matchDlpJobFromDlpJobName(dlpJobName) {
return this._pathTemplates.dlpJobPathTemplate.match(dlpJobName).dlp_job;
}

/**
* Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource.
*
* @param {String} organizationStoredInfoTypeName
* A fully-qualified path representing a organization_stored_info_type resources.
* @returns {String} - A string representing the organization.
*/
matchOrganizationFromOrganizationStoredInfoTypeName(
organizationStoredInfoTypeName
) {
return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(
organizationStoredInfoTypeName
).organization;
}

/**
* Parse the organizationStoredInfoTypeName from a organization_stored_info_type resource.
*
* @param {String} organizationStoredInfoTypeName
* A fully-qualified path representing a organization_stored_info_type resources.
* @returns {String} - A string representing the stored_info_type.
*/
matchStoredInfoTypeFromOrganizationStoredInfoTypeName(
organizationStoredInfoTypeName
) {
return this._pathTemplates.organizationStoredInfoTypePathTemplate.match(
organizationStoredInfoTypeName
).stored_info_type;
}

/**
* Parse the projectStoredInfoTypeName from a project_stored_info_type resource.
*
Expand Down
Loading

0 comments on commit af65208

Please sign in to comment.