{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RDS.Types.DBSecurityGroup
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Contains the details for an Amazon RDS DB security group.
--
-- This data type is used as a response element in the
-- @DescribeDBSecurityGroups@ action.
--
-- /See:/ 'newDBSecurityGroup' smart constructor.
data DBSecurityGroup = DBSecurityGroup'
  { -- | Provides the VpcId of the DB security group.
    DBSecurityGroup -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | Provides the Amazon Web Services ID of the owner of a specific DB
    -- security group.
    DBSecurityGroup -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the DB security group.
    DBSecurityGroup -> Maybe Text
dbSecurityGroupArn :: Prelude.Maybe Prelude.Text,
    -- | Contains a list of @IPRange@ elements.
    DBSecurityGroup -> Maybe [IPRange]
iPRanges :: Prelude.Maybe [IPRange],
    -- | Specifies the name of the DB security group.
    DBSecurityGroup -> Maybe Text
dbSecurityGroupName :: Prelude.Maybe Prelude.Text,
    -- | Contains a list of @EC2SecurityGroup@ elements.
    DBSecurityGroup -> Maybe [EC2SecurityGroup]
eC2SecurityGroups :: Prelude.Maybe [EC2SecurityGroup],
    -- | Provides the description of the DB security group.
    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)

-- |
-- Create a value of 'DBSecurityGroup' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'vpcId', 'dbSecurityGroup_vpcId' - Provides the VpcId of the DB security group.
--
-- 'ownerId', 'dbSecurityGroup_ownerId' - Provides the Amazon Web Services ID of the owner of a specific DB
-- security group.
--
-- 'dbSecurityGroupArn', 'dbSecurityGroup_dbSecurityGroupArn' - The Amazon Resource Name (ARN) for the DB security group.
--
-- 'iPRanges', 'dbSecurityGroup_iPRanges' - Contains a list of @IPRange@ elements.
--
-- 'dbSecurityGroupName', 'dbSecurityGroup_dbSecurityGroupName' - Specifies the name of the DB security group.
--
-- 'eC2SecurityGroups', 'dbSecurityGroup_eC2SecurityGroups' - Contains a list of @EC2SecurityGroup@ elements.
--
-- 'dbSecurityGroupDescription', 'dbSecurityGroup_dbSecurityGroupDescription' - Provides the description of the DB security group.
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
    }

-- | Provides the VpcId of the DB security group.
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)

-- | Provides the Amazon Web Services ID of the owner of a specific DB
-- security group.
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)

-- | The Amazon Resource Name (ARN) for the DB security group.
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)

-- | Contains a list of @IPRange@ elements.
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

-- | Specifies the name of the DB security group.
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)

-- | Contains a list of @EC2SecurityGroup@ elements.
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

-- | Provides the description of the DB security group.
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