aws_sdk_proton/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)]
5pub struct CreateComponentInput {
6    /// <p>The customer-provided name of the component.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>An optional customer-provided description of the component.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
11    pub service_name: ::std::option::Option<::std::string::String>,
12    /// <p>The name of the service instance that you want to attach this component to. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
13    pub service_instance_name: ::std::option::Option<::std::string::String>,
14    /// <p>The name of the Proton environment that you want to associate this component with. You must specify this when you don't specify <code>serviceInstanceName</code> and <code>serviceName</code>.</p>
15    pub environment_name: ::std::option::Option<::std::string::String>,
16    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
17    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
18    /// </note>
19    pub template_file: ::std::option::Option<::std::string::String>,
20    /// <p>A path to a manifest file that lists the Infrastructure as Code (IaC) file, template language, and rendering engine for infrastructure that a custom component provisions.</p>
21    pub manifest: ::std::option::Option<::std::string::String>,
22    /// <p>The service spec that you want the component to use to access service inputs. Set this only when you attach the component to a service instance.</p>
23    pub service_spec: ::std::option::Option<::std::string::String>,
24    /// <p>An optional list of metadata items that you can associate with the Proton component. A tag is a key-value pair.</p>
25    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
26    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
27    /// <p>The client token for the created component.</p>
28    pub client_token: ::std::option::Option<::std::string::String>,
29}
30impl CreateComponentInput {
31    /// <p>The customer-provided name of the component.</p>
32    pub fn name(&self) -> ::std::option::Option<&str> {
33        self.name.as_deref()
34    }
35    /// <p>An optional customer-provided description of the component.</p>
36    pub fn description(&self) -> ::std::option::Option<&str> {
37        self.description.as_deref()
38    }
39    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
40    pub fn service_name(&self) -> ::std::option::Option<&str> {
41        self.service_name.as_deref()
42    }
43    /// <p>The name of the service instance that you want to attach this component to. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
44    pub fn service_instance_name(&self) -> ::std::option::Option<&str> {
45        self.service_instance_name.as_deref()
46    }
47    /// <p>The name of the Proton environment that you want to associate this component with. You must specify this when you don't specify <code>serviceInstanceName</code> and <code>serviceName</code>.</p>
48    pub fn environment_name(&self) -> ::std::option::Option<&str> {
49        self.environment_name.as_deref()
50    }
51    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
52    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
53    /// </note>
54    pub fn template_file(&self) -> ::std::option::Option<&str> {
55        self.template_file.as_deref()
56    }
57    /// <p>A path to a manifest file that lists the Infrastructure as Code (IaC) file, template language, and rendering engine for infrastructure that a custom component provisions.</p>
58    pub fn manifest(&self) -> ::std::option::Option<&str> {
59        self.manifest.as_deref()
60    }
61    /// <p>The service spec that you want the component to use to access service inputs. Set this only when you attach the component to a service instance.</p>
62    pub fn service_spec(&self) -> ::std::option::Option<&str> {
63        self.service_spec.as_deref()
64    }
65    /// <p>An optional list of metadata items that you can associate with the Proton component. A tag is a key-value pair.</p>
66    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
67    ///
68    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
69    pub fn tags(&self) -> &[crate::types::Tag] {
70        self.tags.as_deref().unwrap_or_default()
71    }
72    /// <p>The client token for the created component.</p>
73    pub fn client_token(&self) -> ::std::option::Option<&str> {
74        self.client_token.as_deref()
75    }
76}
77impl ::std::fmt::Debug for CreateComponentInput {
78    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
79        let mut formatter = f.debug_struct("CreateComponentInput");
80        formatter.field("name", &self.name);
81        formatter.field("description", &"*** Sensitive Data Redacted ***");
82        formatter.field("service_name", &self.service_name);
83        formatter.field("service_instance_name", &self.service_instance_name);
84        formatter.field("environment_name", &self.environment_name);
85        formatter.field("template_file", &"*** Sensitive Data Redacted ***");
86        formatter.field("manifest", &"*** Sensitive Data Redacted ***");
87        formatter.field("service_spec", &"*** Sensitive Data Redacted ***");
88        formatter.field("tags", &self.tags);
89        formatter.field("client_token", &self.client_token);
90        formatter.finish()
91    }
92}
93impl CreateComponentInput {
94    /// Creates a new builder-style object to manufacture [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
95    pub fn builder() -> crate::operation::create_component::builders::CreateComponentInputBuilder {
96        crate::operation::create_component::builders::CreateComponentInputBuilder::default()
97    }
98}
99
100/// A builder for [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
101#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
102#[non_exhaustive]
103pub struct CreateComponentInputBuilder {
104    pub(crate) name: ::std::option::Option<::std::string::String>,
105    pub(crate) description: ::std::option::Option<::std::string::String>,
106    pub(crate) service_name: ::std::option::Option<::std::string::String>,
107    pub(crate) service_instance_name: ::std::option::Option<::std::string::String>,
108    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
109    pub(crate) template_file: ::std::option::Option<::std::string::String>,
110    pub(crate) manifest: ::std::option::Option<::std::string::String>,
111    pub(crate) service_spec: ::std::option::Option<::std::string::String>,
112    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
113    pub(crate) client_token: ::std::option::Option<::std::string::String>,
114}
115impl CreateComponentInputBuilder {
116    /// <p>The customer-provided name of the component.</p>
117    /// This field is required.
118    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.name = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The customer-provided name of the component.</p>
123    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.name = input;
125        self
126    }
127    /// <p>The customer-provided name of the component.</p>
128    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
129        &self.name
130    }
131    /// <p>An optional customer-provided description of the component.</p>
132    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.description = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <p>An optional customer-provided description of the component.</p>
137    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.description = input;
139        self
140    }
141    /// <p>An optional customer-provided description of the component.</p>
142    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
143        &self.description
144    }
145    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
146    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.service_name = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
151    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.service_name = input;
153        self
154    }
155    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
156    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
157        &self.service_name
158    }
159    /// <p>The name of the service instance that you want to attach this component to. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
160    pub fn service_instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.service_instance_name = ::std::option::Option::Some(input.into());
162        self
163    }
164    /// <p>The name of the service instance that you want to attach this component to. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
165    pub fn set_service_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.service_instance_name = input;
167        self
168    }
169    /// <p>The name of the service instance that you want to attach this component to. If you don't specify this, the component isn't attached to any service instance. Specify both <code>serviceInstanceName</code> and <code>serviceName</code> or neither of them.</p>
170    pub fn get_service_instance_name(&self) -> &::std::option::Option<::std::string::String> {
171        &self.service_instance_name
172    }
173    /// <p>The name of the Proton environment that you want to associate this component with. You must specify this when you don't specify <code>serviceInstanceName</code> and <code>serviceName</code>.</p>
174    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.environment_name = ::std::option::Option::Some(input.into());
176        self
177    }
178    /// <p>The name of the Proton environment that you want to associate this component with. You must specify this when you don't specify <code>serviceInstanceName</code> and <code>serviceName</code>.</p>
179    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.environment_name = input;
181        self
182    }
183    /// <p>The name of the Proton environment that you want to associate this component with. You must specify this when you don't specify <code>serviceInstanceName</code> and <code>serviceName</code>.</p>
184    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
185        &self.environment_name
186    }
187    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
188    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
189    /// </note>
190    /// This field is required.
191    pub fn template_file(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.template_file = ::std::option::Option::Some(input.into());
193        self
194    }
195    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
196    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
197    /// </note>
198    pub fn set_template_file(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.template_file = input;
200        self
201    }
202    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
203    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
204    /// </note>
205    pub fn get_template_file(&self) -> &::std::option::Option<::std::string::String> {
206        &self.template_file
207    }
208    /// <p>A path to a manifest file that lists the Infrastructure as Code (IaC) file, template language, and rendering engine for infrastructure that a custom component provisions.</p>
209    /// This field is required.
210    pub fn manifest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.manifest = ::std::option::Option::Some(input.into());
212        self
213    }
214    /// <p>A path to a manifest file that lists the Infrastructure as Code (IaC) file, template language, and rendering engine for infrastructure that a custom component provisions.</p>
215    pub fn set_manifest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.manifest = input;
217        self
218    }
219    /// <p>A path to a manifest file that lists the Infrastructure as Code (IaC) file, template language, and rendering engine for infrastructure that a custom component provisions.</p>
220    pub fn get_manifest(&self) -> &::std::option::Option<::std::string::String> {
221        &self.manifest
222    }
223    /// <p>The service spec that you want the component to use to access service inputs. Set this only when you attach the component to a service instance.</p>
224    pub fn service_spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225        self.service_spec = ::std::option::Option::Some(input.into());
226        self
227    }
228    /// <p>The service spec that you want the component to use to access service inputs. Set this only when you attach the component to a service instance.</p>
229    pub fn set_service_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230        self.service_spec = input;
231        self
232    }
233    /// <p>The service spec that you want the component to use to access service inputs. Set this only when you attach the component to a service instance.</p>
234    pub fn get_service_spec(&self) -> &::std::option::Option<::std::string::String> {
235        &self.service_spec
236    }
237    /// Appends an item to `tags`.
238    ///
239    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
240    ///
241    /// <p>An optional list of metadata items that you can associate with the Proton component. A tag is a key-value pair.</p>
242    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
243    pub fn tags(mut self, input: crate::types::Tag) -> Self {
244        let mut v = self.tags.unwrap_or_default();
245        v.push(input);
246        self.tags = ::std::option::Option::Some(v);
247        self
248    }
249    /// <p>An optional list of metadata items that you can associate with the Proton component. A tag is a key-value pair.</p>
250    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
251    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
252        self.tags = input;
253        self
254    }
255    /// <p>An optional list of metadata items that you can associate with the Proton component. A tag is a key-value pair.</p>
256    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
257    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
258        &self.tags
259    }
260    /// <p>The client token for the created component.</p>
261    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
262        self.client_token = ::std::option::Option::Some(input.into());
263        self
264    }
265    /// <p>The client token for the created component.</p>
266    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
267        self.client_token = input;
268        self
269    }
270    /// <p>The client token for the created component.</p>
271    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
272        &self.client_token
273    }
274    /// Consumes the builder and constructs a [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
275    pub fn build(
276        self,
277    ) -> ::std::result::Result<crate::operation::create_component::CreateComponentInput, ::aws_smithy_types::error::operation::BuildError> {
278        ::std::result::Result::Ok(crate::operation::create_component::CreateComponentInput {
279            name: self.name,
280            description: self.description,
281            service_name: self.service_name,
282            service_instance_name: self.service_instance_name,
283            environment_name: self.environment_name,
284            template_file: self.template_file,
285            manifest: self.manifest,
286            service_spec: self.service_spec,
287            tags: self.tags,
288            client_token: self.client_token,
289        })
290    }
291}
292impl ::std::fmt::Debug for CreateComponentInputBuilder {
293    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
294        let mut formatter = f.debug_struct("CreateComponentInputBuilder");
295        formatter.field("name", &self.name);
296        formatter.field("description", &"*** Sensitive Data Redacted ***");
297        formatter.field("service_name", &self.service_name);
298        formatter.field("service_instance_name", &self.service_instance_name);
299        formatter.field("environment_name", &self.environment_name);
300        formatter.field("template_file", &"*** Sensitive Data Redacted ***");
301        formatter.field("manifest", &"*** Sensitive Data Redacted ***");
302        formatter.field("service_spec", &"*** Sensitive Data Redacted ***");
303        formatter.field("tags", &self.tags);
304        formatter.field("client_token", &self.client_token);
305        formatter.finish()
306    }
307}