aws_sdk_amplifyuibuilder/operation/create_component/
_create_component_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 CreateComponentInput {
6    /// <p>The unique ID of the Amplify app to associate with the component.</p>
7    pub app_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the backend environment that is a part of the Amplify app.</p>
9    pub environment_name: ::std::option::Option<::std::string::String>,
10    /// <p>The unique client token.</p>
11    pub client_token: ::std::option::Option<::std::string::String>,
12    /// <p>Represents the configuration of the component to create.</p>
13    pub component_to_create: ::std::option::Option<crate::types::CreateComponentData>,
14}
15impl CreateComponentInput {
16    /// <p>The unique ID of the Amplify app to associate with the component.</p>
17    pub fn app_id(&self) -> ::std::option::Option<&str> {
18        self.app_id.as_deref()
19    }
20    /// <p>The name of the backend environment that is a part of the Amplify app.</p>
21    pub fn environment_name(&self) -> ::std::option::Option<&str> {
22        self.environment_name.as_deref()
23    }
24    /// <p>The unique client token.</p>
25    pub fn client_token(&self) -> ::std::option::Option<&str> {
26        self.client_token.as_deref()
27    }
28    /// <p>Represents the configuration of the component to create.</p>
29    pub fn component_to_create(&self) -> ::std::option::Option<&crate::types::CreateComponentData> {
30        self.component_to_create.as_ref()
31    }
32}
33impl CreateComponentInput {
34    /// Creates a new builder-style object to manufacture [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
35    pub fn builder() -> crate::operation::create_component::builders::CreateComponentInputBuilder {
36        crate::operation::create_component::builders::CreateComponentInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateComponentInputBuilder {
44    pub(crate) app_id: ::std::option::Option<::std::string::String>,
45    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
46    pub(crate) client_token: ::std::option::Option<::std::string::String>,
47    pub(crate) component_to_create: ::std::option::Option<crate::types::CreateComponentData>,
48}
49impl CreateComponentInputBuilder {
50    /// <p>The unique ID of the Amplify app to associate with the component.</p>
51    /// This field is required.
52    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.app_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The unique ID of the Amplify app to associate with the component.</p>
57    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.app_id = input;
59        self
60    }
61    /// <p>The unique ID of the Amplify app to associate with the component.</p>
62    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.app_id
64    }
65    /// <p>The name of the backend environment that is a part of the Amplify app.</p>
66    /// This field is required.
67    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.environment_name = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The name of the backend environment that is a part of the Amplify app.</p>
72    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.environment_name = input;
74        self
75    }
76    /// <p>The name of the backend environment that is a part of the Amplify app.</p>
77    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.environment_name
79    }
80    /// <p>The unique client token.</p>
81    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.client_token = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The unique client token.</p>
86    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.client_token = input;
88        self
89    }
90    /// <p>The unique client token.</p>
91    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
92        &self.client_token
93    }
94    /// <p>Represents the configuration of the component to create.</p>
95    /// This field is required.
96    pub fn component_to_create(mut self, input: crate::types::CreateComponentData) -> Self {
97        self.component_to_create = ::std::option::Option::Some(input);
98        self
99    }
100    /// <p>Represents the configuration of the component to create.</p>
101    pub fn set_component_to_create(mut self, input: ::std::option::Option<crate::types::CreateComponentData>) -> Self {
102        self.component_to_create = input;
103        self
104    }
105    /// <p>Represents the configuration of the component to create.</p>
106    pub fn get_component_to_create(&self) -> &::std::option::Option<crate::types::CreateComponentData> {
107        &self.component_to_create
108    }
109    /// Consumes the builder and constructs a [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::create_component::CreateComponentInput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::create_component::CreateComponentInput {
114            app_id: self.app_id,
115            environment_name: self.environment_name,
116            client_token: self.client_token,
117            component_to_create: self.component_to_create,
118        })
119    }
120}