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