{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AppMesh.Types.GatewayRouteData
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AppMesh.Types.GatewayRouteData where

import Amazonka.AppMesh.Types.GatewayRouteSpec
import Amazonka.AppMesh.Types.GatewayRouteStatus
import Amazonka.AppMesh.Types.ResourceMetadata
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that represents a gateway route returned by a describe
-- operation.
--
-- /See:/ 'newGatewayRouteData' smart constructor.
data GatewayRouteData = GatewayRouteData'
  { -- | The name of the gateway route.
    GatewayRouteData -> Text
gatewayRouteName :: Prelude.Text,
    -- | The name of the service mesh that the resource resides in.
    GatewayRouteData -> Text
meshName :: Prelude.Text,
    GatewayRouteData -> ResourceMetadata
metadata :: ResourceMetadata,
    -- | The specifications of the gateway route.
    GatewayRouteData -> GatewayRouteSpec
spec :: GatewayRouteSpec,
    -- | The status of the gateway route.
    GatewayRouteData -> GatewayRouteStatus
status :: GatewayRouteStatus,
    -- | The virtual gateway that the gateway route is associated with.
    GatewayRouteData -> Text
virtualGatewayName :: Prelude.Text
  }
  deriving (GatewayRouteData -> GatewayRouteData -> Bool
(GatewayRouteData -> GatewayRouteData -> Bool)
-> (GatewayRouteData -> GatewayRouteData -> Bool)
-> Eq GatewayRouteData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewayRouteData -> GatewayRouteData -> Bool
$c/= :: GatewayRouteData -> GatewayRouteData -> Bool
== :: GatewayRouteData -> GatewayRouteData -> Bool
$c== :: GatewayRouteData -> GatewayRouteData -> Bool
Prelude.Eq, ReadPrec [GatewayRouteData]
ReadPrec GatewayRouteData
Int -> ReadS GatewayRouteData
ReadS [GatewayRouteData]
(Int -> ReadS GatewayRouteData)
-> ReadS [GatewayRouteData]
-> ReadPrec GatewayRouteData
-> ReadPrec [GatewayRouteData]
-> Read GatewayRouteData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewayRouteData]
$creadListPrec :: ReadPrec [GatewayRouteData]
readPrec :: ReadPrec GatewayRouteData
$creadPrec :: ReadPrec GatewayRouteData
readList :: ReadS [GatewayRouteData]
$creadList :: ReadS [GatewayRouteData]
readsPrec :: Int -> ReadS GatewayRouteData
$creadsPrec :: Int -> ReadS GatewayRouteData
Prelude.Read, Int -> GatewayRouteData -> ShowS
[GatewayRouteData] -> ShowS
GatewayRouteData -> String
(Int -> GatewayRouteData -> ShowS)
-> (GatewayRouteData -> String)
-> ([GatewayRouteData] -> ShowS)
-> Show GatewayRouteData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewayRouteData] -> ShowS
$cshowList :: [GatewayRouteData] -> ShowS
show :: GatewayRouteData -> String
$cshow :: GatewayRouteData -> String
showsPrec :: Int -> GatewayRouteData -> ShowS
$cshowsPrec :: Int -> GatewayRouteData -> ShowS
Prelude.Show, (forall x. GatewayRouteData -> Rep GatewayRouteData x)
-> (forall x. Rep GatewayRouteData x -> GatewayRouteData)
-> Generic GatewayRouteData
forall x. Rep GatewayRouteData x -> GatewayRouteData
forall x. GatewayRouteData -> Rep GatewayRouteData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatewayRouteData x -> GatewayRouteData
$cfrom :: forall x. GatewayRouteData -> Rep GatewayRouteData x
Prelude.Generic)

-- |
-- Create a value of 'GatewayRouteData' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'gatewayRouteName', 'gatewayRouteData_gatewayRouteName' - The name of the gateway route.
--
-- 'meshName', 'gatewayRouteData_meshName' - The name of the service mesh that the resource resides in.
--
-- 'metadata', 'gatewayRouteData_metadata' - Undocumented member.
--
-- 'spec', 'gatewayRouteData_spec' - The specifications of the gateway route.
--
-- 'status', 'gatewayRouteData_status' - The status of the gateway route.
--
-- 'virtualGatewayName', 'gatewayRouteData_virtualGatewayName' - The virtual gateway that the gateway route is associated with.
newGatewayRouteData ::
  -- | 'gatewayRouteName'
  Prelude.Text ->
  -- | 'meshName'
  Prelude.Text ->
  -- | 'metadata'
  ResourceMetadata ->
  -- | 'spec'
  GatewayRouteSpec ->
  -- | 'status'
  GatewayRouteStatus ->
  -- | 'virtualGatewayName'
  Prelude.Text ->
  GatewayRouteData
