aws_sdk_ecs/operation/put_attributes/
_put_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 PutAttributesInput {
6    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to apply 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 apply to your resource. You can specify up to 10 custom attributes for each resource. You can specify up to 10 attributes in a single call.</p>
9    pub attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
10}
11impl PutAttributesInput {
12    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to apply 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 apply to your resource. You can specify up to 10 custom attributes for each resource. You can specify up to 10 attributes in a single call.</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 PutAttributesInput {
24    /// Creates a new builder-style object to manufacture [`PutAttributesInput`](crate::operation::put_attributes::PutAttributesInput).
25    pub fn builder() -> crate::operation::put_attributes::builders::PutAttributesInputBuilder {
26        crate::operation::put_attributes::builders::PutAttributesInputBuilder::default()
27    }
28}
29
30/// A builder for [`PutAttributesInput`](crate::operation::put_attributes::PutAttributesInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct PutAttributesInputBuilder {
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 PutAttributesInputBuilder {
38    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to apply 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 apply 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 apply 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 apply to your resource. You can specify up to 10 custom attributes for each resource. You can specify up to 10 attributes in a single call.</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 apply to your resource. You can specify up to 10 custom attributes for each resource. You can specify up to 10 attributes in a single call.</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 apply to your resource. You can specify up to 10 custom attributes for each resource. You can specify up to 10 attributes in a single call.</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 [`PutAttributesInput`](crate::operation::put_attributes::PutAttributesInput).
73    pub fn build(
74        self,
75    ) -> ::std::result::Result<crate::operation::put_attributes::PutAttributesInput, ::aws_smithy_types::error::operation::BuildError> {
76        ::std::result::Result::Ok(crate::operation::put_attributes::PutAttributesInput {
77            cluster: self.cluster,
78            attributes: self.attributes,
79        })
80    }
81}