{-# 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.EC2SecurityGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EC2SecurityGroup = EC2SecurityGroup'
{
EC2SecurityGroup -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
EC2SecurityGroup -> Maybe Text
eC2SecurityGroupOwnerId :: Prelude.Maybe Prelude.Text,
EC2SecurityGroup -> Maybe Text
eC2SecurityGroupName :: Prelude.Maybe Prelude.Text,
EC2SecurityGroup -> Maybe Text
eC2SecurityGroupId :: Prelude.Maybe Prelude.Text
}
deriving (EC2SecurityGroup -> EC2SecurityGroup -> Bool
(EC2SecurityGroup -> EC2SecurityGroup -> Bool)
-> (EC2SecurityGroup -> EC2SecurityGroup -> Bool)
-> Eq EC2SecurityGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EC2SecurityGroup -> EC2SecurityGroup -> Bool
$c/= :: EC2SecurityGroup -> EC2SecurityGroup -> Bool
== :: EC2SecurityGroup -> EC2SecurityGroup -> Bool
$c== :: EC2SecurityGroup -> EC2SecurityGroup -> Bool
Prelude.Eq, ReadPrec [EC2SecurityGroup]
ReadPrec EC2SecurityGroup
Int -> ReadS EC2SecurityGroup
ReadS [EC2SecurityGroup]
(Int -> ReadS EC2SecurityGroup)
-> ReadS [EC2SecurityGroup]
-> ReadPrec EC2SecurityGroup
-> ReadPrec [EC2SecurityGroup]
-> Read EC2SecurityGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EC2SecurityGroup]
$creadListPrec :: ReadPrec [EC2SecurityGroup]
readPrec :: ReadPrec EC2SecurityGroup
$creadPrec :: ReadPrec EC2SecurityGroup
readList :: ReadS [EC2SecurityGroup]
$creadList :: ReadS [EC2SecurityGroup]
readsPrec :: Int -> ReadS EC2SecurityGroup
$creadsPrec :: Int -> ReadS EC2SecurityGroup
Prelude.Read, Int -> EC2SecurityGroup -> ShowS
[EC2SecurityGroup] -> ShowS
EC2SecurityGroup -> String
(Int -> EC2SecurityGroup -> ShowS)
-> (EC2SecurityGroup -> String)
-> ([EC2SecurityGroup] -> ShowS)
-> Show EC2SecurityGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EC2SecurityGroup] -> ShowS
$cshowList :: [EC2SecurityGroup] -> ShowS
show :: EC2SecurityGroup -> String
$cshow :: EC2SecurityGroup -> String
showsPrec :: Int -> EC2SecurityGroup -> ShowS
$cshowsPrec :: Int -> EC2SecurityGroup -> ShowS
Prelude.Show, (forall x. EC2SecurityGroup -> Rep EC2SecurityGroup x)
-> (forall x. Rep EC2SecurityGroup x -> EC2SecurityGroup)
-> Generic EC2SecurityGroup
forall x. Rep EC2SecurityGroup x -> EC2SecurityGroup
forall x. EC2SecurityGroup -> Rep EC2SecurityGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EC2SecurityGroup x -> EC2SecurityGroup
$cfrom :: forall x. EC2SecurityGroup -> Rep EC2SecurityGroup x
Prelude.Generic)
newEC2SecurityGroup ::
EC2SecurityGroup
newEC2SecurityGroup :: EC2SecurityGroup
newEC2SecurityGroup =
EC2SecurityGroup' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> EC2SecurityGroup
EC2SecurityGroup'
{ $sel:status:EC2SecurityGroup' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eC2SecurityGroupOwnerId:EC2SecurityGroup' :: Maybe Text
eC2SecurityGroupOwnerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eC2SecurityGroupName:EC2SecurityGroup' :: Maybe Text
eC2SecurityGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eC2SecurityGroupId:EC2SecurityGroup' :: Maybe Text
eC2SecurityGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
eC2SecurityGroup_status :: Lens.Lens' EC2SecurityGroup (Prelude.Maybe Prelude.Text)
eC2SecurityGroup_status :: (Maybe Text -> f (Maybe Text))
-> EC2SecurityGroup -> f EC2SecurityGroup
eC2SecurityGroup_status = (EC2SecurityGroup -> Maybe Text)
-> (EC2SecurityGroup -> Maybe Text -> EC2SecurityGroup)
-> Lens EC2SecurityGroup EC2SecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2SecurityGroup' {Maybe Text
status :: Maybe Text
$sel:status:EC2SecurityGroup' :: EC2SecurityGroup -> Maybe Text
status} -> Maybe Text
status) (\s :: EC2SecurityGroup
s@EC2SecurityGroup' {} Maybe Text
a -> EC2SecurityGroup
s {$sel:status:EC2SecurityGroup' :: Maybe Text
status = Maybe Text
a} :: EC2SecurityGroup)
eC2SecurityGroup_eC2SecurityGroupOwnerId :: Lens.Lens' EC2SecurityGroup (Prelude.Maybe Prelude.Text)
eC2SecurityGroup_eC2SecurityGroupOwnerId :: (Maybe Text -> f (Maybe Text))
-> EC2SecurityGroup -> f EC2SecurityGroup
eC2SecurityGroup_eC2SecurityGroupOwnerId = (EC2SecurityGroup -> Maybe Text)
-> (EC2SecurityGroup -> Maybe Text -> EC2SecurityGroup)
-> Lens EC2SecurityGroup EC2SecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2SecurityGroup' {Maybe Text
eC2SecurityGroupOwnerId :: Maybe Text
$sel:eC2SecurityGroupOwnerId:EC2SecurityGroup' :: EC2SecurityGroup -> Maybe Text
eC2SecurityGroupOwnerId} -> Maybe Text
eC2SecurityGroupOwnerId) (\s :: EC2SecurityGroup
s@EC2SecurityGroup' {} Maybe Text
a -> EC2SecurityGroup
s {$sel:eC2SecurityGroupOwnerId:EC2SecurityGroup' :: Maybe Text
eC2SecurityGroupOwnerId = Maybe Text
a} :: EC2SecurityGroup)
eC2SecurityGroup_eC2SecurityGroupName :: Lens.Lens' EC2SecurityGroup (Prelude.Maybe Prelude.Text)
eC2SecurityGroup_eC2SecurityGroupName :: (Maybe Text -> f (Maybe Text))
-> EC2SecurityGroup -> f EC2SecurityGroup
eC2SecurityGroup_eC2SecurityGroupName = (EC2SecurityGroup -> Maybe Text)
-> (EC2SecurityGroup -> Maybe Text -> EC2SecurityGroup)
-> Lens EC2SecurityGroup EC2SecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2SecurityGroup' {Maybe Text
eC2SecurityGroupName :: Maybe Text
$sel:eC2SecurityGroupName:EC2SecurityGroup' :: EC2SecurityGroup -> Maybe Text
eC2SecurityGroupName} -> Maybe Text
eC2SecurityGroupName) (\s :: EC2SecurityGroup
s@EC2SecurityGroup' {} Maybe Text
a -> EC2SecurityGroup
s {$sel:eC2SecurityGroupName:EC2SecurityGroup' :: Maybe Text
eC2SecurityGroupName = Maybe Text
a} :: EC2SecurityGroup)
eC2SecurityGroup_eC2SecurityGroupId :: Lens.Lens' EC2SecurityGroup (Prelude.Maybe Prelude.Text)
eC2SecurityGroup_eC2SecurityGroupId :: (Maybe Text -> f (Maybe Text))
-> EC2SecurityGroup -> f EC2SecurityGroup
eC2SecurityGroup_eC2SecurityGroupId = (EC2SecurityGroup -> Maybe Text)
-> (EC2SecurityGroup -> Maybe Text -> EC2SecurityGroup)
-> Lens EC2SecurityGroup EC2SecurityGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2SecurityGroup' {Maybe Text
eC2SecurityGroupId :: Maybe Text
$sel:eC2SecurityGroupId:EC2SecurityGroup' :: EC2SecurityGroup -> Maybe Text
eC2SecurityGroupId} -> Maybe Text
eC2SecurityGroupId) (\s :: EC2SecurityGroup
s@EC2SecurityGroup' {} Maybe Text
a -> EC2SecurityGroup
s {$sel:eC2SecurityGroupId:EC2SecurityGroup' :: Maybe Text
eC2SecurityGroupId = Maybe Text
a} :: EC2SecurityGroup)
instance Core.FromXML EC2SecurityGroup where
parseXML :: [Node] -> Either String EC2SecurityGroup
parseXML [Node]
x =
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> EC2SecurityGroup
EC2SecurityGroup'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> EC2SecurityGroup)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Maybe Text -> EC2SecurityGroup)
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 -> Maybe Text -> Maybe Text -> EC2SecurityGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> EC2SecurityGroup)
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
"EC2SecurityGroupOwnerId")
Either String (Maybe Text -> Maybe Text -> EC2SecurityGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> EC2SecurityGroup)
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
"EC2SecurityGroupName")
Either String (Maybe Text -> EC2SecurityGroup)
-> Either String (Maybe Text) -> Either String EC2SecurityGroup
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
"EC2SecurityGroupId")
instance Prelude.Hashable EC2SecurityGroup
instance Prelude.NFData EC2SecurityGroup