@@ -232,7 +232,13 @@ export class SecretManagerServiceClient {
232232 'projects/{project}/secrets/{secret}' ,
233233 ) ,
234234 topicPathTemplate : new this . _gaxModule . PathTemplate (
235- 'projects/{project}/topics/{topic}' ,
235+ 'projects/{project}/topics/{topic}'
236+ ) ,
237+ secretPathTemplate : new this . _gaxModule . PathTemplate (
238+ 'projects/{project}/secrets/{secret}'
239+ ) ,
240+ secretVersionPathTemplate : new this . _gaxModule . PathTemplate (
241+ 'projects/{project}/secrets/{secret}/versions/{secret_version}'
236242 ) ,
237243 } ;
238244
@@ -3289,4 +3295,90 @@ export class SecretManagerServiceClient {
32893295 }
32903296 return Promise . resolve ( ) ;
32913297 }
3298+
3299+ /**
3300+ * Return a fully-qualified project resource name string.
3301+ *
3302+ * @param {string } project
3303+ * @returns {string } Resource name string.
3304+ */
3305+ secretPath ( project : string , secret : string ) {
3306+ return this . pathTemplates . secretPathTemplate . render ( {
3307+ project : project ,
3308+ secret : secret ,
3309+ } ) ;
3310+ }
3311+
3312+ /**
3313+ * Parse the project from Secret resource.
3314+ *
3315+ * @param {string } secretName
3316+ * A fully-qualified path representing Secret resource.
3317+ * @returns {string } A string representing the project.
3318+ */
3319+ matchProjectFromSecretName ( secretName : string ) {
3320+ return this . pathTemplates . secretPathTemplate . match ( secretName ) . project ;
3321+ }
3322+
3323+ /**
3324+ * Parse the secret from Secret resource.
3325+ *
3326+ * @param {string } secretName
3327+ * A fully-qualified path representing Secret resource.
3328+ * @returns {string } A string representing the secret.
3329+ */
3330+ matchSecretFromSecretName ( secretName : string ) {
3331+ return this . pathTemplates . secretPathTemplate . match ( secretName ) . secret ;
3332+ }
3333+
3334+ /**
3335+ * Return a fully-qualified secretVersion resource name string.
3336+ *
3337+ * @param {string } project
3338+ * @param {string } secret
3339+ * @param {string } secret_version
3340+ * @returns {string } Resource name string.
3341+ */
3342+ secretVersionPath ( project : string , secret : string , secretVersion : string ) {
3343+ return this . pathTemplates . secretVersionPathTemplate . render ( {
3344+ project : project ,
3345+ secret : secret ,
3346+ secret_version : secretVersion ,
3347+ } ) ;
3348+ }
3349+
3350+ /**
3351+ * Parse the project from SecretVersion resource.
3352+ *
3353+ * @param {string } secretVersionName
3354+ * A fully-qualified path representing SecretVersion resource.
3355+ * @returns {string } A string representing the project.
3356+ */
3357+ matchProjectFromSecretVersionName ( secretVersionName : string ) {
3358+ return this . pathTemplates . secretVersionPathTemplate . match ( secretVersionName )
3359+ . project ;
3360+ }
3361+ /**
3362+ * Parse the secret from SecretVersion resource.
3363+ *
3364+ * @param {string } secretVersionName
3365+ * A fully-qualified path representing SecretVersion resource.
3366+ * @returns {string } A string representing the secret.
3367+ */
3368+ matchSecretFromSecretVersionName ( secretVersionName : string ) {
3369+ return this . pathTemplates . secretVersionPathTemplate . match ( secretVersionName )
3370+ . secret ;
3371+ }
3372+
3373+ /**
3374+ * Parse the secret_version from SecretVersion resource.
3375+ *
3376+ * @param {string } secretVersionName
3377+ * A fully-qualified path representing SecretVersion resource.
3378+ * @returns {string } A string representing the secret_version.
3379+ */
3380+ matchSecretVersionFromSecretVersionName ( secretVersionName : string ) {
3381+ return this . pathTemplates . secretVersionPathTemplate . match ( secretVersionName )
3382+ . secret_version ;
3383+ }
32923384}
0 commit comments