{-# 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.CacheSecurityGroup where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types.EC2SecurityGroup
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CacheSecurityGroup = CacheSecurityGroup'
{
CacheSecurityGroup -> Maybe Text
cacheSecurityGroupName :: Prelude.Maybe Prelude.Text,
CacheSecurityGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CacheSecurityGroup -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
CacheSecurityGroup -> Maybe [EC2SecurityGroup]
eC2SecurityGroups :: Prelude.Maybe [EC2SecurityGroup],
CacheSecurityGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (CacheSecurityGroup -> CacheSecurityGroup -> Bool
(CacheSecurityGroup -> CacheSecurityGroup -> Bool)
-> (CacheSecurityGroup -> CacheSecurityGroup -> Bool)
-> Eq CacheSecurityGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheSecurityGroup -> CacheSecurityGroup -> Bool
$c/= :: CacheSecurityGroup -> CacheSecurityGroup -> Bool
== :: CacheSecurityGroup -> CacheSecurityGroup -> Bool
$c== :: CacheSecurityGroup -> CacheSecurityGroup -> Bool
Prelude.Eq, ReadPrec [CacheSecurityGroup]
ReadPrec CacheSecurityGroup
Int -> ReadS CacheSecurityGroup
ReadS [CacheSecurityGroup]
(Int -> ReadS CacheSecurityGroup)
-> ReadS [CacheSecurityGroup]
-> ReadPrec CacheSecurityGroup
-> ReadPrec [CacheSecurityGroup]
-> Read CacheSecurityGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CacheSecurityGroup]
$creadListPrec :: ReadPrec [CacheSecurityGroup]
readPrec :: ReadPrec CacheSecurityGroup
$creadPrec :: ReadPrec CacheSecurityGroup
readList :: ReadS [CacheSecurityGroup]
$creadList :: ReadS [CacheSecurityGroup]
readsPrec :: Int -> ReadS CacheSecurityGroup
$creadsPrec :: Int -> ReadS CacheSecurityGroup
Prelude.Read, Int -> CacheSecurityGroup -> ShowS
[CacheSecurityGroup] -> ShowS
CacheSecurityGroup -> String
(Int -> CacheSecurityGroup -> ShowS)
-> (CacheSecurityGroup -> String)
-> ([CacheSecurityGroup] -> ShowS)
-> Show CacheSecurityGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheSecurityGroup] -> ShowS
$cshowList :: [CacheSecurityGroup] -> ShowS
show :: CacheSecurityGroup -> String
$cshow :: CacheSecurityGroup -> String
showsPrec :: Int -> CacheSecurityGroup -> ShowS
$cshowsPrec :: Int -> CacheSecurityGroup -> ShowS
Prelude.Show, (forall x. CacheSecurityGroup -> Rep CacheSecurityGroup x)
-> (forall x. Rep CacheSecurityGroup x -> CacheSecurityGroup)
-> Generic CacheSecurityGroup
forall x. Rep CacheSecurityGroup x -> CacheSecurityGroup
forall x. CacheSecurityGroup -> Rep CacheSecurityGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CacheSecurityGroup x -> CacheSecurityGroup
$cfrom :: forall x. CacheSecurityGroup -> Rep CacheSecurityGroup x
Prelude.Generic)
newCacheSecurityGroup ::
CacheSecurityGroup
newCacheSecurityGroup :: CacheSecurityGroup
newCacheSecurityGroup =
CacheSecurityGroup' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> CacheSecurityGroup
CacheSecurityGroup'
{ $sel:cacheSecurityGroupName:CacheSecurityGroup' :: Maybe Text
cacheSecurityGroupName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CacheSecurityGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ownerId:CacheSecurityGroup' :: Maybe Text
ownerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eC2SecurityGroups:CacheSecurityGroup' :: Maybe [EC2SecurityGroup]
eC2SecurityGroups = Maybe [EC2SecurityGroup]
forall a. Maybe a
Prelude.Nothing,
$sel:description:CacheSecurityGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cacheSecurityGroup_cacheSecurityGroupName :: Lens.Lens' CacheSecurityGroup (Prelude.Maybe Prelude.Text)
cacheSecurityGroup_cacheSecurityGroupName :: (Maybe Text -> f (Maybe Text))
-> CacheSecurityGroup -> f CacheSecurityGroup
cacheSecurityGroup_cacheSecurityGroupName = (CacheSecurityGroup -> Maybe Text)
-> (CacheSecurityGroup -> Maybe Text -> CacheSecurityGroup)
-> Lens
CacheSecurityGroup CacheSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheSecurityGroup' {Maybe Text
cacheSecurityGroupName :: Maybe Text
$sel:cacheSecurityGroupName:CacheSecurityGroup' :: CacheSecurityGroup -> Maybe Text
cacheSecurityGroupName} -> Maybe Text
cacheSecurityGroupName) (\s :: CacheSecurityGroup
s@CacheSecurityGroup' {} Maybe Text
a -> CacheSecurityGroup
s {$sel:cacheSecurityGroupName:CacheSecurityGroup' :: Maybe Text
cacheSecurityGroupName = Maybe Text
a} :: CacheSecurityGroup)
cacheSecurityGroup_arn :: Lens.Lens' CacheSecurityGroup (Prelude.Maybe Prelude.Text)
cacheSecurityGroup_arn :: (Maybe Text -> f (Maybe Text))
-> CacheSecurityGroup -> f CacheSecurityGroup
cacheSecurityGroup_arn = (CacheSecurityGroup -> Maybe Text)
-> (CacheSecurityGroup -> Maybe Text -> CacheSecurityGroup)
-> Lens
CacheSecurityGroup CacheSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheSecurityGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:CacheSecurityGroup' :: CacheSecurityGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CacheSecurityGroup
s@CacheSecurityGroup' {} Maybe Text
a -> CacheSecurityGroup
s {$sel:arn:CacheSecurityGroup' :: Maybe Text
arn = Maybe Text
a} :: CacheSecurityGroup)
cacheSecurityGroup_ownerId :: Lens.Lens' CacheSecurityGroup (Prelude.Maybe Prelude.Text)
cacheSecurityGroup_ownerId :: (Maybe Text -> f (Maybe Text))
-> CacheSecurityGroup -> f CacheSecurityGroup
cacheSecurityGroup_ownerId = (CacheSecurityGroup -> Maybe Text)
-> (CacheSecurityGroup -> Maybe Text -> CacheSecurityGroup)
-> Lens
CacheSecurityGroup CacheSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheSecurityGroup' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:CacheSecurityGroup' :: CacheSecurityGroup -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: CacheSecurityGroup
s@CacheSecurityGroup' {} Maybe Text
a -> CacheSecurityGroup
s {$sel:ownerId:CacheSecurityGroup' :: Maybe Text
ownerId = Maybe Text
a} :: CacheSecurityGroup)
cacheSecurityGroup_eC2SecurityGroups :: Lens.Lens' CacheSecurityGroup (Prelude.Maybe [EC2SecurityGroup])
cacheSecurityGroup_eC2SecurityGroups :: (Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> CacheSecurityGroup -> f CacheSecurityGroup
cacheSecurityGroup_eC2SecurityGroups = (CacheSecurityGroup -> Maybe [EC2SecurityGroup])
-> (CacheSecurityGroup
-> Maybe [EC2SecurityGroup] -> CacheSecurityGroup)
-> Lens
CacheSecurityGroup
CacheSecurityGroup
(Maybe [EC2SecurityGroup])
(Maybe [EC2SecurityGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheSecurityGroup' {Maybe [EC2SecurityGroup]
eC2SecurityGroups :: Maybe [EC2SecurityGroup]
$sel:eC2SecurityGroups:CacheSecurityGroup' :: CacheSecurityGroup -> Maybe [EC2SecurityGroup]
eC2SecurityGroups} -> Maybe [EC2SecurityGroup]
eC2SecurityGroups) (\s :: CacheSecurityGroup
s@CacheSecurityGroup' {} Maybe [EC2SecurityGroup]
a -> CacheSecurityGroup
s {$sel:eC2SecurityGroups:CacheSecurityGroup' :: Maybe [EC2SecurityGroup]
eC2SecurityGroups = Maybe [EC2SecurityGroup]
a} :: CacheSecurityGroup) ((Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> CacheSecurityGroup -> f CacheSecurityGroup)
-> ((Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> (Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> CacheSecurityGroup
-> f CacheSecurityGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EC2SecurityGroup]
[EC2SecurityGroup]
[EC2SecurityGroup]
[EC2SecurityGroup]
-> Iso
(Maybe [EC2SecurityGroup])
(Maybe [EC2SecurityGroup])
(Maybe [EC2SecurityGroup])
(Maybe [EC2SecurityGroup])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[EC2SecurityGroup]
[EC2SecurityGroup]
[EC2SecurityGroup]
[EC2SecurityGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
cacheSecurityGroup_description :: Lens.Lens' CacheSecurityGroup (Prelude.Maybe Prelude.Text)
cacheSecurityGroup_description :: (Maybe Text -> f (Maybe Text))
-> CacheSecurityGroup -> f CacheSecurityGroup
cacheSecurityGroup_description = (CacheSecurityGroup -> Maybe Text)
-> (CacheSecurityGroup -> Maybe Text -> CacheSecurityGroup)
-> Lens
CacheSecurityGroup CacheSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheSecurityGroup' {Maybe Text
description :: Maybe Text
$sel:description:CacheSecurityGroup' :: CacheSecurityGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: CacheSecurityGroup
s@CacheSecurityGroup' {} Maybe Text
a -> CacheSecurityGroup
s {$sel:description:CacheSecurityGroup' :: Maybe Text
description = Maybe Text
a} :: CacheSecurityGroup)
instance Core.FromXML CacheSecurityGroup where
parseXML :: [Node] -> Either String CacheSecurityGroup
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> CacheSecurityGroup
CacheSecurityGroup'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> CacheSecurityGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> CacheSecurityGroup)
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
"CacheSecurityGroupName")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> CacheSecurityGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe [EC2SecurityGroup] -> Maybe Text -> CacheSecurityGroup)
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
"ARN")
Either
String
(Maybe Text
-> Maybe [EC2SecurityGroup] -> Maybe Text -> CacheSecurityGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe [EC2SecurityGroup] -> Maybe Text -> CacheSecurityGroup)
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
"OwnerId")
Either
String
(Maybe [EC2SecurityGroup] -> Maybe Text -> CacheSecurityGroup)
-> Either String (Maybe [EC2SecurityGroup])
-> Either String (Maybe Text -> CacheSecurityGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EC2SecurityGroups"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [EC2SecurityGroup]))
-> Either String (Maybe [EC2SecurityGroup])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [EC2SecurityGroup])
-> [Node] -> Either String (Maybe [EC2SecurityGroup])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [EC2SecurityGroup]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"EC2SecurityGroup")
)
Either String (Maybe Text -> CacheSecurityGroup)
-> Either String (Maybe Text) -> Either String CacheSecurityGroup
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
"Description")
instance Prelude.Hashable CacheSecurityGroup
instance Prelude.NFData CacheSecurityGroup