aws_sdk_memorydb/types/
_security_group_membership.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a single security group and its status.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SecurityGroupMembership {
7    /// <p>The identifier of the security group.</p>
8    pub security_group_id: ::std::option::Option<::std::string::String>,
9    /// <p>The status of the security group membership. The status changes whenever a security group is modified, or when the security groups assigned to a cluster are modified.</p>
10    pub status: ::std::option::Option<::std::string::String>,
11}
12impl SecurityGroupMembership {
13    /// <p>The identifier of the security group.</p>
14    pub fn security_group_id(&self) -> ::std::option::Option<&str> {
15        self.security_group_id.as_deref()
16    }
17    /// <p>The status of the security group membership. The status changes whenever a security group is modified, or when the security groups assigned to a cluster are modified.</p>
18    pub fn status(&self) -> ::std::option::Option<&str> {
19        self.status.as_deref()
20    }
21}
22impl SecurityGroupMembership {
23    /// Creates a new builder-style object to manufacture [`SecurityGroupMembership`](crate::types::SecurityGroupMembership).
24    pub fn builder() -> crate::types::builders::SecurityGroupMembershipBuilder {
25        crate::types::builders::SecurityGroupMembershipBuilder::default()
26    }
27}
28
29/// A builder for [`SecurityGroupMembership`](crate::types::SecurityGroupMembership).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct SecurityGroupMembershipBuilder {
33    pub(crate) security_group_id: ::std::option::Option<::std::string::String>,
34    pub(crate) status: ::std::option::Option<::std::string::String>,
35}
36impl SecurityGroupMembershipBuilder {
37    /// <p>The identifier of the security group.</p>
38    pub fn security_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.security_group_id = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The identifier of the security group.</p>
43    pub fn set_security_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.security_group_id = input;
45        self
46    }
47    /// <p>The identifier of the security group.</p>
48    pub fn get_security_group_id(&self) -> &::std::option::Option<::std::string::String> {
49        &self.security_group_id
50    }
51    /// <p>The status of the security group membership. The status changes whenever a security group is modified, or when the security groups assigned to a cluster are modified.</p>
52    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.status = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The status of the security group membership. The status changes whenever a security group is modified, or when the security groups assigned to a cluster are modified.</p>
57    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.status = input;
59        self
60    }
61    /// <p>The status of the security group membership. The status changes whenever a security group is modified, or when the security groups assigned to a cluster are modified.</p>
62    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
63        &self.status
64    }
65    /// Consumes the builder and constructs a [`SecurityGroupMembership`](crate::types::SecurityGroupMembership).
66    pub fn build(self) -> crate::types::SecurityGroupMembership {
67        crate::types::SecurityGroupMembership {
68            security_group_id: self.security_group_id,
69            status: self.status,
70        }
71    }
72}