{-# 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.VerifiedAccessLogDeliveryStatus
-- 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.VerifiedAccessLogDeliveryStatus 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.VerifiedAccessLogDeliveryStatusCode
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'VerifiedAccessLogDeliveryStatus' 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', 'verifiedAccessLogDeliveryStatus_code' - The status code.
--
-- 'message', 'verifiedAccessLogDeliveryStatus_message' - The status message.
newVerifiedAccessLogDeliveryStatus ::
  VerifiedAccessLogDeliveryStatus
newVerifiedAccessLogDeliveryStatus :: VerifiedAccessLogDeliveryStatus
newVerifiedAccessLogDeliveryStatus =
  VerifiedAccessLogDeliveryStatus'
    { $sel:code:VerifiedAccessLogDeliveryStatus' :: Maybe VerifiedAccessLogDeliveryStatusCode
code =
        forall a. Maybe a
Prelude.Nothing,
      $sel:message:VerifiedAccessLogDeliveryStatus' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Data.FromXML VerifiedAccessLogDeliveryStatus where
  parseXML :: [Node] -> Either String VerifiedAccessLogDeliveryStatus
parseXML [Node]
x =
    Maybe VerifiedAccessLogDeliveryStatusCode
-> Maybe Text -> VerifiedAccessLogDeliveryStatus
VerifiedAccessLogDeliveryStatus'
      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
    VerifiedAccessLogDeliveryStatus
  where
  hashWithSalt :: Int -> VerifiedAccessLogDeliveryStatus -> Int
hashWithSalt
    Int
_salt
    VerifiedAccessLogDeliveryStatus' {Maybe Text
Maybe VerifiedAccessLogDeliveryStatusCode
message :: Maybe Text
code :: Maybe VerifiedAccessLogDeliveryStatusCode
$sel:message:VerifiedAccessLogDeliveryStatus' :: VerifiedAccessLogDeliveryStatus -> Maybe Text
$sel:code:VerifiedAccessLogDeliveryStatus' :: VerifiedAccessLogDeliveryStatus
-> Maybe VerifiedAccessLogDeliveryStatusCode
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessLogDeliveryStatusCode
code
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message

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