{-# 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.DirectoryService.Types.IpRoute where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IpRoute = IpRoute'
{
IpRoute -> Maybe Text
cidrIp :: Prelude.Maybe Prelude.Text,
IpRoute -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (IpRoute -> IpRoute -> Bool
(IpRoute -> IpRoute -> Bool)
-> (IpRoute -> IpRoute -> Bool) -> Eq IpRoute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IpRoute -> IpRoute -> Bool
$c/= :: IpRoute -> IpRoute -> Bool
== :: IpRoute -> IpRoute -> Bool
$c== :: IpRoute -> IpRoute -> Bool
Prelude.Eq, ReadPrec [IpRoute]
ReadPrec IpRoute
Int -> ReadS IpRoute
ReadS [IpRoute]
(Int -> ReadS IpRoute)
-> ReadS [IpRoute]
-> ReadPrec IpRoute
-> ReadPrec [IpRoute]
-> Read IpRoute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IpRoute]
$creadListPrec :: ReadPrec [IpRoute]
readPrec :: ReadPrec IpRoute
$creadPrec :: ReadPrec IpRoute
readList :: ReadS [IpRoute]
$creadList :: ReadS [IpRoute]
readsPrec :: Int -> ReadS IpRoute
$creadsPrec :: Int -> ReadS IpRoute
Prelude.Read, Int -> IpRoute -> ShowS
[IpRoute] -> ShowS
IpRoute -> String
(Int -> IpRoute -> ShowS)
-> (IpRoute -> String) -> ([IpRoute] -> ShowS) -> Show IpRoute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IpRoute] -> ShowS
$cshowList :: [IpRoute] -> ShowS
show :: IpRoute -> String
$cshow :: IpRoute -> String
showsPrec :: Int -> IpRoute -> ShowS
$cshowsPrec :: Int -> IpRoute -> ShowS
Prelude.Show, (forall x. IpRoute -> Rep IpRoute x)
-> (forall x. Rep IpRoute x -> IpRoute) -> Generic IpRoute
forall x. Rep IpRoute x -> IpRoute
forall x. IpRoute -> Rep IpRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IpRoute x -> IpRoute
$cfrom :: forall x. IpRoute -> Rep IpRoute x
Prelude.Generic)
newIpRoute ::
IpRoute
newIpRoute :: IpRoute
newIpRoute =
IpRoute' :: Maybe Text -> Maybe Text -> IpRoute
IpRoute'
{ $sel:cidrIp:IpRoute' :: Maybe Text
cidrIp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:IpRoute' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
ipRoute_cidrIp :: Lens.Lens' IpRoute (Prelude.Maybe Prelude.Text)
ipRoute_cidrIp :: (Maybe Text -> f (Maybe Text)) -> IpRoute -> f IpRoute
ipRoute_cidrIp = (IpRoute -> Maybe Text)
-> (IpRoute -> Maybe Text -> IpRoute)
-> Lens IpRoute IpRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpRoute' {Maybe Text
cidrIp :: Maybe Text
$sel:cidrIp:IpRoute' :: IpRoute -> Maybe Text
cidrIp} -> Maybe Text
cidrIp) (\s :: IpRoute
s@IpRoute' {} Maybe Text
a -> IpRoute
s {$sel:cidrIp:IpRoute' :: Maybe Text
cidrIp = Maybe Text
a} :: IpRoute)
ipRoute_description :: Lens.Lens' IpRoute (Prelude.Maybe Prelude.Text)
ipRoute_description :: (Maybe Text -> f (Maybe Text)) -> IpRoute -> f IpRoute
ipRoute_description = (IpRoute -> Maybe Text)
-> (IpRoute -> Maybe Text -> IpRoute)
-> Lens IpRoute IpRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpRoute' {Maybe Text
description :: Maybe Text
$sel:description:IpRoute' :: IpRoute -> Maybe Text
description} -> Maybe Text
description) (\s :: IpRoute
s@IpRoute' {} Maybe Text
a -> IpRoute
s {$sel:description:IpRoute' :: Maybe Text
description = Maybe Text
a} :: IpRoute)
instance Prelude.Hashable IpRoute
instance Prelude.NFData IpRoute
instance Core.ToJSON IpRoute where
toJSON :: IpRoute -> Value
toJSON IpRoute' {Maybe Text
description :: Maybe Text
cidrIp :: Maybe Text
$sel:description:IpRoute' :: IpRoute -> Maybe Text
$sel:cidrIp:IpRoute' :: IpRoute -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CidrIp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cidrIp,
(Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
]
)