aws_sdk_amplifybackend/operation/create_backend/
_create_backend_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request body for CreateBackend.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateBackendInput {
7    /// <p>The app ID.</p>
8    pub app_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the app.</p>
10    pub app_name: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the backend environment.</p>
12    pub backend_environment_name: ::std::option::Option<::std::string::String>,
13    /// <p>The resource configuration for creating a backend.</p>
14    pub resource_config: ::std::option::Option<crate::types::ResourceConfig>,
15    /// <p>The name of the resource.</p>
16    pub resource_name: ::std::option::Option<::std::string::String>,
17}
18impl CreateBackendInput {
19    /// <p>The app ID.</p>
20    pub fn app_id(&self) -> ::std::option::Option<&str> {
21        self.app_id.as_deref()
22    }
23    /// <p>The name of the app.</p>
24    pub fn app_name(&self) -> ::std::option::Option<&str> {
25        self.app_name.as_deref()
26    }
27    /// <p>The name of the backend environment.</p>
28    pub fn backend_environment_name(&self) -> ::std::option::Option<&str> {
29        self.backend_environment_name.as_deref()
30    }
31    /// <p>The resource configuration for creating a backend.</p>
32    pub fn resource_config(&self) -> ::std::option::Option<&crate::types::ResourceConfig> {
33        self.resource_config.as_ref()
34    }
35    /// <p>The name of the resource.</p>
36    pub fn resource_name(&self) -> ::std::option::Option<&str> {
37        self.resource_name.as_deref()
38    }
39}
40impl CreateBackendInput {
41    /// Creates a new builder-style object to manufacture [`CreateBackendInput`](crate::operation::create_backend::CreateBackendInput).
42    pub fn builder() -> crate::operation::create_backend::builders::CreateBackendInputBuilder {
43        crate::operation::create_backend::builders::CreateBackendInputBuilder::default()
44    }
45}
46
47/// A builder for [`CreateBackendInput`](crate::operation::create_backend::CreateBackendInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct CreateBackendInputBuilder {
51    pub(crate) app_id: ::std::option::Option<::std::string::String>,
52    pub(crate) app_name: ::std::option::Option<::std::string::String>,
53    pub(crate) backend_environment_name: ::std::option::Option<::std::string::String>,
54    pub(crate) resource_config: ::std::option::Option<crate::types::ResourceConfig>,
55    pub(crate) resource_name: ::std::option::Option<::std::string::String>,
56}
57impl CreateBackendInputBuilder {
58    /// <p>The app ID.</p>
59    /// This field is required.
60    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.app_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The app ID.</p>
65    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.app_id = input;
67        self
68    }
69    /// <p>The app ID.</p>
70    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.app_id
72    }
73    /// <p>The name of the app.</p>
74    /// This field is required.
75    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.app_name = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The name of the app.</p>
80    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.app_name = input;
82        self
83    }
84    /// <p>The name of the app.</p>
85    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
86        &self.app_name
87    }
88    /// <p>The name of the backend environment.</p>
89    /// This field is required.
90    pub fn backend_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.backend_environment_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the backend environment.</p>
95    pub fn set_backend_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.backend_environment_name = input;
97        self
98    }
99    /// <p>The name of the backend environment.</p>
100    pub fn get_backend_environment_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.backend_environment_name
102    }
103    /// <p>The resource configuration for creating a backend.</p>
104    pub fn resource_config(mut self, input: crate::types::ResourceConfig) -> Self {
105        self.resource_config = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The resource configuration for creating a backend.</p>
109    pub fn set_resource_config(mut self, input: ::std::option::Option<crate::types::ResourceConfig>) -> Self {
110        self.resource_config = input;
111        self
112    }
113    /// <p>The resource configuration for creating a backend.</p>
114    pub fn get_resource_config(&self) -> &::std::option::Option<crate::types::ResourceConfig> {
115        &self.resource_config
116    }
117    /// <p>The name of the resource.</p>
118    pub fn resource_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.resource_name = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The name of the resource.</p>
123    pub fn set_resource_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.resource_name = input;
125        self
126    }
127    /// <p>The name of the resource.</p>
128    pub fn get_resource_name(&self) -> &::std::option::Option<::std::string::String> {
129        &self.resource_name
130    }
131    /// Consumes the builder and constructs a [`CreateBackendInput`](crate::operation::create_backend::CreateBackendInput).
132    pub fn build(
133        self,
134    ) -> ::std::result::Result<crate::operation::create_backend::CreateBackendInput, ::aws_smithy_types::error::operation::BuildError> {
135        ::std::result::Result::Ok(crate::operation::create_backend::CreateBackendInput {
136            app_id: self.app_id,
137            app_name: self.app_name,
138            backend_environment_name: self.backend_environment_name,
139            resource_config: self.resource_config,
140            resource_name: self.resource_name,
141        })
142    }
143}