newGatewayRouteData :: Text
-> Text
-> ResourceMetadata
-> GatewayRouteSpec
-> GatewayRouteStatus
-> Text
-> GatewayRouteData
newGatewayRouteData
  Text
pGatewayRouteName_
  Text
pMeshName_
  ResourceMetadata
pMetadata_
  GatewayRouteSpec
pSpec_
  GatewayRouteStatus
pStatus_
  Text
pVirtualGatewayName_ =
    GatewayRouteData' :: Text
-> Text
-> ResourceMetadata
-> GatewayRouteSpec
-> GatewayRouteStatus
-> Text
-> GatewayRouteData
GatewayRouteData'
      { $sel:gatewayRouteName:GatewayRouteData' :: Text
gatewayRouteName =
          Text
pGatewayRouteName_,
        $sel:meshName:GatewayRouteData' :: Text
meshName = Text
pMeshName_,
        $sel:metadata:GatewayRouteData' :: ResourceMetadata
metadata = ResourceMetadata
pMetadata_,
        $sel:spec:GatewayRouteData' :: GatewayRouteSpec
spec = GatewayRouteSpec
pSpec_,
        $sel:status:GatewayRouteData' :: GatewayRouteStatus
status = GatewayRouteStatus
pStatus_,
        $sel:virtualGatewayName:GatewayRouteData' :: Text
virtualGatewayName = Text
pVirtualGatewayName_
      }

-- | The name of the gateway route.
gatewayRouteData_gatewayRouteName :: Lens.Lens' GatewayRouteData Prelude.Text
gatewayRouteData_gatewayRouteName :: (Text -> f Text) -> GatewayRouteData -> f GatewayRouteData
gatewayRouteData_gatewayRouteName = (GatewayRouteData -> Text)
-> (GatewayRouteData -> Text -> GatewayRouteData)
-> Lens GatewayRouteData GatewayRouteData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayRouteData' {Text
gatewayRouteName :: Text
$sel:gatewayRouteName:GatewayRouteData' :: GatewayRouteData -> Text
gatewayRouteName} -> Text
gatewayRouteName) (\s :: GatewayRouteData
s@GatewayRouteData' {} Text
a -> GatewayRouteData
s {$sel:gatewayRouteName:GatewayRouteData' :: Text
gatewayRouteName = Text
a} :: GatewayRouteData)

-- | The name of the service mesh that the resource resides in.
gatewayRouteData_meshName :: Lens.Lens' GatewayRouteData Prelude.Text
gatewayRouteData_meshName :: (Text -> f Text) -> GatewayRouteData -> f GatewayRouteData
gatewayRouteData_meshName = (GatewayRouteData -> Text)
-> (GatewayRouteData -> Text -> GatewayRouteData)
-> Lens GatewayRouteData GatewayRouteData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayRouteData' {Text
meshName :: Text
$sel:meshName:GatewayRouteData' :: GatewayRouteData -> Text
meshName} -> Text
meshName) (\s :: GatewayRouteData
s@GatewayRouteData' {} Text
a -> GatewayRouteData
s {$sel:meshName:GatewayRouteData' :: Text
meshName = Text
a} :: GatewayRouteData)

-- | Undocumented member.
gatewayRouteData_metadata :: Lens.Lens' GatewayRouteData ResourceMetadata
gatewayRouteData_metadata :: (ResourceMetadata -> f ResourceMetadata)
-> GatewayRouteData -> f GatewayRouteData
gatewayRouteData_metadata = (GatewayRouteData -> ResourceMetadata)
-> (GatewayRouteData -> ResourceMetadata -> GatewayRouteData)
-> Lens
     GatewayRouteData GatewayRouteData ResourceMetadata ResourceMetadata
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayRouteData' {ResourceMetadata
metadata :: ResourceMetadata
$sel:metadata:GatewayRouteData' :: GatewayRouteData -> ResourceMetadata
metadata} -> ResourceMetadata
metadata) (\s :: GatewayRouteData
s@GatewayRouteData' {} ResourceMetadata
a -> GatewayRouteData
s {$sel:metadata:GatewayRouteData' :: ResourceMetadata
metadata = ResourceMetadata
a} :: GatewayRouteData)

-- | The specifications of the gateway route.
gatewayRouteData_spec :: Lens.Lens' GatewayRouteData GatewayRouteSpec
gatewayRouteData_spec :: (GatewayRouteSpec -> f GatewayRouteSpec)
-> GatewayRouteData -> f GatewayRouteData
gatewayRouteData_spec = (GatewayRouteData -> GatewayRouteSpec)
-> (GatewayRouteData -> GatewayRouteSpec -> GatewayRouteData)
-> Lens
     GatewayRouteData GatewayRouteData GatewayRouteSpec GatewayRouteSpec
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayRouteData' {GatewayRouteSpec
spec :: GatewayRouteSpec
$sel:spec:GatewayRouteData' :: GatewayRouteData -> GatewayRouteSpec
spec} -> GatewayRouteSpec
spec) (\s :: GatewayRouteData
s@GatewayRouteData' {} GatewayRouteSpec
a -> GatewayRouteData
s {$sel:spec:GatewayRouteData' :: GatewayRouteSpec
spec = GatewayRouteSpec
a} :: GatewayRouteData)

