{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ElastiCache.Types.SecurityGroupMembership where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SecurityGroupMembership = SecurityGroupMembership'
{
SecurityGroupMembership -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
SecurityGroupMembership -> Maybe Text
securityGroupId :: Prelude.Maybe Prelude.Text
}
deriving (SecurityGroupMembership -> SecurityGroupMembership -> Bool
(SecurityGroupMembership -> SecurityGroupMembership -> Bool)
-> (SecurityGroupMembership -> SecurityGroupMembership -> Bool)
-> Eq SecurityGroupMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityGroupMembership -> SecurityGroupMembership -> Bool
$c/= :: SecurityGroupMembership -> SecurityGroupMembership -> Bool
== :: SecurityGroupMembership -> SecurityGroupMembership -> Bool
$c== :: SecurityGroupMembership -> SecurityGroupMembership -> Bool
Prelude.Eq, ReadPrec [SecurityGroupMembership]
ReadPrec SecurityGroupMembership
Int -> ReadS SecurityGroupMembership
ReadS [SecurityGroupMembership]
(Int -> ReadS SecurityGroupMembership)
-> ReadS [SecurityGroupMembership]
-> ReadPrec SecurityGroupMembership
-> ReadPrec [SecurityGroupMembership]
-> Read SecurityGroupMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityGroupMembership]
$creadListPrec :: ReadPrec [SecurityGroupMembership]
readPrec :: ReadPrec SecurityGroupMembership
$creadPrec :: ReadPrec SecurityGroupMembership
readList :: ReadS [SecurityGroupMembership]
$creadList :: ReadS [SecurityGroupMembership]
readsPrec :: Int -> ReadS SecurityGroupMembership
$creadsPrec :: Int -> ReadS SecurityGroupMembership
Prelude.Read, Int -> SecurityGroupMembership -> ShowS
[SecurityGroupMembership] -> ShowS
SecurityGroupMembership -> String
(Int -> SecurityGroupMembership -> ShowS)
-> (SecurityGroupMembership -> String)
-> ([SecurityGroupMembership] -> ShowS)
-> Show SecurityGroupMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityGroupMembership] -> ShowS
$cshowList :: [SecurityGroupMembership] -> ShowS
show :: SecurityGroupMembership -> String
$cshow :: SecurityGroupMembership -> String
showsPrec :: Int -> SecurityGroupMembership -> ShowS
$cshowsPrec :: Int -> SecurityGroupMembership -> ShowS
Prelude.Show, (forall x.
SecurityGroupMembership -> Rep SecurityGroupMembership x)
-> (forall x.
Rep SecurityGroupMembership x -> SecurityGroupMembership)
-> Generic SecurityGroupMembership
forall x. Rep SecurityGroupMembership x -> SecurityGroupMembership
forall x. SecurityGroupMembership -> Rep SecurityGroupMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecurityGroupMembership x -> SecurityGroupMembership
$cfrom :: forall x. SecurityGroupMembership -> Rep SecurityGroupMembership x
Prelude.Generic)
newSecurityGroupMembership ::
SecurityGroupMembership
newSecurityGroupMembership :: SecurityGroupMembership
newSecurityGroupMembership =
SecurityGroupMembership' :: Maybe Text -> Maybe Text -> SecurityGroupMembership
SecurityGroupMembership'
{ $sel:status:SecurityGroupMembership' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:securityGroupId:SecurityGroupMembership' :: Maybe Text
securityGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
securityGroupMembership_status :: Lens.Lens' SecurityGroupMembership (Prelude.Maybe Prelude.Text)
securityGroupMembership_status :: (Maybe Text -> f (Maybe Text))
-> SecurityGroupMembership -> f SecurityGroupMembership
securityGroupMembership_status = (SecurityGroupMembership -> Maybe Text)
-> (SecurityGroupMembership
-> Maybe Text -> SecurityGroupMembership)
-> Lens
SecurityGroupMembership
SecurityGroupMembership
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupMembership' {Maybe Text
status :: Maybe Text
$sel:status:SecurityGroupMembership' :: SecurityGroupMembership -> Maybe Text
status} -> Maybe Text
status) (\s :: SecurityGroupMembership
s@SecurityGroupMembership' {} Maybe Text
a -> SecurityGroupMembership
s {$sel:status:SecurityGroupMembership' :: Maybe Text
status = Maybe Text
a} :: SecurityGroupMembership)
securityGroupMembership_securityGroupId :: Lens.Lens' SecurityGroupMembership (Prelude.Maybe Prelude.Text)
securityGroupMembership_securityGroupId :: (Maybe Text -> f (Maybe Text))
-> SecurityGroupMembership -> f SecurityGroupMembership
securityGroupMembership_securityGroupId = (SecurityGroupMembership -> Maybe Text)
-> (SecurityGroupMembership
-> Maybe Text -> SecurityGroupMembership)
-> Lens
SecurityGroupMembership
SecurityGroupMembership
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupMembership' {Maybe Text
securityGroupId :: Maybe Text
$sel:securityGroupId:SecurityGroupMembership' :: SecurityGroupMembership -> Maybe Text
securityGroupId} -> Maybe Text
securityGroupId) (\s :: SecurityGroupMembership
s@SecurityGroupMembership' {} Maybe Text
a -> SecurityGroupMembership
s {$sel:securityGroupId:SecurityGroupMembership' :: Maybe Text
securityGroupId = Maybe Text
a} :: SecurityGroupMembership)
instance Core.FromXML SecurityGroupMembership where
parseXML :: [Node] -> Either String SecurityGroupMembership
parseXML [Node]
x =
Maybe Text -> Maybe Text -> SecurityGroupMembership
SecurityGroupMembership'
(Maybe Text -> Maybe Text -> SecurityGroupMembership)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> SecurityGroupMembership)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
Either String (Maybe Text -> SecurityGroupMembership)
-> Either String (Maybe Text)
-> Either String SecurityGroupMembership
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SecurityGroupId")
instance Prelude.Hashable SecurityGroupMembership
instance Prelude.NFData SecurityGroupMembership