aws_sdk_ecs/operation/update_cluster/
_update_cluster_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 UpdateClusterInput {
6    /// <p>The name of the cluster to modify the settings for.</p>
7    pub cluster: ::std::option::Option<::std::string::String>,
8    /// <p>The cluster settings for your cluster.</p>
9    pub settings: ::std::option::Option<::std::vec::Vec<crate::types::ClusterSetting>>,
10    /// <p>The execute command configuration for the cluster.</p>
11    pub configuration: ::std::option::Option<crate::types::ClusterConfiguration>,
12    /// <p>Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the <code>enabled</code> parameter to <code>true</code> in the <code>ServiceConnectConfiguration</code>. You can set the namespace of each service individually in the <code>ServiceConnectConfiguration</code> to override this default parameter.</p>
13    /// <p>Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
14    pub service_connect_defaults: ::std::option::Option<crate::types::ClusterServiceConnectDefaultsRequest>,
15}
16impl UpdateClusterInput {
17    /// <p>The name of the cluster to modify the settings for.</p>
18    pub fn cluster(&self) -> ::std::option::Option<&str> {
19        self.cluster.as_deref()
20    }
21    /// <p>The cluster settings for your cluster.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.settings.is_none()`.
24    pub fn settings(&self) -> &[crate::types::ClusterSetting] {
25        self.settings.as_deref().unwrap_or_default()
26    }
27    /// <p>The execute command configuration for the cluster.</p>
28    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ClusterConfiguration> {
29        self.configuration.as_ref()
30    }
31    /// <p>Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the <code>enabled</code> parameter to <code>true</code> in the <code>ServiceConnectConfiguration</code>. You can set the namespace of each service individually in the <code>ServiceConnectConfiguration</code> to override this default parameter.</p>
32    /// <p>Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
33    pub fn service_connect_defaults(&self) -> ::std::option::Option<&crate::types::ClusterServiceConnectDefaultsRequest> {
34        self.service_connect_defaults.as_ref()
35    }
36}
37impl UpdateClusterInput {
38    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
39    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
40        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
41    }
42}
43
44/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct UpdateClusterInputBuilder {
48    pub(crate) cluster: ::std::option::Option<::std::string::String>,
49    pub(crate) settings: ::std::option::Option<::std::vec::Vec<crate::types::ClusterSetting>>,
50    pub(crate) configuration: ::std::option::Option<crate::types::ClusterConfiguration>,
51    pub(crate) service_connect_defaults: ::std::option::Option<crate::types::ClusterServiceConnectDefaultsRequest>,
52}
53impl UpdateClusterInputBuilder {
54    /// <p>The name of the cluster to modify the settings for.</p>
55    /// This field is required.
56    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.cluster = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The name of the cluster to modify the settings for.</p>
61    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.cluster = input;
63        self
64    }
65    /// <p>The name of the cluster to modify the settings for.</p>
66    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
67        &self.cluster
68    }
69    /// Appends an item to `settings`.
70    ///
71    /// To override the contents of this collection use [`set_settings`](Self::set_settings).
72    ///
73    /// <p>The cluster settings for your cluster.</p>
74    pub fn settings(mut self, input: crate::types::ClusterSetting) -> Self {
75        let mut v = self.settings.unwrap_or_default();
76        v.push(input);
77        self.settings = ::std::option::Option::Some(v);
78        self
79    }
80    /// <p>The cluster settings for your cluster.</p>
81    pub fn set_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterSetting>>) -> Self {
82        self.settings = input;
83        self
84    }
85    /// <p>The cluster settings for your cluster.</p>
86    pub fn get_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterSetting>> {
87        &self.settings
88    }
89    /// <p>The execute command configuration for the cluster.</p>
90    pub fn configuration(mut self, input: crate::types::ClusterConfiguration) -> Self {
91        self.configuration = ::std::option::Option::Some(input);
92        self
93    }
94    /// <p>The execute command configuration for the cluster.</p>
95    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ClusterConfiguration>) -> Self {
96        self.configuration = input;
97        self
98    }
99    /// <p>The execute command configuration for the cluster.</p>
100    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ClusterConfiguration> {
101        &self.configuration
102    }
103    /// <p>Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the <code>enabled</code> parameter to <code>true</code> in the <code>ServiceConnectConfiguration</code>. You can set the namespace of each service individually in the <code>ServiceConnectConfiguration</code> to override this default parameter.</p>
104    /// <p>Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
105    pub fn service_connect_defaults(mut self, input: crate::types::ClusterServiceConnectDefaultsRequest) -> Self {
106        self.service_connect_defaults = ::std::option::Option::Some(input);
107        self
108    }
109    /// <p>Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the <code>enabled</code> parameter to <code>true</code> in the <code>ServiceConnectConfiguration</code>. You can set the namespace of each service individually in the <code>ServiceConnectConfiguration</code> to override this default parameter.</p>
110    /// <p>Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
111    pub fn set_service_connect_defaults(mut self, input: ::std::option::Option<crate::types::ClusterServiceConnectDefaultsRequest>) -> Self {
112        self.service_connect_defaults = input;
113        self
114    }
115    /// <p>Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the <code>enabled</code> parameter to <code>true</code> in the <code>ServiceConnectConfiguration</code>. You can set the namespace of each service individually in the <code>ServiceConnectConfiguration</code> to override this default parameter.</p>
116    /// <p>Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
117    pub fn get_service_connect_defaults(&self) -> &::std::option::Option<crate::types::ClusterServiceConnectDefaultsRequest> {
118        &self.service_connect_defaults
119    }
120    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
121    pub fn build(
122        self,
123    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
124        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
125            cluster: self.cluster,
126            settings: self.settings,
127            configuration: self.configuration,
128            service_connect_defaults: self.service_connect_defaults,
129        })
130    }
131}