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

import Amazonka.AppMesh.Types.RouteStatusCode
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 route.
--
-- /See:/ 'newRouteStatus' smart constructor.
data RouteStatus = RouteStatus'
  { -- | The current status for the route.
    RouteStatus -> RouteStatusCode
status :: RouteStatusCode
  }
  deriving (RouteStatus -> RouteStatus -> Bool
(RouteStatus -> RouteStatus -> Bool)
-> (RouteStatus -> RouteStatus -> Bool) -> Eq RouteStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RouteStatus -> RouteStatus -> Bool
$c/= :: RouteStatus -> RouteStatus -> Bool
== :: RouteStatus -> RouteStatus -> Bool
$c== :: RouteStatus -> RouteStatus -> Bool
Prelude.Eq, ReadPrec [RouteStatus]
ReadPrec RouteStatus
Int -> ReadS RouteStatus
ReadS [RouteStatus]
(Int -> ReadS RouteStatus)
-> ReadS [RouteStatus]
-> ReadPrec RouteStatus
-> ReadPrec [RouteStatus]
-> Read RouteStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RouteStatus]
$creadListPrec :: ReadPrec [RouteStatus]
readPrec :: ReadPrec RouteStatus
$creadPrec :: ReadPrec RouteStatus
readList :: ReadS [RouteStatus]
$creadList :: ReadS [RouteStatus]
readsPrec :: Int -> ReadS RouteStatus
$creadsPrec :: Int -> ReadS RouteStatus
Prelude.Read, Int -> RouteStatus -> ShowS
[RouteStatus] -> ShowS
RouteStatus -> String
(Int -> RouteStatus -> ShowS)
-> (RouteStatus -> String)
-> ([RouteStatus] -> ShowS)
-> Show RouteStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RouteStatus] -> ShowS
$cshowList :: [RouteStatus] -> ShowS
show :: RouteStatus -> String
$cshow :: RouteStatus -> String
showsPrec :: Int -> RouteStatus -> ShowS
$cshowsPrec :: Int -> RouteStatus -> ShowS
Prelude.Show, (forall x. RouteStatus -> Rep RouteStatus x)
-> (forall x. Rep RouteStatus x -> RouteStatus)
-> Generic RouteStatus
forall x. Rep RouteStatus x -> RouteStatus
forall x. RouteStatus -> Rep RouteStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RouteStatus x -> RouteStatus
$cfrom :: forall x. RouteStatus -> Rep RouteStatus x
Prelude.Generic)

-- |
-- Create a value of 'RouteStatus' 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', 'routeStatus_status' - The current status for the route.
newRouteStatus ::
  -- | 'status'
  RouteStatusCode ->
  RouteStatus
newRouteStatus :: RouteStatusCode -> RouteStatus
newRouteStatus RouteStatusCode
pStatus_ =
  RouteStatus' :: RouteStatusCode -> RouteStatus
RouteStatus' {$sel:status:RouteStatus' :: RouteStatusCode
status = RouteStatusCode
pStatus_}

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

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

instance Prelude.Hashable RouteStatus

instance Prelude.NFData RouteStatus