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

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

-- |
-- Create a value of 'VirtualGatewayStatus' 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', 'virtualGatewayStatus_status' - The current status.
newVirtualGatewayStatus ::
  -- | 'status'
  VirtualGatewayStatusCode ->
  VirtualGatewayStatus
newVirtualGatewayStatus :: VirtualGatewayStatusCode -> VirtualGatewayStatus
newVirtualGatewayStatus VirtualGatewayStatusCode
pStatus_ =
  VirtualGatewayStatus' :: VirtualGatewayStatusCode -> VirtualGatewayStatus
VirtualGatewayStatus' {$sel:status:VirtualGatewayStatus' :: VirtualGatewayStatusCode
status = VirtualGatewayStatusCode
pStatus_}

-- | The current status.
virtualGatewayStatus_status :: Lens.Lens' VirtualGatewayStatus VirtualGatewayStatusCode
virtualGatewayStatus_status :: (VirtualGatewayStatusCode -> f VirtualGatewayStatusCode)
-> VirtualGatewayStatus -> f VirtualGatewayStatus
virtualGatewayStatus_status = (VirtualGatewayStatus -> VirtualGatewayStatusCode)
-> (VirtualGatewayStatus
    -> VirtualGatewayStatusCode -> VirtualGatewayStatus)
-> Lens
     VirtualGatewayStatus
     VirtualGatewayStatus
     VirtualGatewayStatusCode
     VirtualGatewayStatusCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayStatus' {VirtualGatewayStatusCode
status :: VirtualGatewayStatusCode
$sel:status:VirtualGatewayStatus' :: VirtualGatewayStatus -> VirtualGatewayStatusCode
status} -> VirtualGatewayStatusCode
status) (\s :: VirtualGatewayStatus
s@VirtualGatewayStatus' {} VirtualGatewayStatusCode
a -> VirtualGatewayStatus
s {$sel:status:VirtualGatewayStatus' :: VirtualGatewayStatusCode
status = VirtualGatewayStatusCode
a} :: VirtualGatewayStatus)

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

instance Prelude.Hashable VirtualGatewayStatus

instance Prelude.NFData VirtualGatewayStatus