@@ -46,6 +46,8 @@ import type {
4646 ListTagsRequest ,
4747 ListTagsResponse ,
4848 ProtectSecretRequest ,
49+ RestoreSecretRequest ,
50+ RestoreSecretVersionRequest ,
4951 Secret ,
5052 SecretVersion ,
5153 UnprotectSecretRequest ,
@@ -497,4 +499,40 @@ export class API extends ParentAPI {
497499 */
498500 listSecretTypes = ( request : Readonly < ListSecretTypesRequest > = { } ) =>
499501 enrichForPagination ( 'types' , this . pageOfListSecretTypes , request )
502+
503+ /**
504+ * Restore a version. Restore a secret's version specified by the `region`,
505+ * `secret_id` and `revision` parameters.
506+ *
507+ * @param request - The request {@link RestoreSecretVersionRequest}
508+ * @returns A Promise of SecretVersion
509+ */
510+ restoreSecretVersion = ( request : Readonly < RestoreSecretVersionRequest > ) =>
511+ this . client . fetch < SecretVersion > (
512+ {
513+ body : '{}' ,
514+ headers : jsonContentHeaders ,
515+ method : 'POST' ,
516+ path : `/secret-manager/v1beta1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /secrets/${ validatePathParam ( 'secretId' , request . secretId ) } /versions/${ validatePathParam ( 'revision' , request . revision ) } /restore` ,
517+ } ,
518+ unmarshalSecretVersion ,
519+ )
520+
521+ /**
522+ * Restore a secret. Restore a secret and all its versions scheduled for
523+ * deletion specified by the `region` and `secret_id` parameters.
524+ *
525+ * @param request - The request {@link RestoreSecretRequest}
526+ * @returns A Promise of Secret
527+ */
528+ restoreSecret = ( request : Readonly < RestoreSecretRequest > ) =>
529+ this . client . fetch < Secret > (
530+ {
531+ body : '{}' ,
532+ headers : jsonContentHeaders ,
533+ method : 'POST' ,
534+ path : `/secret-manager/v1beta1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /secrets/${ validatePathParam ( 'secretId' , request . secretId ) } /restore` ,
535+ } ,
536+ unmarshalSecret ,
537+ )
500538}
0 commit comments