aws_sdk_elasticache/operation/authorize_cache_security_group_ingress/
_authorize_cache_security_group_ingress_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of an AuthorizeCacheSecurityGroupIngress operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AuthorizeCacheSecurityGroupIngressInput {
7    /// <p>The cache security group that allows network ingress.</p>
8    pub cache_security_group_name: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon EC2 security group to be authorized for ingress to the cache security group.</p>
10    pub ec2_security_group_name: ::std::option::Option<::std::string::String>,
11    /// <p>The Amazon account number of the Amazon EC2 security group owner. Note that this is not the same thing as an Amazon access key ID - you must provide a valid Amazon account number for this parameter.</p>
12    pub ec2_security_group_owner_id: ::std::option::Option<::std::string::String>,
13}
14impl AuthorizeCacheSecurityGroupIngressInput {
15    /// <p>The cache security group that allows network ingress.</p>
16    pub fn cache_security_group_name(&self) -> ::std::option::Option<&str> {
17        self.cache_security_group_name.as_deref()
18    }
19    /// <p>The Amazon EC2 security group to be authorized for ingress to the cache security group.</p>
20    pub fn ec2_security_group_name(&self) -> ::std::option::Option<&str> {
21        self.ec2_security_group_name.as_deref()
22    }
23    /// <p>The Amazon account number of the Amazon EC2 security group owner. Note that this is not the same thing as an Amazon access key ID - you must provide a valid Amazon account number for this parameter.</p>
24    pub fn ec2_security_group_owner_id(&self) -> ::std::option::Option<&str> {
25        self.ec2_security_group_owner_id.as_deref()
26    }
27}
28impl AuthorizeCacheSecurityGroupIngressInput {
29    /// Creates a new builder-style object to manufacture [`AuthorizeCacheSecurityGroupIngressInput`](crate::operation::authorize_cache_security_group_ingress::AuthorizeCacheSecurityGroupIngressInput).
30    pub fn builder() -> crate::operation::authorize_cache_security_group_ingress::builders::AuthorizeCacheSecurityGroupIngressInputBuilder {
31        crate::operation::authorize_cache_security_group_ingress::builders::AuthorizeCacheSecurityGroupIngressInputBuilder::default()
32    }
33}
34
35/// A builder for [`AuthorizeCacheSecurityGroupIngressInput`](crate::operation::authorize_cache_security_group_ingress::AuthorizeCacheSecurityGroupIngressInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct AuthorizeCacheSecurityGroupIngressInputBuilder {
39    pub(crate) cache_security_group_name: ::std::option::Option<::std::string::String>,
40    pub(crate) ec2_security_group_name: ::std::option::Option<::std::string::String>,
41    pub(crate) ec2_security_group_owner_id: ::std::option::Option<::std::string::String>,
42}
43impl AuthorizeCacheSecurityGroupIngressInputBuilder {
44    /// <p>The cache security group that allows network ingress.</p>
45    /// This field is required.
46    pub fn cache_security_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.cache_security_group_name = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The cache security group that allows network ingress.</p>
51    pub fn set_cache_security_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.cache_security_group_name = input;
53        self
54    }
55    /// <p>The cache security group that allows network ingress.</p>
56    pub fn get_cache_security_group_name(&self) -> &::std::option::Option<::std::string::String> {
57        &self.cache_security_group_name
58    }
59    /// <p>The Amazon EC2 security group to be authorized for ingress to the cache security group.</p>
60    /// This field is required.
61    pub fn ec2_security_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.ec2_security_group_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The Amazon EC2 security group to be authorized for ingress to the cache security group.</p>
66    pub fn set_ec2_security_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.ec2_security_group_name = input;
68        self
69    }
70    /// <p>The Amazon EC2 security group to be authorized for ingress to the cache security group.</p>
71    pub fn get_ec2_security_group_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.ec2_security_group_name
73    }
74    /// <p>The Amazon account number of the Amazon EC2 security group owner. Note that this is not the same thing as an Amazon access key ID - you must provide a valid Amazon account number for this parameter.</p>
75    /// This field is required.
76    pub fn ec2_security_group_owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.ec2_security_group_owner_id = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The Amazon account number of the Amazon EC2 security group owner. Note that this is not the same thing as an Amazon access key ID - you must provide a valid Amazon account number for this parameter.</p>
81    pub fn set_ec2_security_group_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.ec2_security_group_owner_id = input;
83        self
84    }
85    /// <p>The Amazon account number of the Amazon EC2 security group owner. Note that this is not the same thing as an Amazon access key ID - you must provide a valid Amazon account number for this parameter.</p>
86    pub fn get_ec2_security_group_owner_id(&self) -> &::std::option::Option<::std::string::String> {
87        &self.ec2_security_group_owner_id
88    }
89    /// Consumes the builder and constructs a [`AuthorizeCacheSecurityGroupIngressInput`](crate::operation::authorize_cache_security_group_ingress::AuthorizeCacheSecurityGroupIngressInput).
90    pub fn build(
91        self,
92    ) -> ::std::result::Result<
93        crate::operation::authorize_cache_security_group_ingress::AuthorizeCacheSecurityGroupIngressInput,
94        ::aws_smithy_types::error::operation::BuildError,
95    > {
96        ::std::result::Result::Ok(
97            crate::operation::authorize_cache_security_group_ingress::AuthorizeCacheSecurityGroupIngressInput {
98                cache_security_group_name: self.cache_security_group_name,
99                ec2_security_group_name: self.ec2_security_group_name,
100                ec2_security_group_owner_id: self.ec2_security_group_owner_id,
101            },
102        )
103    }
104}