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

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

-- |
-- Create a value of 'VirtualNodeStatus' 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', 'virtualNodeStatus_status' - The current status of the virtual node.
newVirtualNodeStatus ::
  -- | 'status'
  VirtualNodeStatusCode ->
  VirtualNodeStatus
newVirtualNodeStatus :: VirtualNodeStatusCode -> VirtualNodeStatus
newVirtualNodeStatus VirtualNodeStatusCode
pStatus_ =
  VirtualNodeStatus' :: VirtualNodeStatusCode -> VirtualNodeStatus
VirtualNodeStatus' {$sel:status:VirtualNodeStatus' :: VirtualNodeStatusCode
status = VirtualNodeStatusCode
pStatus_}

-- | The current status of the virtual node.
virtualNodeStatus_status :: Lens.Lens' VirtualNodeStatus VirtualNodeStatusCode
virtualNodeStatus_status :: (VirtualNodeStatusCode -> f VirtualNodeStatusCode)
-> VirtualNodeStatus -> f VirtualNodeStatus
virtualNodeStatus_status = (VirtualNodeStatus -> VirtualNodeStatusCode)
-> (VirtualNodeStatus
    -> VirtualNodeStatusCode -> VirtualNodeStatus)
-> Lens
     VirtualNodeStatus
     VirtualNodeStatus
     VirtualNodeStatusCode
     VirtualNodeStatusCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualNodeStatus' {VirtualNodeStatusCode
status :: VirtualNodeStatusCode
$sel:status:VirtualNodeStatus' :: VirtualNodeStatus -> VirtualNodeStatusCode
status} -> VirtualNodeStatusCode
status) (\s :: VirtualNodeStatus
s@VirtualNodeStatus' {} VirtualNodeStatusCode
a -> VirtualNodeStatus
s {$sel:status:VirtualNodeStatus' :: VirtualNodeStatusCode
status = VirtualNodeStatusCode
a} :: VirtualNodeStatus)

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

instance Prelude.Hashable VirtualNodeStatus

instance Prelude.NFData VirtualNodeStatus