-- | The status of the gateway route.
gatewayRouteData_status :: Lens.Lens' GatewayRouteData GatewayRouteStatus
gatewayRouteData_status :: (GatewayRouteStatus -> f GatewayRouteStatus)
-> GatewayRouteData -> f GatewayRouteData
gatewayRouteData_status = (GatewayRouteData -> GatewayRouteStatus)
-> (GatewayRouteData -> GatewayRouteStatus -> GatewayRouteData)
-> Lens
     GatewayRouteData
     GatewayRouteData
     GatewayRouteStatus
     GatewayRouteStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayRouteData' {GatewayRouteStatus
status :: GatewayRouteStatus
$sel:status:GatewayRouteData' :: GatewayRouteData -> GatewayRouteStatus
status} -> GatewayRouteStatus
status) (\s :: GatewayRouteData
s@GatewayRouteData' {} GatewayRouteStatus
a -> GatewayRouteData
s {$sel:status:GatewayRouteData' :: GatewayRouteStatus
status = GatewayRouteStatus
a} :: GatewayRouteData)

-- | The virtual gateway that the gateway route is associated with.
gatewayRouteData_virtualGatewayName :: Lens.Lens' GatewayRouteData Prelude.Text
gatewayRouteData_virtualGatewayName :: (Text -> f Text) -> GatewayRouteData -> f GatewayRouteData
gatewayRouteData_virtualGatewayName = (GatewayRouteData -> Text)
-> (GatewayRouteData -> Text -> GatewayRouteData)
-> Lens GatewayRouteData GatewayRouteData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayRouteData' {Text
virtualGatewayName :: Text
$sel:virtualGatewayName:GatewayRouteData' :: GatewayRouteData -> Text
virtualGatewayName} -> Text
virtualGatewayName) (\s :: GatewayRouteData
s@GatewayRouteData' {} Text
a -> GatewayRouteData
s {$sel:virtualGatewayName:GatewayRouteData' :: Text
virtualGatewayName = Text
a} :: GatewayRouteData)

instance Core.FromJSON GatewayRouteData where
  parseJSON :: Value -> Parser GatewayRouteData
parseJSON =
    String
-> (Object -> Parser GatewayRouteData)
-> Value
-> Parser GatewayRouteData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GatewayRouteData"
      ( \Object
x ->
          Text
-> Text
-> ResourceMetadata
-> GatewayRouteSpec
-> GatewayRouteStatus
-> Text
-> GatewayRouteData
GatewayRouteData'
            (Text
 -> Text
 -> ResourceMetadata
 -> GatewayRouteSpec
 -> GatewayRouteStatus
 -> Text
 -> GatewayRouteData)
-> Parser Text
-> Parser
     (Text
      -> ResourceMetadata
      -> GatewayRouteSpec
      -> GatewayRouteStatus
      -> Text
      -> GatewayRouteData)
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
"gatewayRouteName")
            Parser
  (Text
   -> ResourceMetadata
   -> GatewayRouteSpec
   -> GatewayRouteStatus
   -> Text
   -> GatewayRouteData)
-> Parser Text
-> Parser
     (ResourceMetadata
      -> GatewayRouteSpec
      -> GatewayRouteStatus
      -> Text
      -> GatewayRouteData)
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
"meshName")
            Parser
  (ResourceMetadata
   -> GatewayRouteSpec
   -> GatewayRouteStatus
   -> Text
   -> GatewayRouteData)
-> Parser ResourceMetadata
-> Parser
     (GatewayRouteSpec
      -> GatewayRouteStatus -> Text -> GatewayRouteData)
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
  (GatewayRouteSpec
   -> GatewayRouteStatus -> Text -> GatewayRouteData)
-> Parser GatewayRouteSpec
-> Parser (GatewayRouteStatus -> Text -> GatewayRouteData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser GatewayRouteSpec
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"spec")
            Parser (GatewayRouteStatus -> Text -> GatewayRouteData)
-> Parser GatewayRouteStatus -> Parser (Text -> GatewayRouteData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser GatewayRouteStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
            Parser (Text -> GatewayRouteData)
-> Parser Text -> Parser GatewayRouteData
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
"virtualGatewayName")
      )

instance Prelude.Hashable GatewayRouteData

instance Prelude.NFData GatewayRouteData