@@ -238,6 +238,12 @@ func Update(ctx context.Context, client *gophercloud.ServiceClient, id string, o
238238 return
239239}
240240
241+ // RestoreOptsBuilder allows extensions to add additional parameters to the
242+ // Restore request.
243+ type RestoreOptsBuilder interface {
244+ ToRestoreMap () (map [string ]any , error )
245+ }
246+
241247// RestoreOpts contains options for restoring a Backup. This object is passed to
242248// the backups.RestoreFromBackup function.
243249type RestoreOpts struct {
@@ -257,7 +263,7 @@ func (opts RestoreOpts) ToRestoreMap() (map[string]any, error) {
257263// RestoreFromBackup will restore a Backup to a volume based on the values in
258264// RestoreOpts. To extract the Restore object from the response, call the
259265// Extract method on the RestoreResult.
260- func RestoreFromBackup (ctx context.Context , client * gophercloud.ServiceClient , id string , opts RestoreOpts ) (r RestoreResult ) {
266+ func RestoreFromBackup (ctx context.Context , client * gophercloud.ServiceClient , id string , opts RestoreOptsBuilder ) (r RestoreResult ) {
261267 b , err := opts .ToRestoreMap ()
262268 if err != nil {
263269 r .Err = err
@@ -278,6 +284,12 @@ func Export(ctx context.Context, client *gophercloud.ServiceClient, id string) (
278284 return
279285}
280286
287+ // ImportOptsBuilder allows extensions to add additional parameters to the
288+ // Import request.
289+ type ImportOptsBuilder interface {
290+ ToBackupImportMap () (map [string ]any , error )
291+ }
292+
281293// ImportOpts contains options for importing a Backup. This object is passed to
282294// the backups.ImportBackup function.
283295type ImportOpts BackupRecord
@@ -291,7 +303,7 @@ func (opts ImportOpts) ToBackupImportMap() (map[string]any, error) {
291303// Import will import a Backup data to a backup based on the values in
292304// ImportOpts. To extract the Backup object from the response, call the
293305// Extract method on the ImportResult.
294- func Import (ctx context.Context , client * gophercloud.ServiceClient , opts ImportOpts ) (r ImportResult ) {
306+ func Import (ctx context.Context , client * gophercloud.ServiceClient , opts ImportOptsBuilder ) (r ImportResult ) {
295307 b , err := opts .ToBackupImportMap ()
296308 if err != nil {
297309 r .Err = err
0 commit comments