{-# 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.GatewayRouteStatus
-- 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.GatewayRouteStatus where

import Amazonka.AppMesh.Types.GatewayRouteStatusCode
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that represents the current status of a gateway route.
--
-- /See:/ 'newGatewayRouteStatus' smart constructor.
data GatewayRouteStatus = GatewayRouteStatus'
  { -- | The current status for the gateway route.
    GatewayRouteStatus -> GatewayRouteStatusCode
status :: GatewayRouteStatusCode
  }
  deriving (GatewayRouteStatus -> GatewayRouteStatus -> Bool
(GatewayRouteStatus -> GatewayRouteStatus -> Bool)
-> (GatewayRouteStatus -> GatewayRouteStatus -> Bool)
-> Eq GatewayRouteStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewayRouteStatus -> GatewayRouteStatus -> Bool
$c/= :: GatewayRouteStatus -> GatewayRouteStatus -> Bool
== :: GatewayRouteStatus -> GatewayRouteStatus -> Bool
$c== :: GatewayRouteStatus -> GatewayRouteStatus -> Bool
Prelude.Eq, ReadPrec [GatewayRouteStatus]
ReadPrec GatewayRouteStatus
Int -> ReadS GatewayRouteStatus
ReadS [GatewayRouteStatus]
(Int -> ReadS GatewayRouteStatus)
-> ReadS [GatewayRouteStatus]
-> ReadPrec GatewayRouteStatus
-> ReadPrec [GatewayRouteStatus]
-> Read GatewayRouteStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewayRouteStatus]
$creadListPrec :: ReadPrec [GatewayRouteStatus]
readPrec :: ReadPrec GatewayRouteStatus
$creadPrec :: ReadPrec GatewayRouteStatus
readList :: ReadS [GatewayRouteStatus]
$creadList :: ReadS [GatewayRouteStatus]
readsPrec :: Int -> ReadS GatewayRouteStatus
$creadsPrec :: Int -> ReadS GatewayRouteStatus
Prelude.Read, Int -> GatewayRouteStatus -> ShowS
[GatewayRouteStatus] -> ShowS
GatewayRouteStatus -> String
(Int -> GatewayRouteStatus -> ShowS)
-> (GatewayRouteStatus -> String)
-> ([GatewayRouteStatus] -> ShowS)
-> Show GatewayRouteStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewayRouteStatus] -> ShowS
$cshowList :: [GatewayRouteStatus] -> ShowS
show :: GatewayRouteStatus -> String
$cshow :: GatewayRouteStatus -> String
showsPrec :: Int -> GatewayRouteStatus -> ShowS
$cshowsPrec :: Int -> GatewayRouteStatus -> ShowS
Prelude.Show, (forall x. GatewayRouteStatus -> Rep GatewayRouteStatus x)
-> (forall x. Rep GatewayRouteStatus x -> GatewayRouteStatus)
-> Generic GatewayRouteStatus
forall x. Rep GatewayRouteStatus x -> GatewayRouteStatus
forall x. GatewayRouteStatus -> Rep GatewayRouteStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatewayRouteStatus x -> GatewayRouteStatus
$cfrom :: forall x. GatewayRouteStatus -> Rep GatewayRouteStatus x
Prelude.Generic)

-- |
-- Create a value of 'GatewayRouteStatus' 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:
--
-- 'status', 'gatewayRouteStatus_status' - The current status for the gateway route.
newGatewayRouteStatus ::
  -- | 'status'
  GatewayRouteStatusCode ->
  GatewayRouteStatus
newGatewayRouteStatus :: GatewayRouteStatusCode -> GatewayRouteStatus
newGatewayRouteStatus GatewayRouteStatusCode
pStatus_ =
  GatewayRouteStatus' :: GatewayRouteStatusCode -> GatewayRouteStatus
GatewayRouteStatus' {$sel:status:GatewayRouteStatus' :: GatewayRouteStatusCode
status = GatewayRouteStatusCode
pStatus_}

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

instance Core.FromJSON GatewayRouteStatus where
  parseJSON :: Value -> Parser GatewayRouteStatus
parseJSON =
    String
-> (Object -> Parser GatewayRouteStatus)
-> Value
-> Parser GatewayRouteStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GatewayRouteStatus"
      ( \Object
x ->
          GatewayRouteStatusCode -> GatewayRouteStatus
GatewayRouteStatus' (GatewayRouteStatusCode -> GatewayRouteStatus)
-> Parser GatewayRouteStatusCode -> Parser GatewayRouteStatus
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser GatewayRouteStatusCode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
      )

instance Prelude.Hashable GatewayRouteStatus

instance Prelude.NFData GatewayRouteStatus