{-# 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.MemoryDb.Types.SubnetGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.Subnet
import qualified Amazonka.Prelude as Prelude
data SubnetGroup = SubnetGroup'
{
SubnetGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
SubnetGroup -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
SubnetGroup -> Maybe [Subnet]
subnets :: Prelude.Maybe [Subnet],
SubnetGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SubnetGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (SubnetGroup -> SubnetGroup -> Bool
(SubnetGroup -> SubnetGroup -> Bool)
-> (SubnetGroup -> SubnetGroup -> Bool) -> Eq SubnetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubnetGroup -> SubnetGroup -> Bool
$c/= :: SubnetGroup -> SubnetGroup -> Bool
== :: SubnetGroup -> SubnetGroup -> Bool
$c== :: SubnetGroup -> SubnetGroup -> Bool
Prelude.Eq, ReadPrec [SubnetGroup]
ReadPrec SubnetGroup
Int -> ReadS SubnetGroup
ReadS [SubnetGroup]
(Int -> ReadS SubnetGroup)
-> ReadS [SubnetGroup]
-> ReadPrec SubnetGroup
-> ReadPrec [SubnetGroup]
-> Read SubnetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubnetGroup]
$creadListPrec :: ReadPrec [SubnetGroup]
readPrec :: ReadPrec SubnetGroup
$creadPrec :: ReadPrec SubnetGroup
readList :: ReadS [SubnetGroup]
$creadList :: ReadS [SubnetGroup]
readsPrec :: Int -> ReadS SubnetGroup
$creadsPrec :: Int -> ReadS SubnetGroup
Prelude.Read, Int -> SubnetGroup -> ShowS
[SubnetGroup] -> ShowS
SubnetGroup -> String
(Int -> SubnetGroup -> ShowS)
-> (SubnetGroup -> String)
-> ([SubnetGroup] -> ShowS)
-> Show SubnetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubnetGroup] -> ShowS
$cshowList :: [SubnetGroup] -> ShowS
show :: SubnetGroup -> String
$cshow :: SubnetGroup -> String
showsPrec :: Int -> SubnetGroup -> ShowS
$cshowsPrec :: Int -> SubnetGroup -> ShowS
Prelude.Show, (forall x. SubnetGroup -> Rep SubnetGroup x)
-> (forall x. Rep SubnetGroup x -> SubnetGroup)
-> Generic SubnetGroup
forall x. Rep SubnetGroup x -> SubnetGroup
forall x. SubnetGroup -> Rep SubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubnetGroup x -> SubnetGroup
$cfrom :: forall x. SubnetGroup -> Rep SubnetGroup x
Prelude.Generic)
newSubnetGroup ::
SubnetGroup
newSubnetGroup :: SubnetGroup
newSubnetGroup =
SubnetGroup' :: Maybe Text
-> Maybe Text
-> Maybe [Subnet]
-> Maybe Text
-> Maybe Text
-> SubnetGroup
SubnetGroup'
{ $sel:arn:SubnetGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:vpcId:SubnetGroup' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subnets:SubnetGroup' :: Maybe [Subnet]
subnets = Maybe [Subnet]
forall a. Maybe a
Prelude.Nothing,
$sel:name:SubnetGroup' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:SubnetGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
subnetGroup_arn :: Lens.Lens' SubnetGroup (Prelude.Maybe Prelude.Text)
subnetGroup_arn :: (Maybe Text -> f (Maybe Text)) -> SubnetGroup -> f SubnetGroup
subnetGroup_arn = (SubnetGroup -> Maybe Text)
-> (SubnetGroup -> Maybe Text -> SubnetGroup)
-> Lens SubnetGroup SubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubnetGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:SubnetGroup' :: SubnetGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SubnetGroup
s@SubnetGroup' {} Maybe Text
a -> SubnetGroup
s {$sel:arn:SubnetGroup' :: Maybe Text
arn = Maybe Text
a} :: SubnetGroup)
subnetGroup_vpcId :: Lens.Lens' SubnetGroup (Prelude.Maybe Prelude.Text)
subnetGroup_vpcId :: (Maybe Text -> f (Maybe Text)) -> SubnetGroup -> f SubnetGroup
subnetGroup_vpcId = (SubnetGroup -> Maybe Text)
-> (SubnetGroup -> Maybe Text -> SubnetGroup)
-> Lens SubnetGroup SubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubnetGroup' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:SubnetGroup' :: SubnetGroup -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: SubnetGroup
s@SubnetGroup' {} Maybe Text
a -> SubnetGroup
s {$sel:vpcId:SubnetGroup' :: Maybe Text
vpcId = Maybe Text
a} :: SubnetGroup)
subnetGroup_subnets :: Lens.Lens' SubnetGroup (Prelude.Maybe [Subnet])
subnetGroup_subnets :: (Maybe [Subnet] -> f (Maybe [Subnet]))
-> SubnetGroup -> f SubnetGroup
subnetGroup_subnets = (SubnetGroup -> Maybe [Subnet])
-> (SubnetGroup -> Maybe [Subnet] -> SubnetGroup)
-> Lens SubnetGroup SubnetGroup (Maybe [Subnet]) (Maybe [Subnet])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubnetGroup' {Maybe [Subnet]
subnets :: Maybe [Subnet]
$sel:subnets:SubnetGroup' :: SubnetGroup -> Maybe [Subnet]
subnets} -> Maybe [Subnet]
subnets) (\s :: SubnetGroup
s@SubnetGroup' {} Maybe [Subnet]
a -> SubnetGroup
s {$sel:subnets:SubnetGroup' :: Maybe [Subnet]
subnets = Maybe [Subnet]
a} :: SubnetGroup) ((Maybe [Subnet] -> f (Maybe [Subnet]))
-> SubnetGroup -> f SubnetGroup)
-> ((Maybe [Subnet] -> f (Maybe [Subnet]))
-> Maybe [Subnet] -> f (Maybe [Subnet]))
-> (Maybe [Subnet] -> f (Maybe [Subnet]))
-> SubnetGroup
-> f SubnetGroup
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
subnetGroup_name :: Lens.Lens' SubnetGroup (Prelude.Maybe Prelude.Text)
subnetGroup_name :: (Maybe Text -> f (Maybe Text)) -> SubnetGroup -> f SubnetGroup
subnetGroup_name = (SubnetGroup -> Maybe Text)
-> (SubnetGroup -> Maybe Text -> SubnetGroup)
-> Lens SubnetGroup SubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubnetGroup' {Maybe Text
name :: Maybe Text
$sel:name:SubnetGroup' :: SubnetGroup -> Maybe Text
name} -> Maybe Text
name) (\s :: SubnetGroup
s@SubnetGroup' {} Maybe Text
a -> SubnetGroup
s {$sel:name:SubnetGroup' :: Maybe Text
name = Maybe Text
a} :: SubnetGroup)
subnetGroup_description :: Lens.Lens' SubnetGroup (Prelude.Maybe Prelude.Text)
subnetGroup_description :: (Maybe Text -> f (Maybe Text)) -> SubnetGroup -> f SubnetGroup
subnetGroup_description = (SubnetGroup -> Maybe Text)
-> (SubnetGroup -> Maybe Text -> SubnetGroup)
-> Lens SubnetGroup SubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubnetGroup' {Maybe Text
description :: Maybe Text
$sel:description:SubnetGroup' :: SubnetGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: SubnetGroup
s@SubnetGroup' {} Maybe Text
a -> SubnetGroup
s {$sel:description:SubnetGroup' :: Maybe Text
description = Maybe Text
a} :: SubnetGroup)
instance Core.FromJSON SubnetGroup where
parseJSON :: Value -> Parser SubnetGroup
parseJSON =
String
-> (Object -> Parser SubnetGroup) -> Value -> Parser SubnetGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SubnetGroup"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [Subnet]
-> Maybe Text
-> Maybe Text
-> SubnetGroup
SubnetGroup'
(Maybe Text
-> Maybe Text
-> Maybe [Subnet]
-> Maybe Text
-> Maybe Text
-> SubnetGroup)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Subnet] -> Maybe Text -> Maybe Text -> SubnetGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ARN")
Parser
(Maybe Text
-> Maybe [Subnet] -> Maybe Text -> Maybe Text -> SubnetGroup)
-> Parser (Maybe Text)
-> Parser
(Maybe [Subnet] -> Maybe Text -> Maybe Text -> SubnetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VpcId")
Parser (Maybe [Subnet] -> Maybe Text -> Maybe Text -> SubnetGroup)
-> Parser (Maybe [Subnet])
-> Parser (Maybe Text -> Maybe Text -> SubnetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Subnet]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Subnets" Parser (Maybe (Maybe [Subnet]))
-> Maybe [Subnet] -> Parser (Maybe [Subnet])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Subnet]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> SubnetGroup)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SubnetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser (Maybe Text -> SubnetGroup)
-> Parser (Maybe Text) -> Parser SubnetGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
)
instance Prelude.Hashable SubnetGroup
instance Prelude.NFData SubnetGroup