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