From e957e7400e1df8853f591aa43f87f0d215195597 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 23 Apr 2019 15:12:02 -0700 Subject: [PATCH] chore: re-order template utils (#170) --- .../src/v1beta/os_login_service_client.js | 70 +++++++++---------- packages/google-cloud-oslogin/synth.metadata | 10 +-- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.js b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.js index 530b300c7d7..2330ae33f13 100644 --- a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.js +++ b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.js @@ -103,13 +103,13 @@ class OsLoginServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - userPathTemplate: new gax.PathTemplate('users/{user}'), - projectPathTemplate: new gax.PathTemplate( - 'users/{user}/projects/{project}' - ), fingerprintPathTemplate: new gax.PathTemplate( 'users/{user}/sshPublicKeys/{fingerprint}' ), + projectPathTemplate: new gax.PathTemplate( + 'users/{user}/projects/{project}' + ), + userPathTemplate: new gax.PathTemplate('users/{user}'), }; // Put together the default options sent with requests. @@ -544,14 +544,16 @@ class OsLoginServiceClient { // -------------------- /** - * Return a fully-qualified user resource name string. + * Return a fully-qualified fingerprint resource name string. * * @param {String} user + * @param {String} fingerprint * @returns {String} */ - userPath(user) { - return this._pathTemplates.userPathTemplate.render({ + fingerprintPath(user, fingerprint) { + return this._pathTemplates.fingerprintPathTemplate.render({ user: user, + fingerprint: fingerprint, }); } @@ -570,28 +572,39 @@ class OsLoginServiceClient { } /** - * Return a fully-qualified fingerprint resource name string. + * Return a fully-qualified user resource name string. * * @param {String} user - * @param {String} fingerprint * @returns {String} */ - fingerprintPath(user, fingerprint) { - return this._pathTemplates.fingerprintPathTemplate.render({ + userPath(user) { + return this._pathTemplates.userPathTemplate.render({ user: user, - fingerprint: fingerprint, }); } /** - * Parse the userName from a user resource. + * Parse the fingerprintName from a fingerprint resource. * - * @param {String} userName - * A fully-qualified path representing a user resources. + * @param {String} fingerprintName + * A fully-qualified path representing a fingerprint resources. * @returns {String} - A string representing the user. */ - matchUserFromUserName(userName) { - return this._pathTemplates.userPathTemplate.match(userName).user; + matchUserFromFingerprintName(fingerprintName) { + return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName) + .user; + } + + /** + * Parse the fingerprintName from a fingerprint resource. + * + * @param {String} fingerprintName + * A fully-qualified path representing a fingerprint resources. + * @returns {String} - A string representing the fingerprint. + */ + matchFingerprintFromFingerprintName(fingerprintName) { + return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName) + .fingerprint; } /** @@ -617,27 +630,14 @@ class OsLoginServiceClient { } /** - * Parse the fingerprintName from a fingerprint resource. + * Parse the userName from a user resource. * - * @param {String} fingerprintName - * A fully-qualified path representing a fingerprint resources. + * @param {String} userName + * A fully-qualified path representing a user resources. * @returns {String} - A string representing the user. */ - matchUserFromFingerprintName(fingerprintName) { - return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName) - .user; - } - - /** - * Parse the fingerprintName from a fingerprint resource. - * - * @param {String} fingerprintName - * A fully-qualified path representing a fingerprint resources. - * @returns {String} - A string representing the fingerprint. - */ - matchFingerprintFromFingerprintName(fingerprintName) { - return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName) - .fingerprint; + matchUserFromUserName(userName) { + return this._pathTemplates.userPathTemplate.match(userName).user; } } diff --git a/packages/google-cloud-oslogin/synth.metadata b/packages/google-cloud-oslogin/synth.metadata index b7a11bd26ee..2a3cf24668e 100644 --- a/packages/google-cloud-oslogin/synth.metadata +++ b/packages/google-cloud-oslogin/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-21T11:48:42.204212Z", + "updateTime": "2019-04-23T11:16:25.036325Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.26", - "dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665" + "version": "0.17.0", + "dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3369c803f56d52662ea3792076deb8545183bdb0", - "internalRef": "244282812" + "sha": "547e19e7df398e9290e8e3674d7351efc500f9b0", + "internalRef": "244712781" } }, {