aws_sdk_kafka/types/
_serverless.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Serverless cluster.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Serverless {
7    /// <p>The configuration of the Amazon VPCs for the cluster.</p>
8    pub vpc_configs: ::std::option::Option<::std::vec::Vec<crate::types::VpcConfig>>,
9    /// <p>Includes all client authentication information.</p>
10    pub client_authentication: ::std::option::Option<crate::types::ServerlessClientAuthentication>,
11}
12impl Serverless {
13    /// <p>The configuration of the Amazon VPCs for the cluster.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.vpc_configs.is_none()`.
16    pub fn vpc_configs(&self) -> &[crate::types::VpcConfig] {
17        self.vpc_configs.as_deref().unwrap_or_default()
18    }
19    /// <p>Includes all client authentication information.</p>
20    pub fn client_authentication(&self) -> ::std::option::Option<&crate::types::ServerlessClientAuthentication> {
21        self.client_authentication.as_ref()
22    }
23}
24impl Serverless {
25    /// Creates a new builder-style object to manufacture [`Serverless`](crate::types::Serverless).
26    pub fn builder() -> crate::types::builders::ServerlessBuilder {
27        crate::types::builders::ServerlessBuilder::default()
28    }
29}
30
31/// A builder for [`Serverless`](crate::types::Serverless).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct ServerlessBuilder {
35    pub(crate) vpc_configs: ::std::option::Option<::std::vec::Vec<crate::types::VpcConfig>>,
36    pub(crate) client_authentication: ::std::option::Option<crate::types::ServerlessClientAuthentication>,
37}
38impl ServerlessBuilder {
39    /// Appends an item to `vpc_configs`.
40    ///
41    /// To override the contents of this collection use [`set_vpc_configs`](Self::set_vpc_configs).
42    ///
43    /// <p>The configuration of the Amazon VPCs for the cluster.</p>
44    pub fn vpc_configs(mut self, input: crate::types::VpcConfig) -> Self {
45        let mut v = self.vpc_configs.unwrap_or_default();
46        v.push(input);
47        self.vpc_configs = ::std::option::Option::Some(v);
48        self
49    }
50    /// <p>The configuration of the Amazon VPCs for the cluster.</p>
51    pub fn set_vpc_configs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VpcConfig>>) -> Self {
52        self.vpc_configs = input;
53        self
54    }
55    /// <p>The configuration of the Amazon VPCs for the cluster.</p>
56    pub fn get_vpc_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcConfig>> {
57        &self.vpc_configs
58    }
59    /// <p>Includes all client authentication information.</p>
60    pub fn client_authentication(mut self, input: crate::types::ServerlessClientAuthentication) -> Self {
61        self.client_authentication = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>Includes all client authentication information.</p>
65    pub fn set_client_authentication(mut self, input: ::std::option::Option<crate::types::ServerlessClientAuthentication>) -> Self {
66        self.client_authentication = input;
67        self
68    }
69    /// <p>Includes all client authentication information.</p>
70    pub fn get_client_authentication(&self) -> &::std::option::Option<crate::types::ServerlessClientAuthentication> {
71        &self.client_authentication
72    }
73    /// Consumes the builder and constructs a [`Serverless`](crate::types::Serverless).
74    pub fn build(self) -> crate::types::Serverless {
75        crate::types::Serverless {
76            vpc_configs: self.vpc_configs,
77            client_authentication: self.client_authentication,
78        }
79    }
80}