Skip to main content

aws_sdk_backup/operation/create_restore_testing_selection/
_create_restore_testing_selection_output.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 CreateRestoreTestingSelectionOutput {
6    /// <p>The time that the resource testing selection was created.</p>
7    pub creation_time: ::aws_smithy_types::DateTime,
8    /// <p>The ARN of the restore testing plan with which the restore testing selection is associated.</p>
9    pub restore_testing_plan_arn: ::std::string::String,
10    /// <p>The name of the restore testing plan.</p>
11    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
12    pub restore_testing_plan_name: ::std::string::String,
13    /// <p>The name of the restore testing selection for the related restore testing plan.</p>
14    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
15    pub restore_testing_selection_name: ::std::string::String,
16    _request_id: Option<String>,
17}
18impl CreateRestoreTestingSelectionOutput {
19    /// <p>The time that the resource testing selection was created.</p>
20    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
21        &self.creation_time
22    }
23    /// <p>The ARN of the restore testing plan with which the restore testing selection is associated.</p>
24    pub fn restore_testing_plan_arn(&self) -> &str {
25        use std::ops::Deref;
26        self.restore_testing_plan_arn.deref()
27    }
28    /// <p>The name of the restore testing plan.</p>
29    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
30    pub fn restore_testing_plan_name(&self) -> &str {
31        use std::ops::Deref;
32        self.restore_testing_plan_name.deref()
33    }
34    /// <p>The name of the restore testing selection for the related restore testing plan.</p>
35    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
36    pub fn restore_testing_selection_name(&self) -> &str {
37        use std::ops::Deref;
38        self.restore_testing_selection_name.deref()
39    }
40}
41impl ::aws_types::request_id::RequestId for CreateRestoreTestingSelectionOutput {
42    fn request_id(&self) -> Option<&str> {
43        self._request_id.as_deref()
44    }
45}
46impl CreateRestoreTestingSelectionOutput {
47    /// Creates a new builder-style object to manufacture [`CreateRestoreTestingSelectionOutput`](crate::operation::create_restore_testing_selection::CreateRestoreTestingSelectionOutput).
48    pub fn builder() -> crate::operation::create_restore_testing_selection::builders::CreateRestoreTestingSelectionOutputBuilder {
49        crate::operation::create_restore_testing_selection::builders::CreateRestoreTestingSelectionOutputBuilder::default()
50    }
51}
52
53/// A builder for [`CreateRestoreTestingSelectionOutput`](crate::operation::create_restore_testing_selection::CreateRestoreTestingSelectionOutput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct CreateRestoreTestingSelectionOutputBuilder {
57    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
58    pub(crate) restore_testing_plan_arn: ::std::option::Option<::std::string::String>,
59    pub(crate) restore_testing_plan_name: ::std::option::Option<::std::string::String>,
60    pub(crate) restore_testing_selection_name: ::std::option::Option<::std::string::String>,
61    _request_id: Option<String>,
62}
63impl CreateRestoreTestingSelectionOutputBuilder {
64    /// <p>The time that the resource testing selection was created.</p>
65    /// This field is required.
66    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
67        self.creation_time = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The time that the resource testing selection was created.</p>
71    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
72        self.creation_time = input;
73        self
74    }
75    /// <p>The time that the resource testing selection was created.</p>
76    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
77        &self.creation_time
78    }
79    /// <p>The ARN of the restore testing plan with which the restore testing selection is associated.</p>
80    /// This field is required.
81    pub fn restore_testing_plan_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.restore_testing_plan_arn = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The ARN of the restore testing plan with which the restore testing selection is associated.</p>
86    pub fn set_restore_testing_plan_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.restore_testing_plan_arn = input;
88        self
89    }
90    /// <p>The ARN of the restore testing plan with which the restore testing selection is associated.</p>
91    pub fn get_restore_testing_plan_arn(&self) -> &::std::option::Option<::std::string::String> {
92        &self.restore_testing_plan_arn
93    }
94    /// <p>The name of the restore testing plan.</p>
95    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
96    /// This field is required.
97    pub fn restore_testing_plan_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.restore_testing_plan_name = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The name of the restore testing plan.</p>
102    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
103    pub fn set_restore_testing_plan_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.restore_testing_plan_name = input;
105        self
106    }
107    /// <p>The name of the restore testing plan.</p>
108    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
109    pub fn get_restore_testing_plan_name(&self) -> &::std::option::Option<::std::string::String> {
110        &self.restore_testing_plan_name
111    }
112    /// <p>The name of the restore testing selection for the related restore testing plan.</p>
113    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
114    /// This field is required.
115    pub fn restore_testing_selection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.restore_testing_selection_name = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The name of the restore testing selection for the related restore testing plan.</p>
120    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
121    pub fn set_restore_testing_selection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.restore_testing_selection_name = input;
123        self
124    }
125    /// <p>The name of the restore testing selection for the related restore testing plan.</p>
126    /// <p>The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.</p>
127    pub fn get_restore_testing_selection_name(&self) -> &::std::option::Option<::std::string::String> {
128        &self.restore_testing_selection_name
129    }
130    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
131        self._request_id = Some(request_id.into());
132        self
133    }
134
135    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
136        self._request_id = request_id;
137        self
138    }
139    /// Consumes the builder and constructs a [`CreateRestoreTestingSelectionOutput`](crate::operation::create_restore_testing_selection::CreateRestoreTestingSelectionOutput).
140    /// This method will fail if any of the following fields are not set:
141    /// - [`creation_time`](crate::operation::create_restore_testing_selection::builders::CreateRestoreTestingSelectionOutputBuilder::creation_time)
142    /// - [`restore_testing_plan_arn`](crate::operation::create_restore_testing_selection::builders::CreateRestoreTestingSelectionOutputBuilder::restore_testing_plan_arn)
143    /// - [`restore_testing_plan_name`](crate::operation::create_restore_testing_selection::builders::CreateRestoreTestingSelectionOutputBuilder::restore_testing_plan_name)
144    /// - [`restore_testing_selection_name`](crate::operation::create_restore_testing_selection::builders::CreateRestoreTestingSelectionOutputBuilder::restore_testing_selection_name)
145    pub fn build(
146        self,
147    ) -> ::std::result::Result<
148        crate::operation::create_restore_testing_selection::CreateRestoreTestingSelectionOutput,
149        ::aws_smithy_types::error::operation::BuildError,
150    > {
151        ::std::result::Result::Ok(crate::operation::create_restore_testing_selection::CreateRestoreTestingSelectionOutput {
152            creation_time: self.creation_time.ok_or_else(|| {
153                ::aws_smithy_types::error::operation::BuildError::missing_field(
154                    "creation_time",
155                    "creation_time was not specified but it is required when building CreateRestoreTestingSelectionOutput",
156                )
157            })?,
158            restore_testing_plan_arn: self.restore_testing_plan_arn.ok_or_else(|| {
159                ::aws_smithy_types::error::operation::BuildError::missing_field(
160                    "restore_testing_plan_arn",
161                    "restore_testing_plan_arn was not specified but it is required when building CreateRestoreTestingSelectionOutput",
162                )
163            })?,
164            restore_testing_plan_name: self.restore_testing_plan_name.ok_or_else(|| {
165                ::aws_smithy_types::error::operation::BuildError::missing_field(
166                    "restore_testing_plan_name",
167                    "restore_testing_plan_name was not specified but it is required when building CreateRestoreTestingSelectionOutput",
168                )
169            })?,
170            restore_testing_selection_name: self.restore_testing_selection_name.ok_or_else(|| {
171                ::aws_smithy_types::error::operation::BuildError::missing_field(
172                    "restore_testing_selection_name",
173                    "restore_testing_selection_name was not specified but it is required when building CreateRestoreTestingSelectionOutput",
174                )
175            })?,
176            _request_id: self._request_id,
177        })
178    }
179}