Skip to content

Commit

Permalink
chore: alphabetize template methods (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and sofisl committed Oct 13, 2022
1 parent a200e1c commit 6b2cf2a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
*
Expand All @@ -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,
});
}

Expand All @@ -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;
}

/**
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
10 changes: 5 additions & 5 deletions packages/google-cloud-bigquery-datatransfer/synth.metadata
Original file line number Diff line number Diff line change
@@ -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"
}
},
{
Expand Down

0 comments on commit 6b2cf2a

Please sign in to comment.