Skip to content

Commit efda438

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
chore: re-order template utils (#170)
1 parent 4228e6c commit efda438

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

packages/google-cloud-oslogin/src/v1beta/os_login_service_client.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ class OsLoginServiceClient {
103103
// identifiers to uniquely identify resources within the API.
104104
// Create useful helper objects for these.
105105
this._pathTemplates = {
106-
userPathTemplate: new gax.PathTemplate('users/{user}'),
107-
projectPathTemplate: new gax.PathTemplate(
108-
'users/{user}/projects/{project}'
109-
),
110106
fingerprintPathTemplate: new gax.PathTemplate(
111107
'users/{user}/sshPublicKeys/{fingerprint}'
112108
),
109+
projectPathTemplate: new gax.PathTemplate(
110+
'users/{user}/projects/{project}'
111+
),
112+
userPathTemplate: new gax.PathTemplate('users/{user}'),
113113
};
114114

115115
// Put together the default options sent with requests.
@@ -544,14 +544,16 @@ class OsLoginServiceClient {
544544
// --------------------
545545

546546
/**
547-
* Return a fully-qualified user resource name string.
547+
* Return a fully-qualified fingerprint resource name string.
548548
*
549549
* @param {String} user
550+
* @param {String} fingerprint
550551
* @returns {String}
551552
*/
552-
userPath(user) {
553-
return this._pathTemplates.userPathTemplate.render({
553+
fingerprintPath(user, fingerprint) {
554+
return this._pathTemplates.fingerprintPathTemplate.render({
554555
user: user,
556+
fingerprint: fingerprint,
555557
});
556558
}
557559

@@ -570,28 +572,39 @@ class OsLoginServiceClient {
570572
}
571573

572574
/**
573-
* Return a fully-qualified fingerprint resource name string.
575+
* Return a fully-qualified user resource name string.
574576
*
575577
* @param {String} user
576-
* @param {String} fingerprint
577578
* @returns {String}
578579
*/
579-
fingerprintPath(user, fingerprint) {
580-
return this._pathTemplates.fingerprintPathTemplate.render({
580+
userPath(user) {
581+
return this._pathTemplates.userPathTemplate.render({
581582
user: user,
582-
fingerprint: fingerprint,
583583
});
584584
}
585585

586586
/**
587-
* Parse the userName from a user resource.
587+
* Parse the fingerprintName from a fingerprint resource.
588588
*
589-
* @param {String} userName
590-
* A fully-qualified path representing a user resources.
589+
* @param {String} fingerprintName
590+
* A fully-qualified path representing a fingerprint resources.
591591
* @returns {String} - A string representing the user.
592592
*/
593-
matchUserFromUserName(userName) {
594-
return this._pathTemplates.userPathTemplate.match(userName).user;
593+
matchUserFromFingerprintName(fingerprintName) {
594+
return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName)
595+
.user;
596+
}
597+
598+
/**
599+
* Parse the fingerprintName from a fingerprint resource.
600+
*
601+
* @param {String} fingerprintName
602+
* A fully-qualified path representing a fingerprint resources.
603+
* @returns {String} - A string representing the fingerprint.
604+
*/
605+
matchFingerprintFromFingerprintName(fingerprintName) {
606+
return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName)
607+
.fingerprint;
595608
}
596609

597610
/**
@@ -617,27 +630,14 @@ class OsLoginServiceClient {
617630
}
618631

619632
/**
620-
* Parse the fingerprintName from a fingerprint resource.
633+
* Parse the userName from a user resource.
621634
*
622-
* @param {String} fingerprintName
623-
* A fully-qualified path representing a fingerprint resources.
635+
* @param {String} userName
636+
* A fully-qualified path representing a user resources.
624637
* @returns {String} - A string representing the user.
625638
*/
626-
matchUserFromFingerprintName(fingerprintName) {
627-
return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName)
628-
.user;
629-
}
630-
631-
/**
632-
* Parse the fingerprintName from a fingerprint resource.
633-
*
634-
* @param {String} fingerprintName
635-
* A fully-qualified path representing a fingerprint resources.
636-
* @returns {String} - A string representing the fingerprint.
637-
*/
638-
matchFingerprintFromFingerprintName(fingerprintName) {
639-
return this._pathTemplates.fingerprintPathTemplate.match(fingerprintName)
640-
.fingerprint;
639+
matchUserFromUserName(userName) {
640+
return this._pathTemplates.userPathTemplate.match(userName).user;
641641
}
642642
}
643643

packages/google-cloud-oslogin/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-04-21T11:48:42.204212Z",
2+
"updateTime": "2019-04-23T11:16:25.036325Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.26",
8-
"dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665"
7+
"version": "0.17.0",
8+
"dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "3369c803f56d52662ea3792076deb8545183bdb0",
16-
"internalRef": "244282812"
15+
"sha": "547e19e7df398e9290e8e3674d7351efc500f9b0",
16+
"internalRef": "244712781"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)