{-# 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.EC2.Types.ClientVpnEndpointAttributeStatus
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.ClientVpnEndpointAttributeStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.ClientVpnEndpointAttributeStatusCode
import qualified Amazonka.Prelude as Prelude

-- | Describes the status of the Client VPN endpoint attribute.
--
-- /See:/ 'newClientVpnEndpointAttributeStatus' smart constructor.
data ClientVpnEndpointAttributeStatus = ClientVpnEndpointAttributeStatus'
  { -- | The status code.
    ClientVpnEndpointAttributeStatus
-> Maybe ClientVpnEndpointAttributeStatusCode
code :: Prelude.Maybe ClientVpnEndpointAttributeStatusCode,
    -- | The status message.
    ClientVpnEndpointAttributeStatus -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (ClientVpnEndpointAttributeStatus
-> ClientVpnEndpointAttributeStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientVpnEndpointAttributeStatus
-> ClientVpnEndpointAttributeStatus -> Bool
$c/= :: ClientVpnEndpointAttributeStatus
-> ClientVpnEndpointAttributeStatus -> Bool
== :: ClientVpnEndpointAttributeStatus
-> ClientVpnEndpointAttributeStatus -> Bool
$c== :: ClientVpnEndpointAttributeStatus
-> ClientVpnEndpointAttributeStatus -> Bool
Prelude.Eq, ReadPrec [ClientVpnEndpointAttributeStatus]
ReadPrec ClientVpnEndpointAttributeStatus
Int -> ReadS ClientVpnEndpointAttributeStatus
ReadS [ClientVpnEndpointAttributeStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClientVpnEndpointAttributeStatus]
$creadListPrec :: ReadPrec [ClientVpnEndpointAttributeStatus]
readPrec :: ReadPrec ClientVpnEndpointAttributeStatus
$creadPrec :: ReadPrec ClientVpnEndpointAttributeStatus
readList :: ReadS [ClientVpnEndpointAttributeStatus]
$creadList :: ReadS [ClientVpnEndpointAttributeStatus]
readsPrec :: Int -> ReadS ClientVpnEndpointAttributeStatus
$creadsPrec :: Int -> ReadS ClientVpnEndpointAttributeStatus
Prelude.Read, Int -> ClientVpnEndpointAttributeStatus -> ShowS
[ClientVpnEndpointAttributeStatus] -> ShowS
ClientVpnEndpointAttributeStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClientVpnEndpointAttributeStatus] -> ShowS
$cshowList :: [ClientVpnEndpointAttributeStatus] -> ShowS
show :: ClientVpnEndpointAttributeStatus -> String
$cshow :: ClientVpnEndpointAttributeStatus -> String
showsPrec :: Int -> ClientVpnEndpointAttributeStatus -> ShowS
$cshowsPrec :: Int -> ClientVpnEndpointAttributeStatus -> ShowS
Prelude.Show, forall x.
Rep ClientVpnEndpointAttributeStatus x
-> ClientVpnEndpointAttributeStatus
forall x.
ClientVpnEndpointAttributeStatus
-> Rep ClientVpnEndpointAttributeStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClientVpnEndpointAttributeStatus x
-> ClientVpnEndpointAttributeStatus
$cfrom :: forall x.
ClientVpnEndpointAttributeStatus
-> Rep ClientVpnEndpointAttributeStatus x
Prelude.Generic)

-- |
-- Create a value of 'ClientVpnEndpointAttributeStatus' 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:
--
-- 'code', 'clientVpnEndpointAttributeStatus_code' - The status code.
--
-- 'message', 'clientVpnEndpointAttributeStatus_message' - The status message.
newClientVpnEndpointAttributeStatus ::
  ClientVpnEndpointAttributeStatus
newClientVpnEndpointAttributeStatus :: ClientVpnEndpointAttributeStatus
newClientVpnEndpointAttributeStatus =
  ClientVpnEndpointAttributeStatus'
    { $sel:code:ClientVpnEndpointAttributeStatus' :: Maybe ClientVpnEndpointAttributeStatusCode
code =
        forall a. Maybe a
Prelude.Nothing,
      $sel:message:ClientVpnEndpointAttributeStatus' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

-- | The status code.
clientVpnEndpointAttributeStatus_code :: Lens.Lens' ClientVpnEndpointAttributeStatus (Prelude.Maybe ClientVpnEndpointAttributeStatusCode)
clientVpnEndpointAttributeStatus_code :: Lens'
  ClientVpnEndpointAttributeStatus
  (Maybe ClientVpnEndpointAttributeStatusCode)
clientVpnEndpointAttributeStatus_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientVpnEndpointAttributeStatus' {Maybe ClientVpnEndpointAttributeStatusCode
code :: Maybe ClientVpnEndpointAttributeStatusCode
$sel:code:ClientVpnEndpointAttributeStatus' :: ClientVpnEndpointAttributeStatus
-> Maybe ClientVpnEndpointAttributeStatusCode
code} -> Maybe ClientVpnEndpointAttributeStatusCode
code) (\s :: ClientVpnEndpointAttributeStatus
s@ClientVpnEndpointAttributeStatus' {} Maybe ClientVpnEndpointAttributeStatusCode
a -> ClientVpnEndpointAttributeStatus
s {$sel:code:ClientVpnEndpointAttributeStatus' :: Maybe ClientVpnEndpointAttributeStatusCode
code = Maybe ClientVpnEndpointAttributeStatusCode
a} :: ClientVpnEndpointAttributeStatus)

