Skip to main content

aws_sdk_eks/operation/register_cluster/
_register_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 RegisterClusterInput {
6    /// <p>A unique name for this cluster in your Amazon Web Services Region.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.</p>
9    pub connector_config: ::std::option::Option<crate::types::ConnectorConfigRequest>,
10    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
11    pub client_request_token: ::std::option::Option<::std::string::String>,
12    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl RegisterClusterInput {
16    /// <p>A unique name for this cluster in your Amazon Web Services Region.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.</p>
21    pub fn connector_config(&self) -> ::std::option::Option<&crate::types::ConnectorConfigRequest> {
22        self.connector_config.as_ref()
23    }
24    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
25    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
26        self.client_request_token.as_deref()
27    }
28    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
29    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30        self.tags.as_ref()
31    }
32}
33impl RegisterClusterInput {
34    /// Creates a new builder-style object to manufacture [`RegisterClusterInput`](crate::operation::register_cluster::RegisterClusterInput).
35    pub fn builder() -> crate::operation::register_cluster::builders::RegisterClusterInputBuilder {
36        crate::operation::register_cluster::builders::RegisterClusterInputBuilder::default()
37    }
38}
39
40/// A builder for [`RegisterClusterInput`](crate::operation::register_cluster::RegisterClusterInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct RegisterClusterInputBuilder {
44    pub(crate) name: ::std::option::Option<::std::string::String>,
45    pub(crate) connector_config: ::std::option::Option<crate::types::ConnectorConfigRequest>,
46    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
47    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl RegisterClusterInputBuilder {
50    /// <p>A unique name for this cluster in your Amazon Web Services Region.</p>
51    /// This field is required.
52    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>A unique name for this cluster in your Amazon Web Services Region.</p>
57    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.name = input;
59        self
60    }
61    /// <p>A unique name for this cluster in your Amazon Web Services Region.</p>
62    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.name
64    }
65    /// <p>The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.</p>
66    /// This field is required.
67    pub fn connector_config(mut self, input: crate::types::ConnectorConfigRequest) -> Self {
68        self.connector_config = ::std::option::Option::Some(input);
69        self
70    }
71    /// <p>The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.</p>
72    pub fn set_connector_config(mut self, input: ::std::option::Option<crate::types::ConnectorConfigRequest>) -> Self {
73        self.connector_config = input;
74        self
75    }
76    /// <p>The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.</p>
77    pub fn get_connector_config(&self) -> &::std::option::Option<crate::types::ConnectorConfigRequest> {
78        &self.connector_config
79    }
80    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
81    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.client_request_token = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
86    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.client_request_token = input;
88        self
89    }
90    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
91    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
92        &self.client_request_token
93    }
94    /// Adds a key-value pair to `tags`.
95    ///
96    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
97    ///
98    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
99    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
100        let mut hash_map = self.tags.unwrap_or_default();
101        hash_map.insert(k.into(), v.into());
102        self.tags = ::std::option::Option::Some(hash_map);
103        self
104    }
105    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
106    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
107        self.tags = input;
108        self
109    }
110    /// <p>Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.</p>
111    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
112        &self.tags
113    }
114    /// Consumes the builder and constructs a [`RegisterClusterInput`](crate::operation::register_cluster::RegisterClusterInput).
115    pub fn build(
116        self,
117    ) -> ::std::result::Result<crate::operation::register_cluster::RegisterClusterInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::register_cluster::RegisterClusterInput {
119            name: self.name,
120            connector_config: self.connector_config,
121            client_request_token: self.client_request_token,
122            tags: self.tags,
123        })
124    }
125}