{-# 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.RDS.Types.DBSecurityGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.EC2SecurityGroup
import Amazonka.RDS.Types.IPRange
data DBSecurityGroup = DBSecurityGroup'
{
DBSecurityGroup -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
DBSecurityGroup -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
DBSecurityGroup -> Maybe Text
dbSecurityGroupArn :: Prelude.Maybe Prelude.Text,
DBSecurityGroup -> Maybe [IPRange]
iPRanges :: Prelude.Maybe [IPRange],
DBSecurityGroup -> Maybe Text
dbSecurityGroupName :: Prelude.Maybe Prelude.Text,
DBSecurityGroup -> Maybe [EC2SecurityGroup]
eC2SecurityGroups :: Prelude.Maybe [EC2SecurityGroup],
DBSecurityGroup -> Maybe Text
dbSecurityGroupDescription :: Prelude.Maybe Prelude.Text
}
deriving (DBSecurityGroup -> DBSecurityGroup -> Bool
(DBSecurityGroup -> DBSecurityGroup -> Bool)
-> (DBSecurityGroup -> DBSecurityGroup -> Bool)
-> Eq DBSecurityGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBSecurityGroup -> DBSecurityGroup -> Bool
$c/= :: DBSecurityGroup -> DBSecurityGroup -> Bool
== :: DBSecurityGroup -> DBSecurityGroup -> Bool
$c== :: DBSecurityGroup -> DBSecurityGroup -> Bool
Prelude.Eq, ReadPrec [DBSecurityGroup]
ReadPrec DBSecurityGroup
Int -> ReadS DBSecurityGroup
ReadS [DBSecurityGroup]
(Int -> ReadS DBSecurityGroup)
-> ReadS [DBSecurityGroup]
-> ReadPrec DBSecurityGroup
-> ReadPrec [DBSecurityGroup]
-> Read DBSecurityGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DBSecurityGroup]
$creadListPrec :: ReadPrec [DBSecurityGroup]
readPrec :: ReadPrec DBSecurityGroup
$creadPrec :: ReadPrec DBSecurityGroup
readList :: ReadS [DBSecurityGroup]
$creadList :: ReadS [DBSecurityGroup]
readsPrec :: Int -> ReadS DBSecurityGroup
$creadsPrec :: Int -> ReadS DBSecurityGroup
Prelude.Read, Int -> DBSecurityGroup -> ShowS
[DBSecurityGroup] -> ShowS
DBSecurityGroup -> String
(Int -> DBSecurityGroup -> ShowS)
-> (DBSecurityGroup -> String)
-> ([DBSecurityGroup] -> ShowS)
-> Show DBSecurityGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DBSecurityGroup] -> ShowS
$cshowList :: [DBSecurityGroup] -> ShowS
show :: DBSecurityGroup -> String
$cshow :: DBSecurityGroup -> String
showsPrec :: Int -> DBSecurityGroup -> ShowS
$cshowsPrec :: Int -> DBSecurityGroup -> ShowS
Prelude.Show, (forall x. DBSecurityGroup -> Rep DBSecurityGroup x)
-> (forall x. Rep DBSecurityGroup x -> DBSecurityGroup)
-> Generic DBSecurityGroup
forall x. Rep DBSecurityGroup x -> DBSecurityGroup
forall x. DBSecurityGroup -> Rep DBSecurityGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DBSecurityGroup x -> DBSecurityGroup
$cfrom :: forall x. DBSecurityGroup -> Rep DBSecurityGroup x
Prelude.Generic)
newDBSecurityGroup ::
DBSecurityGroup
newDBSecurityGroup :: DBSecurityGroup
newDBSecurityGroup =
DBSecurityGroup' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup
DBSecurityGroup'
{ $sel:vpcId:DBSecurityGroup' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ownerId:DBSecurityGroup' :: Maybe Text
ownerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dbSecurityGroupArn:DBSecurityGroup' :: Maybe Text
dbSecurityGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:iPRanges:DBSecurityGroup' :: Maybe [IPRange]
iPRanges = Maybe [IPRange]
forall a. Maybe a
Prelude.Nothing,
$sel:dbSecurityGroupName:DBSecurityGroup' :: Maybe Text
dbSecurityGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eC2SecurityGroups:DBSecurityGroup' :: Maybe [EC2SecurityGroup]
eC2SecurityGroups = Maybe [EC2SecurityGroup]
forall a. Maybe a
Prelude.Nothing,
$sel:dbSecurityGroupDescription:DBSecurityGroup' :: Maybe Text
dbSecurityGroupDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
dbSecurityGroup_vpcId :: Lens.Lens' DBSecurityGroup (Prelude.Maybe Prelude.Text)
dbSecurityGroup_vpcId :: (Maybe Text -> f (Maybe Text))
-> DBSecurityGroup -> f DBSecurityGroup
dbSecurityGroup_vpcId = (DBSecurityGroup -> Maybe Text)
-> (DBSecurityGroup -> Maybe Text -> DBSecurityGroup)
-> Lens DBSecurityGroup DBSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSecurityGroup' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:DBSecurityGroup' :: DBSecurityGroup -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: DBSecurityGroup
s@DBSecurityGroup' {} Maybe Text
a -> DBSecurityGroup
s {$sel:vpcId:DBSecurityGroup' :: Maybe Text
vpcId = Maybe Text
a} :: DBSecurityGroup)
dbSecurityGroup_ownerId :: Lens.Lens' DBSecurityGroup (Prelude.Maybe Prelude.Text)
dbSecurityGroup_ownerId :: (Maybe Text -> f (Maybe Text))
-> DBSecurityGroup -> f DBSecurityGroup
dbSecurityGroup_ownerId = (DBSecurityGroup -> Maybe Text)
-> (DBSecurityGroup -> Maybe Text -> DBSecurityGroup)
-> Lens DBSecurityGroup DBSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSecurityGroup' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:DBSecurityGroup' :: DBSecurityGroup -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: DBSecurityGroup
s@DBSecurityGroup' {} Maybe Text
a -> DBSecurityGroup
s {$sel:ownerId:DBSecurityGroup' :: Maybe Text
ownerId = Maybe Text
a} :: DBSecurityGroup)
dbSecurityGroup_dbSecurityGroupArn :: Lens.Lens' DBSecurityGroup (Prelude.Maybe Prelude.Text)
dbSecurityGroup_dbSecurityGroupArn :: (Maybe Text -> f (Maybe Text))
-> DBSecurityGroup -> f DBSecurityGroup
dbSecurityGroup_dbSecurityGroupArn = (DBSecurityGroup -> Maybe Text)
-> (DBSecurityGroup -> Maybe Text -> DBSecurityGroup)
-> Lens DBSecurityGroup DBSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSecurityGroup' {Maybe Text
dbSecurityGroupArn :: Maybe Text
$sel:dbSecurityGroupArn:DBSecurityGroup' :: DBSecurityGroup -> Maybe Text
dbSecurityGroupArn} -> Maybe Text
dbSecurityGroupArn) (\s :: DBSecurityGroup
s@DBSecurityGroup' {} Maybe Text
a -> DBSecurityGroup
s {$sel:dbSecurityGroupArn:DBSecurityGroup' :: Maybe Text
dbSecurityGroupArn = Maybe Text
a} :: DBSecurityGroup)
dbSecurityGroup_iPRanges :: Lens.Lens' DBSecurityGroup (Prelude.Maybe [IPRange])
dbSecurityGroup_iPRanges :: (Maybe [IPRange] -> f (Maybe [IPRange]))
-> DBSecurityGroup -> f DBSecurityGroup
dbSecurityGroup_iPRanges = (DBSecurityGroup -> Maybe [IPRange])
-> (DBSecurityGroup -> Maybe [IPRange] -> DBSecurityGroup)
-> Lens
DBSecurityGroup DBSecurityGroup (Maybe [IPRange]) (Maybe [IPRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSecurityGroup' {Maybe [IPRange]
iPRanges :: Maybe [IPRange]
$sel:iPRanges:DBSecurityGroup' :: DBSecurityGroup -> Maybe [IPRange]
iPRanges} -> Maybe [IPRange]
iPRanges) (\s :: DBSecurityGroup
s@DBSecurityGroup' {} Maybe [IPRange]
a -> DBSecurityGroup
s {$sel:iPRanges:DBSecurityGroup' :: Maybe [IPRange]
iPRanges = Maybe [IPRange]
a} :: DBSecurityGroup) ((Maybe [IPRange] -> f (Maybe [IPRange]))
-> DBSecurityGroup -> f DBSecurityGroup)
-> ((Maybe [IPRange] -> f (Maybe [IPRange]))
-> Maybe [IPRange] -> f (Maybe [IPRange]))
-> (Maybe [IPRange] -> f (Maybe [IPRange]))
-> DBSecurityGroup
-> f DBSecurityGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IPRange] [IPRange] [IPRange] [IPRange]
-> Iso
(Maybe [IPRange])
(Maybe [IPRange])
(Maybe [IPRange])
(Maybe [IPRange])
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 [IPRange] [IPRange] [IPRange] [IPRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dbSecurityGroup_dbSecurityGroupName :: Lens.Lens' DBSecurityGroup (Prelude.Maybe Prelude.Text)
dbSecurityGroup_dbSecurityGroupName :: (Maybe Text -> f (Maybe Text))
-> DBSecurityGroup -> f DBSecurityGroup
dbSecurityGroup_dbSecurityGroupName = (DBSecurityGroup -> Maybe Text)
-> (DBSecurityGroup -> Maybe Text -> DBSecurityGroup)
-> Lens DBSecurityGroup DBSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSecurityGroup' {Maybe Text
dbSecurityGroupName :: Maybe Text
$sel:dbSecurityGroupName:DBSecurityGroup' :: DBSecurityGroup -> Maybe Text
dbSecurityGroupName} -> Maybe Text
dbSecurityGroupName) (\s :: DBSecurityGroup
s@DBSecurityGroup' {} Maybe Text
a -> DBSecurityGroup
s {$sel:dbSecurityGroupName:DBSecurityGroup' :: Maybe Text
dbSecurityGroupName = Maybe Text
a} :: DBSecurityGroup)
dbSecurityGroup_eC2SecurityGroups :: Lens.Lens' DBSecurityGroup (Prelude.Maybe [EC2SecurityGroup])
dbSecurityGroup_eC2SecurityGroups :: (Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> DBSecurityGroup -> f DBSecurityGroup
dbSecurityGroup_eC2SecurityGroups = (DBSecurityGroup -> Maybe [EC2SecurityGroup])
-> (DBSecurityGroup -> Maybe [EC2SecurityGroup] -> DBSecurityGroup)
-> Lens
DBSecurityGroup
DBSecurityGroup
(Maybe [EC2SecurityGroup])
(Maybe [EC2SecurityGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSecurityGroup' {Maybe [EC2SecurityGroup]
eC2SecurityGroups :: Maybe [EC2SecurityGroup]
$sel:eC2SecurityGroups:DBSecurityGroup' :: DBSecurityGroup -> Maybe [EC2SecurityGroup]
eC2SecurityGroups} -> Maybe [EC2SecurityGroup]
eC2SecurityGroups) (\s :: DBSecurityGroup
s@DBSecurityGroup' {} Maybe [EC2SecurityGroup]
a -> DBSecurityGroup
s {$sel:eC2SecurityGroups:DBSecurityGroup' :: Maybe [EC2SecurityGroup]
eC2SecurityGroups = Maybe [EC2SecurityGroup]
a} :: DBSecurityGroup) ((Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> DBSecurityGroup -> f DBSecurityGroup)
-> ((Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> (Maybe [EC2SecurityGroup] -> f (Maybe [EC2SecurityGroup]))
-> DBSecurityGroup
-> f DBSecurityGroup
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
dbSecurityGroup_dbSecurityGroupDescription :: Lens.Lens' DBSecurityGroup (Prelude.Maybe Prelude.Text)
dbSecurityGroup_dbSecurityGroupDescription :: (Maybe Text -> f (Maybe Text))
-> DBSecurityGroup -> f DBSecurityGroup
dbSecurityGroup_dbSecurityGroupDescription = (DBSecurityGroup -> Maybe Text)
-> (DBSecurityGroup -> Maybe Text -> DBSecurityGroup)
-> Lens DBSecurityGroup DBSecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSecurityGroup' {Maybe Text
dbSecurityGroupDescription :: Maybe Text
$sel:dbSecurityGroupDescription:DBSecurityGroup' :: DBSecurityGroup -> Maybe Text
dbSecurityGroupDescription} -> Maybe Text
dbSecurityGroupDescription) (\s :: DBSecurityGroup
s@DBSecurityGroup' {} Maybe Text
a -> DBSecurityGroup
s {$sel:dbSecurityGroupDescription:DBSecurityGroup' :: Maybe Text
dbSecurityGroupDescription = Maybe Text
a} :: DBSecurityGroup)
instance Core.FromXML DBSecurityGroup where
parseXML :: [Node] -> Either String DBSecurityGroup
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup
DBSecurityGroup'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup)
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
"VpcId")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup)
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 Text
-> Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup)
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
"DBSecurityGroupArn")
Either
String
(Maybe [IPRange]
-> Maybe Text
-> Maybe [EC2SecurityGroup]
-> Maybe Text
-> DBSecurityGroup)
-> Either String (Maybe [IPRange])
-> Either
String
(Maybe Text
-> Maybe [EC2SecurityGroup] -> Maybe Text -> DBSecurityGroup)
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
"IPRanges" 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 [IPRange]))
-> Either String (Maybe [IPRange])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [IPRange])
-> [Node] -> Either String (Maybe [IPRange])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [IPRange]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"IPRange")
)
Either
String
(Maybe Text
-> Maybe [EC2SecurityGroup] -> Maybe Text -> DBSecurityGroup)
-> Either String (Maybe Text)
-> Either
String (Maybe [EC2SecurityGroup] -> Maybe Text -> DBSecurityGroup)
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
"DBSecurityGroupName")
Either
String (Maybe [EC2SecurityGroup] -> Maybe Text -> DBSecurityGroup)
-> Either String (Maybe [EC2SecurityGroup])
-> Either String (Maybe Text -> DBSecurityGroup)
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 -> DBSecurityGroup)
-> Either String (Maybe Text) -> Either String DBSecurityGroup
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
"DBSecurityGroupDescription")
instance Prelude.Hashable DBSecurityGroup
instance Prelude.NFData DBSecurityGroup