From 6b2cf2afdab9adfae85b42c74386885411a36943 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 6 May 2019 23:48:08 -0700 Subject: [PATCH] chore: alphabetize template methods (#190) --- .../src/v1/data_transfer_service_client.js | 110 +++++++++--------- .../synth.metadata | 10 +- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js index 92af3ce7f25..9bdbba3fbb2 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js @@ -103,16 +103,16 @@ class DataTransferServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { + projectPathTemplate: new gax.PathTemplate('projects/{project}'), projectDataSourcePathTemplate: new gax.PathTemplate( 'projects/{project}/dataSources/{data_source}' ), - projectPathTemplate: new gax.PathTemplate('projects/{project}'), - projectTransferConfigPathTemplate: new gax.PathTemplate( - 'projects/{project}/transferConfigs/{transfer_config}' - ), projectRunPathTemplate: new gax.PathTemplate( 'projects/{project}/transferConfigs/{transfer_config}/runs/{run}' ), + projectTransferConfigPathTemplate: new gax.PathTemplate( + 'projects/{project}/transferConfigs/{transfer_config}' + ), }; // Some of the methods on this service return "paged" results, @@ -1454,6 +1454,18 @@ class DataTransferServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified project resource name string. + * + * @param {String} project + * @returns {String} + */ + projectPath(project) { + return this._pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + /** * Return a fully-qualified project_data_source resource name string. * @@ -1469,14 +1481,18 @@ class DataTransferServiceClient { } /** - * Return a fully-qualified project resource name string. + * Return a fully-qualified project_run resource name string. * * @param {String} project + * @param {String} transferConfig + * @param {String} run * @returns {String} */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ + projectRunPath(project, transferConfig, run) { + return this._pathTemplates.projectRunPathTemplate.render({ project: project, + transfer_config: transferConfig, + run: run, }); } @@ -1495,19 +1511,14 @@ class DataTransferServiceClient { } /** - * Return a fully-qualified project_run resource name string. + * Parse the projectName from a project resource. * - * @param {String} project - * @param {String} transferConfig - * @param {String} run - * @returns {String} + * @param {String} projectName + * A fully-qualified path representing a project resources. + * @returns {String} - A string representing the project. */ - projectRunPath(project, transferConfig, run) { - return this._pathTemplates.projectRunPathTemplate.render({ - project: project, - transfer_config: transferConfig, - run: run, - }); + matchProjectFromProjectName(projectName) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; } /** @@ -1536,43 +1547,6 @@ class DataTransferServiceClient { ).data_source; } - /** - * 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 projectTransferConfigName from a project_transfer_config resource. - * - * @param {String} projectTransferConfigName - * A fully-qualified path representing a project_transfer_config resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectTransferConfigName(projectTransferConfigName) { - return this._pathTemplates.projectTransferConfigPathTemplate.match( - projectTransferConfigName - ).project; - } - - /** - * Parse the projectTransferConfigName from a project_transfer_config resource. - * - * @param {String} projectTransferConfigName - * A fully-qualified path representing a project_transfer_config resources. - * @returns {String} - A string representing the transfer_config. - */ - matchTransferConfigFromProjectTransferConfigName(projectTransferConfigName) { - return this._pathTemplates.projectTransferConfigPathTemplate.match( - projectTransferConfigName - ).transfer_config; - } - /** * Parse the projectRunName from a project_run resource. * @@ -1607,6 +1581,32 @@ class DataTransferServiceClient { matchRunFromProjectRunName(projectRunName) { return this._pathTemplates.projectRunPathTemplate.match(projectRunName).run; } + + /** + * Parse the projectTransferConfigName from a project_transfer_config resource. + * + * @param {String} projectTransferConfigName + * A fully-qualified path representing a project_transfer_config resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromProjectTransferConfigName(projectTransferConfigName) { + return this._pathTemplates.projectTransferConfigPathTemplate.match( + projectTransferConfigName + ).project; + } + + /** + * Parse the projectTransferConfigName from a project_transfer_config resource. + * + * @param {String} projectTransferConfigName + * A fully-qualified path representing a project_transfer_config resources. + * @returns {String} - A string representing the transfer_config. + */ + matchTransferConfigFromProjectTransferConfigName(projectTransferConfigName) { + return this._pathTemplates.projectTransferConfigPathTemplate.match( + projectTransferConfigName + ).transfer_config; + } } module.exports = DataTransferServiceClient; diff --git a/packages/google-cloud-bigquery-datatransfer/synth.metadata b/packages/google-cloud-bigquery-datatransfer/synth.metadata index c7a55b1e391..9802ef067ba 100644 --- a/packages/google-cloud-bigquery-datatransfer/synth.metadata +++ b/packages/google-cloud-bigquery-datatransfer/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-21T11:39:56.407632Z", + "updateTime": "2019-04-27T11:08:39.239165Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.26", - "dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665" + "version": "0.17.1", + "dockerImage": "googleapis/artman@sha256:a40ca4dd4ef031c0ded4df4909ffdf7b3f20d29b23e682ef991eb60ba0ca6025" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3369c803f56d52662ea3792076deb8545183bdb0", - "internalRef": "244282812" + "sha": "808110e242c682d7ac2bab6d9c49fc3bf72d7604", + "internalRef": "245313728" } }, {