-- | The status message.
clientVpnEndpointAttributeStatus_message :: Lens.Lens' ClientVpnEndpointAttributeStatus (Prelude.Maybe Prelude.Text)
clientVpnEndpointAttributeStatus_message :: Lens' ClientVpnEndpointAttributeStatus (Maybe Text)
clientVpnEndpointAttributeStatus_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientVpnEndpointAttributeStatus' {Maybe Text
message :: Maybe Text
$sel:message:ClientVpnEndpointAttributeStatus' :: ClientVpnEndpointAttributeStatus -> Maybe Text
message} -> Maybe Text
message) (\s :: ClientVpnEndpointAttributeStatus
s@ClientVpnEndpointAttributeStatus' {} Maybe Text
a -> ClientVpnEndpointAttributeStatus
s {$sel:message:ClientVpnEndpointAttributeStatus' :: Maybe Text
message = Maybe Text
a} :: ClientVpnEndpointAttributeStatus)

instance
  Data.FromXML
    ClientVpnEndpointAttributeStatus
  where
  parseXML :: [Node] -> Either String ClientVpnEndpointAttributeStatus
parseXML [Node]
x =
    Maybe ClientVpnEndpointAttributeStatusCode
-> Maybe Text -> ClientVpnEndpointAttributeStatus
ClientVpnEndpointAttributeStatus'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"code")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"message")

instance
  Prelude.Hashable
    ClientVpnEndpointAttributeStatus
  where
  hashWithSalt :: Int -> ClientVpnEndpointAttributeStatus -> Int
hashWithSalt
    Int
_salt
    ClientVpnEndpointAttributeStatus' {Maybe Text
Maybe ClientVpnEndpointAttributeStatusCode
message :: Maybe Text
code :: Maybe ClientVpnEndpointAttributeStatusCode
$sel:message:ClientVpnEndpointAttributeStatus' :: ClientVpnEndpointAttributeStatus -> Maybe Text
$sel:code:ClientVpnEndpointAttributeStatus' :: ClientVpnEndpointAttributeStatus
-> Maybe ClientVpnEndpointAttributeStatusCode
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ClientVpnEndpointAttributeStatusCode
code
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message

instance
  Prelude.NFData
    ClientVpnEndpointAttributeStatus
  where
  rnf :: ClientVpnEndpointAttributeStatus -> ()
rnf ClientVpnEndpointAttributeStatus' {Maybe Text
Maybe ClientVpnEndpointAttributeStatusCode
message :: Maybe Text
code :: Maybe ClientVpnEndpointAttributeStatusCode
$sel:message:ClientVpnEndpointAttributeStatus' :: ClientVpnEndpointAttributeStatus -> Maybe Text
$sel:code:ClientVpnEndpointAttributeStatus' :: ClientVpnEndpointAttributeStatus
-> Maybe ClientVpnEndpointAttributeStatusCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ClientVpnEndpointAttributeStatusCode
code seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message