Skip to main content

aws_sdk_redshift/operation/authorize_cluster_security_group_ingress/
_authorize_cluster_security_group_ingress_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AuthorizeClusterSecurityGroupIngressInput {
7    /// <p>The name of the security group to which the ingress rule is added.</p>
8    pub cluster_security_group_name: ::std::option::Option<::std::string::String>,
9    /// <p>The IP range to be added the Amazon Redshift security group.</p>
10    pub cidrip: ::std::option::Option<::std::string::String>,
11    /// <p>The EC2 security group to be added the Amazon Redshift security group.</p>
12    pub ec2_security_group_name: ::std::option::Option<::std::string::String>,
13    /// <p>The Amazon Web Services account number of the owner of the security group specified by the <i>EC2SecurityGroupName</i> parameter. The Amazon Web Services Access Key ID is not an acceptable value.</p>
14    /// <p>Example: <code>111122223333</code></p>
15    pub ec2_security_group_owner_id: ::std::option::Option<::std::string::String>,
16}
17impl AuthorizeClusterSecurityGroupIngressInput {
18    /// <p>The name of the security group to which the ingress rule is added.</p>
19    pub fn cluster_security_group_name(&self) -> ::std::option::Option<&str> {
20        self.cluster_security_group_name.as_deref()
21    }
22    /// <p>The IP range to be added the Amazon Redshift security group.</p>
23    pub fn cidrip(&self) -> ::std::option::Option<&str> {
24        self.cidrip.as_deref()
25    }
26    /// <p>The EC2 security group to be added the Amazon Redshift security group.</p>
27    pub fn ec2_security_group_name(&self) -> ::std::option::Option<&str> {
28        self.ec2_security_group_name.as_deref()
29    }
30    /// <p>The Amazon Web Services account number of the owner of the security group specified by the <i>EC2SecurityGroupName</i> parameter. The Amazon Web Services Access Key ID is not an acceptable value.</p>
31    /// <p>Example: <code>111122223333</code></p>
32    pub fn ec2_security_group_owner_id(&self) -> ::std::option::Option<&str> {
33        self.ec2_security_group_owner_id.as_deref()
34    }
35}
36impl AuthorizeClusterSecurityGroupIngressInput {
37    /// Creates a new builder-style object to manufacture [`AuthorizeClusterSecurityGroupIngressInput`](crate::operation::authorize_cluster_security_group_ingress::AuthorizeClusterSecurityGroupIngressInput).
38    pub fn builder() -> crate::operation::authorize_cluster_security_group_ingress::builders::AuthorizeClusterSecurityGroupIngressInputBuilder {
39        crate::operation::authorize_cluster_security_group_ingress::builders::AuthorizeClusterSecurityGroupIngressInputBuilder::default()
40    }
41}
42
43/// A builder for [`AuthorizeClusterSecurityGroupIngressInput`](crate::operation::authorize_cluster_security_group_ingress::AuthorizeClusterSecurityGroupIngressInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct AuthorizeClusterSecurityGroupIngressInputBuilder {
47    pub(crate) cluster_security_group_name: ::std::option::Option<::std::string::String>,
48    pub(crate) cidrip: ::std::option::Option<::std::string::String>,
49    pub(crate) ec2_security_group_name: ::std::option::Option<::std::string::String>,
50    pub(crate) ec2_security_group_owner_id: ::std::option::Option<::std::string::String>,
51}
52impl AuthorizeClusterSecurityGroupIngressInputBuilder {
53    /// <p>The name of the security group to which the ingress rule is added.</p>
54    /// This field is required.
55    pub fn cluster_security_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.cluster_security_group_name = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>The name of the security group to which the ingress rule is added.</p>
60    pub fn set_cluster_security_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.cluster_security_group_name = input;
62        self
63    }
64    /// <p>The name of the security group to which the ingress rule is added.</p>
65    pub fn get_cluster_security_group_name(&self) -> &::std::option::Option<::std::string::String> {
66        &self.cluster_security_group_name
67    }
68    /// <p>The IP range to be added the Amazon Redshift security group.</p>
69    pub fn cidrip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.cidrip = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The IP range to be added the Amazon Redshift security group.</p>
74    pub fn set_cidrip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.cidrip = input;
76        self
77    }
78    /// <p>The IP range to be added the Amazon Redshift security group.</p>
79    pub fn get_cidrip(&self) -> &::std::option::Option<::std::string::String> {
80        &self.cidrip
81    }
82    /// <p>The EC2 security group to be added the Amazon Redshift security group.</p>
83    pub fn ec2_security_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.ec2_security_group_name = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The EC2 security group to be added the Amazon Redshift security group.</p>
88    pub fn set_ec2_security_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.ec2_security_group_name = input;
90        self
91    }
92    /// <p>The EC2 security group to be added the Amazon Redshift security group.</p>
93    pub fn get_ec2_security_group_name(&self) -> &::std::option::Option<::std::string::String> {
94        &self.ec2_security_group_name
95    }
96    /// <p>The Amazon Web Services account number of the owner of the security group specified by the <i>EC2SecurityGroupName</i> parameter. The Amazon Web Services Access Key ID is not an acceptable value.</p>
97    /// <p>Example: <code>111122223333</code></p>
98    pub fn ec2_security_group_owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.ec2_security_group_owner_id = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The Amazon Web Services account number of the owner of the security group specified by the <i>EC2SecurityGroupName</i> parameter. The Amazon Web Services Access Key ID is not an acceptable value.</p>
103    /// <p>Example: <code>111122223333</code></p>
104    pub fn set_ec2_security_group_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.ec2_security_group_owner_id = input;
106        self
107    }
108    /// <p>The Amazon Web Services account number of the owner of the security group specified by the <i>EC2SecurityGroupName</i> parameter. The Amazon Web Services Access Key ID is not an acceptable value.</p>
109    /// <p>Example: <code>111122223333</code></p>
110    pub fn get_ec2_security_group_owner_id(&self) -> &::std::option::Option<::std::string::String> {
111        &self.ec2_security_group_owner_id
112    }
113    /// Consumes the builder and constructs a [`AuthorizeClusterSecurityGroupIngressInput`](crate::operation::authorize_cluster_security_group_ingress::AuthorizeClusterSecurityGroupIngressInput).
114    pub fn build(
115        self,
116    ) -> ::std::result::Result<
117        crate::operation::authorize_cluster_security_group_ingress::AuthorizeClusterSecurityGroupIngressInput,
118        ::aws_smithy_types::error::operation::BuildError,
119    > {
120        ::std::result::Result::Ok(
121            crate::operation::authorize_cluster_security_group_ingress::AuthorizeClusterSecurityGroupIngressInput {
122                cluster_security_group_name: self.cluster_security_group_name,
123                cidrip: self.cidrip,
124                ec2_security_group_name: self.ec2_security_group_name,
125                ec2_security_group_owner_id: self.ec2_security_group_owner_id,
126            },
127        )
128    }
129}