{-# 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.RouteData where
import Amazonka.AppMesh.Types.ResourceMetadata
import Amazonka.AppMesh.Types.RouteSpec
import Amazonka.AppMesh.Types.RouteStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RouteData = RouteData'
{
RouteData -> Text
meshName :: Prelude.Text,
RouteData -> ResourceMetadata
metadata :: ResourceMetadata,
RouteData -> Text
routeName :: Prelude.Text,
RouteData -> RouteSpec
spec :: RouteSpec,
RouteData -> RouteStatus
status :: RouteStatus,
RouteData -> Text
virtualRouterName :: Prelude.Text
}
deriving (RouteData -> RouteData -> Bool
(RouteData -> RouteData -> Bool)
-> (RouteData -> RouteData -> Bool) -> Eq RouteData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RouteData -> RouteData -> Bool
$c/= :: RouteData -> RouteData -> Bool
== :: RouteData -> RouteData -> Bool
$c== :: RouteData -> RouteData -> Bool
Prelude.Eq, ReadPrec [RouteData]
ReadPrec RouteData
Int -> ReadS RouteData
ReadS [RouteData]
(Int -> ReadS RouteData)
-> ReadS [RouteData]
-> ReadPrec RouteData
-> ReadPrec [RouteData]
-> Read RouteData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RouteData]
$creadListPrec :: ReadPrec [RouteData]
readPrec :: ReadPrec RouteData
$creadPrec :: ReadPrec RouteData
readList :: ReadS [RouteData]
$creadList :: ReadS [RouteData]
readsPrec :: Int -> ReadS RouteData
$creadsPrec :: Int -> ReadS RouteData
Prelude.Read, Int -> RouteData -> ShowS
[RouteData] -> ShowS
RouteData -> String
(Int -> RouteData -> ShowS)
-> (RouteData -> String)
-> ([RouteData] -> ShowS)
-> Show RouteData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RouteData] -> ShowS
$cshowList :: [RouteData] -> ShowS
show :: RouteData -> String
$cshow :: RouteData -> String
showsPrec :: Int -> RouteData -> ShowS
$cshowsPrec :: Int -> RouteData -> ShowS
Prelude.Show, (forall x. RouteData -> Rep RouteData x)
-> (forall x. Rep RouteData x -> RouteData) -> Generic RouteData
forall x. Rep RouteData x -> RouteData
forall x. RouteData -> Rep RouteData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RouteData x -> RouteData
$cfrom :: forall x. RouteData -> Rep RouteData x
Prelude.Generic)
newRouteData ::
Prelude.Text ->
ResourceMetadata ->
Prelude.Text ->
RouteSpec ->
RouteStatus ->
Prelude.Text ->
RouteData
newRouteData :: Text
-> ResourceMetadata
-> Text
-> RouteSpec
-> RouteStatus
-> Text
-> RouteData
newRouteData
Text
pMeshName_
ResourceMetadata
pMetadata_
Text
pRouteName_
RouteSpec
pSpec_
RouteStatus
pStatus_
Text
pVirtualRouterName_ =
RouteData' :: Text
-> ResourceMetadata
-> Text
-> RouteSpec
-> RouteStatus
-> Text
-> RouteData
RouteData'
{ $sel:meshName:RouteData' :: Text
meshName = Text
pMeshName_,
$sel:metadata:RouteData' :: ResourceMetadata
metadata = ResourceMetadata
pMetadata_,
$sel:routeName:RouteData' :: Text
routeName = Text
pRouteName_,
$sel:spec:RouteData' :: RouteSpec
spec = RouteSpec
pSpec_,
$sel:status:RouteData' :: RouteStatus
status = RouteStatus
pStatus_,
$sel:virtualRouterName:RouteData' :: Text
virtualRouterName = Text
pVirtualRouterName_
}
routeData_meshName :: Lens.Lens' RouteData Prelude.Text
routeData_meshName :: (Text -> f Text) -> RouteData -> f RouteData
routeData_meshName = (RouteData -> Text)
-> (RouteData -> Text -> RouteData)
-> Lens RouteData RouteData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteData' {Text
meshName :: Text
$sel:meshName:RouteData' :: RouteData -> Text
meshName} -> Text
meshName) (\s :: RouteData
s@RouteData' {} Text
a -> RouteData
s {$sel:meshName:RouteData' :: Text
meshName = Text
a} :: RouteData)
routeData_metadata :: Lens.Lens' RouteData ResourceMetadata
routeData_metadata :: (ResourceMetadata -> f ResourceMetadata)
-> RouteData -> f RouteData
routeData_metadata = (RouteData -> ResourceMetadata)
-> (RouteData -> ResourceMetadata -> RouteData)
-> Lens RouteData RouteData ResourceMetadata ResourceMetadata
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteData' {ResourceMetadata
metadata :: ResourceMetadata
$sel:metadata:RouteData' :: RouteData -> ResourceMetadata
metadata} -> ResourceMetadata
metadata) (\s :: RouteData
s@RouteData' {} ResourceMetadata
a -> RouteData
s {$sel:metadata:RouteData' :: ResourceMetadata
metadata = ResourceMetadata
a} :: RouteData)
routeData_routeName :: Lens.Lens' RouteData Prelude.Text
routeData_routeName :: (Text -> f Text) -> RouteData -> f RouteData
routeData_routeName = (RouteData -> Text)
-> (RouteData -> Text -> RouteData)
-> Lens RouteData RouteData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteData' {Text
routeName :: Text
$sel:routeName:RouteData' :: RouteData -> Text
routeName} -> Text
routeName) (\s :: RouteData
s@RouteData' {} Text
a -> RouteData
s {$sel:routeName:RouteData' :: Text
routeName = Text
a} :: RouteData)
routeData_spec :: Lens.Lens' RouteData RouteSpec
routeData_spec :: (RouteSpec -> f RouteSpec) -> RouteData -> f RouteData
routeData_spec = (RouteData -> RouteSpec)
-> (RouteData -> RouteSpec -> RouteData)
-> Lens RouteData RouteData RouteSpec RouteSpec
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteData' {RouteSpec
spec :: RouteSpec
$sel:spec:RouteData' :: RouteData -> RouteSpec
spec} -> RouteSpec
spec) (\s :: RouteData
s@RouteData' {} RouteSpec
a -> RouteData
s {$sel:spec:RouteData' :: RouteSpec
spec = RouteSpec
a} :: RouteData)
routeData_status :: Lens.Lens' RouteData RouteStatus
routeData_status :: (RouteStatus -> f RouteStatus) -> RouteData -> f RouteData
routeData_status = (RouteData -> RouteStatus)
-> (RouteData -> RouteStatus -> RouteData)
-> Lens RouteData RouteData RouteStatus RouteStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteData' {RouteStatus
status :: RouteStatus
$sel:status:RouteData' :: RouteData -> RouteStatus
status} -> RouteStatus
status) (\s :: RouteData
s@RouteData' {} RouteStatus
a -> RouteData
s {$sel:status:RouteData' :: RouteStatus
status = RouteStatus
a} :: RouteData)
routeData_virtualRouterName :: Lens.Lens' RouteData Prelude.Text
routeData_virtualRouterName :: (Text -> f Text) -> RouteData -> f RouteData
routeData_virtualRouterName = (RouteData -> Text)
-> (RouteData -> Text -> RouteData)
-> Lens RouteData RouteData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteData' {Text
virtualRouterName :: Text
$sel:virtualRouterName:RouteData' :: RouteData -> Text
virtualRouterName} -> Text
virtualRouterName) (\s :: RouteData
s@RouteData' {} Text
a -> RouteData
s {$sel:virtualRouterName:RouteData' :: Text
virtualRouterName = Text
a} :: RouteData)
instance Core.FromJSON RouteData where
parseJSON :: Value -> Parser RouteData
parseJSON =
String -> (Object -> Parser RouteData) -> Value -> Parser RouteData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RouteData"
( \Object
x ->
Text
-> ResourceMetadata
-> Text
-> RouteSpec
-> RouteStatus
-> Text
-> RouteData
RouteData'
(Text
-> ResourceMetadata
-> Text
-> RouteSpec
-> RouteStatus
-> Text
-> RouteData)
-> Parser Text
-> Parser
(ResourceMetadata
-> Text -> RouteSpec -> RouteStatus -> Text -> RouteData)
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
"meshName")
Parser
(ResourceMetadata
-> Text -> RouteSpec -> RouteStatus -> Text -> RouteData)
-> Parser ResourceMetadata
-> Parser (Text -> RouteSpec -> RouteStatus -> Text -> RouteData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResourceMetadata
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"metadata")
Parser (Text -> RouteSpec -> RouteStatus -> Text -> RouteData)
-> Parser Text
-> Parser (RouteSpec -> RouteStatus -> Text -> RouteData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"routeName")
Parser (RouteSpec -> RouteStatus -> Text -> RouteData)
-> Parser RouteSpec -> Parser (RouteStatus -> Text -> RouteData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RouteSpec
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"spec")
Parser (RouteStatus -> Text -> RouteData)
-> Parser RouteStatus -> Parser (Text -> RouteData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RouteStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
Parser (Text -> RouteData) -> Parser Text -> Parser RouteData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"virtualRouterName")
)
instance Prelude.Hashable RouteData
instance Prelude.NFData RouteData