{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:cidrIp:IpRoute' :: Maybe Text
cidrIp = forall a. Maybe a
Prelude.Nothing,
$sel:description:IpRoute' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing
}
ipRoute_cidrIp :: Lens.Lens' IpRoute (Prelude.Maybe Prelude.Text)
ipRoute_cidrIp :: Lens' IpRoute (Maybe Text)
ipRoute_cidrIp = 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 :: Lens' IpRoute (Maybe Text)
ipRoute_description = 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 where
hashWithSalt :: Int -> IpRoute -> Int
hashWithSalt Int
_salt IpRoute' {Maybe Text
description :: Maybe Text
cidrIp :: Maybe Text
$sel:description:IpRoute' :: IpRoute -> Maybe Text
$sel:cidrIp:IpRoute' :: IpRoute -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cidrIp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
instance Prelude.NFData IpRoute where
rnf :: IpRoute -> ()
rnf IpRoute' {Maybe Text
description :: Maybe Text
cidrIp :: Maybe Text
$sel:description:IpRoute' :: IpRoute -> Maybe Text
$sel:cidrIp:IpRoute' :: IpRoute -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cidrIp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CidrIp" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cidrIp,
(Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
]
)