aws_sdk_ecs/operation/delete_attributes/_delete_attributes_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 DeleteAttributesInput {
6 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to delete attributes. If you do not specify a cluster, the default cluster is assumed.</p>
7 pub cluster: ::std::option::Option<::std::string::String>,
8 /// <p>The attributes to delete from your resource. You can specify up to 10 attributes for each request. For custom attributes, specify the attribute name and target ID, but don't specify the value. If you specify the target ID using the short form, you must also specify the target type.</p>
9 pub attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
10}
11impl DeleteAttributesInput {
12 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to delete attributes. If you do not specify a cluster, the default cluster is assumed.</p>
13 pub fn cluster(&self) -> ::std::option::Option<&str> {
14 self.cluster.as_deref()
15 }
16 /// <p>The attributes to delete from your resource. You can specify up to 10 attributes for each request. For custom attributes, specify the attribute name and target ID, but don't specify the value. If you specify the target ID using the short form, you must also specify the target type.</p>
17 ///
18 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attributes.is_none()`.
19 pub fn attributes(&self) -> &[crate::types::Attribute] {
20 self.attributes.as_deref().unwrap_or_default()
21 }
22}
23impl DeleteAttributesInput {
24 /// Creates a new builder-style object to manufacture [`DeleteAttributesInput`](crate::operation::delete_attributes::DeleteAttributesInput).
25 pub fn builder() -> crate::operation::delete_attributes::builders::DeleteAttributesInputBuilder {
26 crate::operation::delete_attributes::builders::DeleteAttributesInputBuilder::default()
27 }
28}
29
30/// A builder for [`DeleteAttributesInput`](crate::operation::delete_attributes::DeleteAttributesInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct DeleteAttributesInputBuilder {
34 pub(crate) cluster: ::std::option::Option<::std::string::String>,
35 pub(crate) attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
36}
37impl DeleteAttributesInputBuilder {
38 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to delete attributes. If you do not specify a cluster, the default cluster is assumed.</p>
39 pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40 self.cluster = ::std::option::Option::Some(input.into());
41 self
42 }
43 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to delete attributes. If you do not specify a cluster, the default cluster is assumed.</p>
44 pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45 self.cluster = input;
46 self
47 }
48 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to delete attributes. If you do not specify a cluster, the default cluster is assumed.</p>
49 pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
50 &self.cluster
51 }
52 /// Appends an item to `attributes`.
53 ///
54 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
55 ///
56 /// <p>The attributes to delete from your resource. You can specify up to 10 attributes for each request. For custom attributes, specify the attribute name and target ID, but don't specify the value. If you specify the target ID using the short form, you must also specify the target type.</p>
57 pub fn attributes(mut self, input: crate::types::Attribute) -> Self {
58 let mut v = self.attributes.unwrap_or_default();
59 v.push(input);
60 self.attributes = ::std::option::Option::Some(v);
61 self
62 }
63 /// <p>The attributes to delete from your resource. You can specify up to 10 attributes for each request. For custom attributes, specify the attribute name and target ID, but don't specify the value. If you specify the target ID using the short form, you must also specify the target type.</p>
64 pub fn set_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>) -> Self {
65 self.attributes = input;
66 self
67 }
68 /// <p>The attributes to delete from your resource. You can specify up to 10 attributes for each request. For custom attributes, specify the attribute name and target ID, but don't specify the value. If you specify the target ID using the short form, you must also specify the target type.</p>
69 pub fn get_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Attribute>> {
70 &self.attributes
71 }
72 /// Consumes the builder and constructs a [`DeleteAttributesInput`](crate::operation::delete_attributes::DeleteAttributesInput).
73 pub fn build(
74 self,
75 ) -> ::std::result::Result<crate::operation::delete_attributes::DeleteAttributesInput, ::aws_smithy_types::error::operation::BuildError> {
76 ::std::result::Result::Ok(crate::operation::delete_attributes::DeleteAttributesInput {
77 cluster: self.cluster,
78 attributes: self.attributes,
79 })
80 }
81}