Skip to main content

aws_sdk_cloudhsmv2/operation/restore_backup/
_restore_backup_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RestoreBackupInput {
6    /// <p>The ID of the backup to be restored. To find the ID of a backup, use the <code>DescribeBackups</code> operation.</p>
7    pub backup_id: ::std::option::Option<::std::string::String>,
8}
9impl RestoreBackupInput {
10    /// <p>The ID of the backup to be restored. To find the ID of a backup, use the <code>DescribeBackups</code> operation.</p>
11    pub fn backup_id(&self) -> ::std::option::Option<&str> {
12        self.backup_id.as_deref()
13    }
14}
15impl RestoreBackupInput {
16    /// Creates a new builder-style object to manufacture [`RestoreBackupInput`](crate::operation::restore_backup::RestoreBackupInput).
17    pub fn builder() -> crate::operation::restore_backup::builders::RestoreBackupInputBuilder {
18        crate::operation::restore_backup::builders::RestoreBackupInputBuilder::default()
19    }
20}
21
22/// A builder for [`RestoreBackupInput`](crate::operation::restore_backup::RestoreBackupInput).
23#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
24#[non_exhaustive]
25pub struct RestoreBackupInputBuilder {
26    pub(crate) backup_id: ::std::option::Option<::std::string::String>,
27}
28impl RestoreBackupInputBuilder {
29    /// <p>The ID of the backup to be restored. To find the ID of a backup, use the <code>DescribeBackups</code> operation.</p>
30    /// This field is required.
31    pub fn backup_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
32        self.backup_id = ::std::option::Option::Some(input.into());
33        self
34    }
35    /// <p>The ID of the backup to be restored. To find the ID of a backup, use the <code>DescribeBackups</code> operation.</p>
36    pub fn set_backup_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
37        self.backup_id = input;
38        self
39    }
40    /// <p>The ID of the backup to be restored. To find the ID of a backup, use the <code>DescribeBackups</code> operation.</p>
41    pub fn get_backup_id(&self) -> &::std::option::Option<::std::string::String> {
42        &self.backup_id
43    }
44    /// Consumes the builder and constructs a [`RestoreBackupInput`](crate::operation::restore_backup::RestoreBackupInput).
45    pub fn build(
46        self,
47    ) -> ::std::result::Result<crate::operation::restore_backup::RestoreBackupInput, ::aws_smithy_types::error::operation::BuildError> {
48        ::std::result::Result::Ok(crate::operation::restore_backup::RestoreBackupInput { backup_id: self.backup_id })
49    }
50}