{-# 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.Redshift.Types.ClusterSubnetGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
import Amazonka.Redshift.Types.Subnet
import Amazonka.Redshift.Types.Tag
data ClusterSubnetGroup = ClusterSubnetGroup'
{
ClusterSubnetGroup -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
ClusterSubnetGroup -> Maybe [Subnet]
subnets :: Prelude.Maybe [Subnet],
ClusterSubnetGroup -> Maybe Text
clusterSubnetGroupName :: Prelude.Maybe Prelude.Text,
ClusterSubnetGroup -> Maybe Text
subnetGroupStatus :: Prelude.Maybe Prelude.Text,
ClusterSubnetGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ClusterSubnetGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (ClusterSubnetGroup -> ClusterSubnetGroup -> Bool
(ClusterSubnetGroup -> ClusterSubnetGroup -> Bool)
-> (ClusterSubnetGroup -> ClusterSubnetGroup -> Bool)
-> Eq ClusterSubnetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterSubnetGroup -> ClusterSubnetGroup -> Bool
$c/= :: ClusterSubnetGroup -> ClusterSubnetGroup -> Bool
== :: ClusterSubnetGroup -> ClusterSubnetGroup -> Bool
$c== :: ClusterSubnetGroup -> ClusterSubnetGroup -> Bool
Prelude.Eq, ReadPrec [ClusterSubnetGroup]
ReadPrec ClusterSubnetGroup
Int -> ReadS ClusterSubnetGroup
ReadS [ClusterSubnetGroup]
(Int -> ReadS ClusterSubnetGroup)
-> ReadS [ClusterSubnetGroup]
-> ReadPrec ClusterSubnetGroup
-> ReadPrec [ClusterSubnetGroup]
-> Read ClusterSubnetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterSubnetGroup]
$creadListPrec :: ReadPrec [ClusterSubnetGroup]
readPrec :: ReadPrec ClusterSubnetGroup
$creadPrec :: ReadPrec ClusterSubnetGroup
readList :: ReadS [ClusterSubnetGroup]
$creadList :: ReadS [ClusterSubnetGroup]
readsPrec :: Int -> ReadS ClusterSubnetGroup
$creadsPrec :: Int -> ReadS ClusterSubnetGroup
Prelude.Read, Int -> ClusterSubnetGroup -> ShowS
[ClusterSubnetGroup] -> ShowS
ClusterSubnetGroup -> String
(Int -> ClusterSubnetGroup -> ShowS)
-> (ClusterSubnetGroup -> String)
-> ([ClusterSubnetGroup] -> ShowS)
-> Show ClusterSubnetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterSubnetGroup] -> ShowS
$cshowList :: [ClusterSubnetGroup] -> ShowS
show :: ClusterSubnetGroup -> String
$cshow :: ClusterSubnetGroup -> String
showsPrec :: Int -> ClusterSubnetGroup -> ShowS
$cshowsPrec :: Int -> ClusterSubnetGroup -> ShowS
Prelude.Show, (forall x. ClusterSubnetGroup -> Rep ClusterSubnetGroup x)
-> (forall x. Rep ClusterSubnetGroup x -> ClusterSubnetGroup)
-> Generic ClusterSubnetGroup
forall x. Rep ClusterSubnetGroup x -> ClusterSubnetGroup
forall x. ClusterSubnetGroup -> Rep ClusterSubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterSubnetGroup x -> ClusterSubnetGroup
$cfrom :: forall x. ClusterSubnetGroup -> Rep ClusterSubnetGroup x
Prelude.Generic)
newClusterSubnetGroup ::
ClusterSubnetGroup
newClusterSubnetGroup :: ClusterSubnetGroup
newClusterSubnetGroup =
ClusterSubnetGroup' :: Maybe Text
-> Maybe [Subnet]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> ClusterSubnetGroup
ClusterSubnetGroup'
{ $sel:vpcId:ClusterSubnetGroup' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subnets:ClusterSubnetGroup' :: Maybe [Subnet]
subnets = Maybe [Subnet]
forall a. Maybe a
Prelude.Nothing,
$sel:clusterSubnetGroupName:ClusterSubnetGroup' :: Maybe Text
clusterSubnetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subnetGroupStatus:ClusterSubnetGroup' :: Maybe Text
subnetGroupStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:ClusterSubnetGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:ClusterSubnetGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
clusterSubnetGroup_vpcId :: Lens.Lens' ClusterSubnetGroup (Prelude.Maybe Prelude.Text)
clusterSubnetGroup_vpcId :: (Maybe Text -> f (Maybe Text))
-> ClusterSubnetGroup -> f ClusterSubnetGroup
clusterSubnetGroup_vpcId = (ClusterSubnetGroup -> Maybe Text)
-> (ClusterSubnetGroup -> Maybe Text -> ClusterSubnetGroup)
-> Lens
ClusterSubnetGroup ClusterSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSubnetGroup' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:ClusterSubnetGroup' :: ClusterSubnetGroup -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: ClusterSubnetGroup
s@ClusterSubnetGroup' {} Maybe Text
a -> ClusterSubnetGroup
s {$sel:vpcId:ClusterSubnetGroup' :: Maybe Text
vpcId = Maybe Text
a} :: ClusterSubnetGroup)
clusterSubnetGroup_subnets :: Lens.Lens' ClusterSubnetGroup (Prelude.Maybe [Subnet])
clusterSubnetGroup_subnets :: (Maybe [Subnet] -> f (Maybe [Subnet]))
-> ClusterSubnetGroup -> f ClusterSubnetGroup
clusterSubnetGroup_subnets = (ClusterSubnetGroup -> Maybe [Subnet])
-> (ClusterSubnetGroup -> Maybe [Subnet] -> ClusterSubnetGroup)
-> Lens
ClusterSubnetGroup
ClusterSubnetGroup
(Maybe [Subnet])
(Maybe [Subnet])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSubnetGroup' {Maybe [Subnet]
subnets :: Maybe [Subnet]
$sel:subnets:ClusterSubnetGroup' :: ClusterSubnetGroup -> Maybe [Subnet]
subnets} -> Maybe [Subnet]
subnets) (\s :: ClusterSubnetGroup
s@ClusterSubnetGroup' {} Maybe [Subnet]
a -> ClusterSubnetGroup
s {$sel:subnets:ClusterSubnetGroup' :: Maybe [Subnet]
subnets = Maybe [Subnet]
a} :: ClusterSubnetGroup) ((Maybe [Subnet] -> f (Maybe [Subnet]))
-> ClusterSubnetGroup -> f ClusterSubnetGroup)
-> ((Maybe [Subnet] -> f (Maybe [Subnet]))
-> Maybe [Subnet] -> f (Maybe [Subnet]))
-> (Maybe [Subnet] -> f (Maybe [Subnet]))
-> ClusterSubnetGroup
-> f ClusterSubnetGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Subnet] [Subnet] [Subnet] [Subnet]
-> Iso
(Maybe [Subnet]) (Maybe [Subnet]) (Maybe [Subnet]) (Maybe [Subnet])
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 [Subnet] [Subnet] [Subnet] [Subnet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
clusterSubnetGroup_clusterSubnetGroupName :: Lens.Lens' ClusterSubnetGroup (Prelude.Maybe Prelude.Text)
clusterSubnetGroup_clusterSubnetGroupName :: (Maybe Text -> f (Maybe Text))
-> ClusterSubnetGroup -> f ClusterSubnetGroup
clusterSubnetGroup_clusterSubnetGroupName = (ClusterSubnetGroup -> Maybe Text)
-> (ClusterSubnetGroup -> Maybe Text -> ClusterSubnetGroup)
-> Lens
ClusterSubnetGroup ClusterSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSubnetGroup' {Maybe Text
clusterSubnetGroupName :: Maybe Text
$sel:clusterSubnetGroupName:ClusterSubnetGroup' :: ClusterSubnetGroup -> Maybe Text
clusterSubnetGroupName} -> Maybe Text
clusterSubnetGroupName) (\s :: ClusterSubnetGroup
s@ClusterSubnetGroup' {} Maybe Text
a -> ClusterSubnetGroup
s {$sel:clusterSubnetGroupName:ClusterSubnetGroup' :: Maybe Text
clusterSubnetGroupName = Maybe Text
a} :: ClusterSubnetGroup)
clusterSubnetGroup_subnetGroupStatus :: Lens.Lens' ClusterSubnetGroup (Prelude.Maybe Prelude.Text)
clusterSubnetGroup_subnetGroupStatus :: (Maybe Text -> f (Maybe Text))
-> ClusterSubnetGroup -> f ClusterSubnetGroup
clusterSubnetGroup_subnetGroupStatus = (ClusterSubnetGroup -> Maybe Text)
-> (ClusterSubnetGroup -> Maybe Text -> ClusterSubnetGroup)
-> Lens
ClusterSubnetGroup ClusterSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSubnetGroup' {Maybe Text
subnetGroupStatus :: Maybe Text
$sel:subnetGroupStatus:ClusterSubnetGroup' :: ClusterSubnetGroup -> Maybe Text
subnetGroupStatus} -> Maybe Text
subnetGroupStatus) (\s :: ClusterSubnetGroup
s@ClusterSubnetGroup' {} Maybe Text
a -> ClusterSubnetGroup
s {$sel:subnetGroupStatus:ClusterSubnetGroup' :: Maybe Text
subnetGroupStatus = Maybe Text
a} :: ClusterSubnetGroup)
clusterSubnetGroup_description :: Lens.Lens' ClusterSubnetGroup (Prelude.Maybe Prelude.Text)
clusterSubnetGroup_description :: (Maybe Text -> f (Maybe Text))
-> ClusterSubnetGroup -> f ClusterSubnetGroup
clusterSubnetGroup_description = (ClusterSubnetGroup -> Maybe Text)
-> (ClusterSubnetGroup -> Maybe Text -> ClusterSubnetGroup)
-> Lens
ClusterSubnetGroup ClusterSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSubnetGroup' {Maybe Text
description :: Maybe Text
$sel:description:ClusterSubnetGroup' :: ClusterSubnetGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: ClusterSubnetGroup
s@ClusterSubnetGroup' {} Maybe Text
a -> ClusterSubnetGroup
s {$sel:description:ClusterSubnetGroup' :: Maybe Text
description = Maybe Text
a} :: ClusterSubnetGroup)
clusterSubnetGroup_tags :: Lens.Lens' ClusterSubnetGroup (Prelude.Maybe [Tag])
clusterSubnetGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> ClusterSubnetGroup -> f ClusterSubnetGroup
clusterSubnetGroup_tags = (ClusterSubnetGroup -> Maybe [Tag])
-> (ClusterSubnetGroup -> Maybe [Tag] -> ClusterSubnetGroup)
-> Lens
ClusterSubnetGroup ClusterSubnetGroup (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSubnetGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ClusterSubnetGroup' :: ClusterSubnetGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ClusterSubnetGroup
s@ClusterSubnetGroup' {} Maybe [Tag]
a -> ClusterSubnetGroup
s {$sel:tags:ClusterSubnetGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ClusterSubnetGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
-> ClusterSubnetGroup -> f ClusterSubnetGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> ClusterSubnetGroup
-> f ClusterSubnetGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromXML ClusterSubnetGroup where
parseXML :: [Node] -> Either String ClusterSubnetGroup
parseXML [Node]
x =
Maybe Text
-> Maybe [Subnet]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> ClusterSubnetGroup
ClusterSubnetGroup'
(Maybe Text
-> Maybe [Subnet]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> ClusterSubnetGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe [Subnet]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> ClusterSubnetGroup)
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 [Subnet]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> ClusterSubnetGroup)
-> Either String (Maybe [Subnet])
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> ClusterSubnetGroup)
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
"Subnets" 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 [Subnet]))
-> Either String (Maybe [Subnet])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Subnet])
-> [Node] -> Either String (Maybe [Subnet])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Subnet]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"Subnet")
)
Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> ClusterSubnetGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Maybe [Tag] -> ClusterSubnetGroup)
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
"ClusterSubnetGroupName")
Either
String
(Maybe Text -> Maybe Text -> Maybe [Tag] -> ClusterSubnetGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe [Tag] -> ClusterSubnetGroup)
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
"SubnetGroupStatus")
Either String (Maybe Text -> Maybe [Tag] -> ClusterSubnetGroup)
-> Either String (Maybe Text)
-> Either String (Maybe [Tag] -> ClusterSubnetGroup)
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")
Either String (Maybe [Tag] -> ClusterSubnetGroup)
-> Either String (Maybe [Tag]) -> Either String ClusterSubnetGroup
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
"Tags" 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 [Tag]))
-> Either String (Maybe [Tag])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Tag])
-> [Node] -> Either String (Maybe [Tag])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Tag]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"Tag")
)
instance Prelude.Hashable ClusterSubnetGroup
instance Prelude.NFData ClusterSubnetGroup