{-# 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.Subnet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.AvailabilityZone
import qualified Amazonka.Prelude as Prelude
data Subnet = Subnet'
{
Subnet -> Maybe Text
identifier :: Prelude.Maybe Prelude.Text,
Subnet -> Maybe AvailabilityZone
availabilityZone :: Prelude.Maybe AvailabilityZone
}
deriving (Subnet -> Subnet -> Bool
(Subnet -> Subnet -> Bool)
-> (Subnet -> Subnet -> Bool) -> Eq Subnet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Subnet -> Subnet -> Bool
$c/= :: Subnet -> Subnet -> Bool
== :: Subnet -> Subnet -> Bool
$c== :: Subnet -> Subnet -> Bool
Prelude.Eq, ReadPrec [Subnet]
ReadPrec Subnet
Int -> ReadS Subnet
ReadS [Subnet]
(Int -> ReadS Subnet)
-> ReadS [Subnet]
-> ReadPrec Subnet
-> ReadPrec [Subnet]
-> Read Subnet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Subnet]
$creadListPrec :: ReadPrec [Subnet]
readPrec :: ReadPrec Subnet
$creadPrec :: ReadPrec Subnet
readList :: ReadS [Subnet]
$creadList :: ReadS [Subnet]
readsPrec :: Int -> ReadS Subnet
$creadsPrec :: Int -> ReadS Subnet
Prelude.Read, Int -> Subnet -> ShowS
[Subnet] -> ShowS
Subnet -> String
(Int -> Subnet -> ShowS)
-> (Subnet -> String) -> ([Subnet] -> ShowS) -> Show Subnet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Subnet] -> ShowS
$cshowList :: [Subnet] -> ShowS
show :: Subnet -> String
$cshow :: Subnet -> String
showsPrec :: Int -> Subnet -> ShowS
$cshowsPrec :: Int -> Subnet -> ShowS
Prelude.Show, (forall x. Subnet -> Rep Subnet x)
-> (forall x. Rep Subnet x -> Subnet) -> Generic Subnet
forall x. Rep Subnet x -> Subnet
forall x. Subnet -> Rep Subnet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Subnet x -> Subnet
$cfrom :: forall x. Subnet -> Rep Subnet x
Prelude.Generic)
newSubnet ::
Subnet
newSubnet :: Subnet
newSubnet =
Subnet' :: Maybe Text -> Maybe AvailabilityZone -> Subnet
Subnet'
{ $sel:identifier:Subnet' :: Maybe Text
identifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:Subnet' :: Maybe AvailabilityZone
availabilityZone = Maybe AvailabilityZone
forall a. Maybe a
Prelude.Nothing
}
subnet_identifier :: Lens.Lens' Subnet (Prelude.Maybe Prelude.Text)
subnet_identifier :: (Maybe Text -> f (Maybe Text)) -> Subnet -> f Subnet
subnet_identifier = (Subnet -> Maybe Text)
-> (Subnet -> Maybe Text -> Subnet)
-> Lens Subnet Subnet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subnet' {Maybe Text
identifier :: Maybe Text
$sel:identifier:Subnet' :: Subnet -> Maybe Text
identifier} -> Maybe Text
identifier) (\s :: Subnet
s@Subnet' {} Maybe Text
a -> Subnet
s {$sel:identifier:Subnet' :: Maybe Text
identifier = Maybe Text
a} :: Subnet)
subnet_availabilityZone :: Lens.Lens' Subnet (Prelude.Maybe AvailabilityZone)
subnet_availabilityZone :: (Maybe AvailabilityZone -> f (Maybe AvailabilityZone))
-> Subnet -> f Subnet
subnet_availabilityZone = (Subnet -> Maybe AvailabilityZone)
-> (Subnet -> Maybe AvailabilityZone -> Subnet)
-> Lens
Subnet Subnet (Maybe AvailabilityZone) (Maybe AvailabilityZone)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subnet' {Maybe AvailabilityZone
availabilityZone :: Maybe AvailabilityZone
$sel:availabilityZone:Subnet' :: Subnet -> Maybe AvailabilityZone
availabilityZone} -> Maybe AvailabilityZone
availabilityZone) (\s :: Subnet
s@Subnet' {} Maybe AvailabilityZone
a -> Subnet
s {$sel:availabilityZone:Subnet' :: Maybe AvailabilityZone
availabilityZone = Maybe AvailabilityZone
a} :: Subnet)
instance Core.FromJSON Subnet where
parseJSON :: Value -> Parser Subnet
parseJSON =
String -> (Object -> Parser Subnet) -> Value -> Parser Subnet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Subnet"
( \Object
x ->
Maybe Text -> Maybe AvailabilityZone -> Subnet
Subnet'
(Maybe Text -> Maybe AvailabilityZone -> Subnet)
-> Parser (Maybe Text) -> Parser (Maybe AvailabilityZone -> Subnet)
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
"Identifier")
Parser (Maybe AvailabilityZone -> Subnet)
-> Parser (Maybe AvailabilityZone) -> Parser Subnet
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AvailabilityZone)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AvailabilityZone")
)
instance Prelude.Hashable Subnet
instance Prelude.NFData Subnet