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

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

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

-- |
-- Create a value of 'VirtualRouterStatus' 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', 'virtualRouterStatus_status' - The current status of the virtual router.
newVirtualRouterStatus ::
  -- | 'status'
  VirtualRouterStatusCode ->
  VirtualRouterStatus
newVirtualRouterStatus :: VirtualRouterStatusCode -> VirtualRouterStatus
newVirtualRouterStatus VirtualRouterStatusCode
pStatus_ =
  VirtualRouterStatus' :: VirtualRouterStatusCode -> VirtualRouterStatus
VirtualRouterStatus' {$sel:status:VirtualRouterStatus' :: VirtualRouterStatusCode
status = VirtualRouterStatusCode
pStatus_}

-- | The current status of the virtual router.
virtualRouterStatus_status :: Lens.Lens' VirtualRouterStatus VirtualRouterStatusCode
virtualRouterStatus_status :: (VirtualRouterStatusCode -> f VirtualRouterStatusCode)
-> VirtualRouterStatus -> f VirtualRouterStatus
virtualRouterStatus_status = (VirtualRouterStatus -> VirtualRouterStatusCode)
-> (VirtualRouterStatus
    -> VirtualRouterStatusCode -> VirtualRouterStatus)
-> Lens
     VirtualRouterStatus
     VirtualRouterStatus
     VirtualRouterStatusCode
     VirtualRouterStatusCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualRouterStatus' {VirtualRouterStatusCode
status :: VirtualRouterStatusCode
$sel:status:VirtualRouterStatus' :: VirtualRouterStatus -> VirtualRouterStatusCode
status} -> VirtualRouterStatusCode
status) (\s :: VirtualRouterStatus
s@VirtualRouterStatus' {} VirtualRouterStatusCode
a -> VirtualRouterStatus
s {$sel:status:VirtualRouterStatus' :: VirtualRouterStatusCode
status = VirtualRouterStatusCode
a} :: VirtualRouterStatus)

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

instance Prelude.Hashable VirtualRouterStatus

instance Prelude.NFData VirtualRouterStatus