aws_sdk_amplifybackend/operation/clone_backend/
_clone_backend_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request body for CloneBackend.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CloneBackendInput {
7    /// <p>The app ID.</p>
8    pub app_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the backend environment.</p>
10    pub backend_environment_name: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the destination backend environment to be created.</p>
12    pub target_environment_name: ::std::option::Option<::std::string::String>,
13}
14impl CloneBackendInput {
15    /// <p>The app ID.</p>
16    pub fn app_id(&self) -> ::std::option::Option<&str> {
17        self.app_id.as_deref()
18    }
19    /// <p>The name of the backend environment.</p>
20    pub fn backend_environment_name(&self) -> ::std::option::Option<&str> {
21        self.backend_environment_name.as_deref()
22    }
23    /// <p>The name of the destination backend environment to be created.</p>
24    pub fn target_environment_name(&self) -> ::std::option::Option<&str> {
25        self.target_environment_name.as_deref()
26    }
27}
28impl CloneBackendInput {
29    /// Creates a new builder-style object to manufacture [`CloneBackendInput`](crate::operation::clone_backend::CloneBackendInput).
30    pub fn builder() -> crate::operation::clone_backend::builders::CloneBackendInputBuilder {
31        crate::operation::clone_backend::builders::CloneBackendInputBuilder::default()
32    }
33}
34
35/// A builder for [`CloneBackendInput`](crate::operation::clone_backend::CloneBackendInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CloneBackendInputBuilder {
39    pub(crate) app_id: ::std::option::Option<::std::string::String>,
40    pub(crate) backend_environment_name: ::std::option::Option<::std::string::String>,
41    pub(crate) target_environment_name: ::std::option::Option<::std::string::String>,
42}
43impl CloneBackendInputBuilder {
44    /// <p>The app ID.</p>
45    /// This field is required.
46    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.app_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The app ID.</p>
51    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.app_id = input;
53        self
54    }
55    /// <p>The app ID.</p>
56    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.app_id
58    }
59    /// <p>The name of the backend environment.</p>
60    /// This field is required.
61    pub fn backend_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.backend_environment_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the backend environment.</p>
66    pub fn set_backend_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.backend_environment_name = input;
68        self
69    }
70    /// <p>The name of the backend environment.</p>
71    pub fn get_backend_environment_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.backend_environment_name
73    }
74    /// <p>The name of the destination backend environment to be created.</p>
75    /// This field is required.
76    pub fn target_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.target_environment_name = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The name of the destination backend environment to be created.</p>
81    pub fn set_target_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.target_environment_name = input;
83        self
84    }
85    /// <p>The name of the destination backend environment to be created.</p>
86    pub fn get_target_environment_name(&self) -> &::std::option::Option<::std::string::String> {
87        &self.target_environment_name
88    }
89    /// Consumes the builder and constructs a [`CloneBackendInput`](crate::operation::clone_backend::CloneBackendInput).
90    pub fn build(
91        self,
92    ) -> ::std::result::Result<crate::operation::clone_backend::CloneBackendInput, ::aws_smithy_types::error::operation::BuildError> {
93        ::std::result::Result::Ok(crate::operation::clone_backend::CloneBackendInput {
94            app_id: self.app_id,
95            backend_environment_name: self.backend_environment_name,
96            target_environment_name: self.target_environment_name,
97        })
98    }
99}