{-# 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.Config.Types.DeliveryChannelStatus
-- 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.Config.Types.DeliveryChannelStatus where

import Amazonka.Config.Types.ConfigExportDeliveryInfo
import Amazonka.Config.Types.ConfigStreamDeliveryInfo
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The status of a specified delivery channel.
--
-- Valid values: @Success@ | @Failure@
--
-- /See:/ 'newDeliveryChannelStatus' smart constructor.
data DeliveryChannelStatus = DeliveryChannelStatus'
  { -- | A list that contains the status of the delivery of the configuration
    -- history to the specified Amazon S3 bucket.
    DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo :: Prelude.Maybe ConfigExportDeliveryInfo,
    -- | A list containing the status of the delivery of the snapshot to the
    -- specified Amazon S3 bucket.
    DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo :: Prelude.Maybe ConfigExportDeliveryInfo,
    -- | A list containing the status of the delivery of the configuration stream
    -- notification to the specified Amazon SNS topic.
    DeliveryChannelStatus -> Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo :: Prelude.Maybe ConfigStreamDeliveryInfo,
    -- | The name of the delivery channel.
    DeliveryChannelStatus -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (DeliveryChannelStatus -> DeliveryChannelStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeliveryChannelStatus -> DeliveryChannelStatus -> Bool
$c/= :: DeliveryChannelStatus -> DeliveryChannelStatus -> Bool
== :: DeliveryChannelStatus -> DeliveryChannelStatus -> Bool
$c== :: DeliveryChannelStatus -> DeliveryChannelStatus -> Bool
Prelude.Eq, ReadPrec [DeliveryChannelStatus]
ReadPrec DeliveryChannelStatus
Int -> ReadS DeliveryChannelStatus
ReadS [DeliveryChannelStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeliveryChannelStatus]
$creadListPrec :: ReadPrec [DeliveryChannelStatus]
readPrec :: ReadPrec DeliveryChannelStatus
$creadPrec :: ReadPrec DeliveryChannelStatus
readList :: ReadS [DeliveryChannelStatus]
$creadList :: ReadS [DeliveryChannelStatus]
readsPrec :: Int -> ReadS DeliveryChannelStatus
$creadsPrec :: Int -> ReadS DeliveryChannelStatus
Prelude.Read, Int -> DeliveryChannelStatus -> ShowS
[DeliveryChannelStatus] -> ShowS
DeliveryChannelStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeliveryChannelStatus] -> ShowS
$cshowList :: [DeliveryChannelStatus] -> ShowS
show :: DeliveryChannelStatus -> String
$cshow :: DeliveryChannelStatus -> String
showsPrec :: Int -> DeliveryChannelStatus -> ShowS
$cshowsPrec :: Int -> DeliveryChannelStatus -> ShowS
Prelude.Show, forall x. Rep DeliveryChannelStatus x -> DeliveryChannelStatus
forall x. DeliveryChannelStatus -> Rep DeliveryChannelStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeliveryChannelStatus x -> DeliveryChannelStatus
$cfrom :: forall x. DeliveryChannelStatus -> Rep DeliveryChannelStatus x
Prelude.Generic)

-- |
-- Create a value of 'DeliveryChannelStatus' 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:
--
-- 'configHistoryDeliveryInfo', 'deliveryChannelStatus_configHistoryDeliveryInfo' - A list that contains the status of the delivery of the configuration
-- history to the specified Amazon S3 bucket.
--
-- 'configSnapshotDeliveryInfo', 'deliveryChannelStatus_configSnapshotDeliveryInfo' - A list containing the status of the delivery of the snapshot to the
-- specified Amazon S3 bucket.
--
-- 'configStreamDeliveryInfo', 'deliveryChannelStatus_configStreamDeliveryInfo' - A list containing the status of the delivery of the configuration stream
-- notification to the specified Amazon SNS topic.
--
-- 'name', 'deliveryChannelStatus_name' - The name of the delivery channel.
newDeliveryChannelStatus ::
  DeliveryChannelStatus
newDeliveryChannelStatus :: DeliveryChannelStatus
newDeliveryChannelStatus =
  DeliveryChannelStatus'
    { $sel:configHistoryDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo =
        forall a. Maybe a
Prelude.Nothing,
      $sel:configSnapshotDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:configStreamDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DeliveryChannelStatus' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | A list that contains the status of the delivery of the configuration
-- history to the specified Amazon S3 bucket.
deliveryChannelStatus_configHistoryDeliveryInfo :: Lens.Lens' DeliveryChannelStatus (Prelude.Maybe ConfigExportDeliveryInfo)
deliveryChannelStatus_configHistoryDeliveryInfo :: Lens' DeliveryChannelStatus (Maybe ConfigExportDeliveryInfo)
deliveryChannelStatus_configHistoryDeliveryInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryChannelStatus' {Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo :: Maybe ConfigExportDeliveryInfo
$sel:configHistoryDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo} -> Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo) (\s :: DeliveryChannelStatus
s@DeliveryChannelStatus' {} Maybe ConfigExportDeliveryInfo
a -> DeliveryChannelStatus
s {$sel:configHistoryDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo = Maybe ConfigExportDeliveryInfo
a} :: DeliveryChannelStatus)

-- | A list containing the status of the delivery of the snapshot to the
-- specified Amazon S3 bucket.
deliveryChannelStatus_configSnapshotDeliveryInfo :: Lens.Lens' DeliveryChannelStatus (Prelude.Maybe ConfigExportDeliveryInfo)
deliveryChannelStatus_configSnapshotDeliveryInfo :: Lens' DeliveryChannelStatus (Maybe ConfigExportDeliveryInfo)
deliveryChannelStatus_configSnapshotDeliveryInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryChannelStatus' {Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo :: Maybe ConfigExportDeliveryInfo
$sel:configSnapshotDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo} -> Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo) (\s :: DeliveryChannelStatus
s@DeliveryChannelStatus' {} Maybe ConfigExportDeliveryInfo
a -> DeliveryChannelStatus
s {$sel:configSnapshotDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo = Maybe ConfigExportDeliveryInfo
a} :: DeliveryChannelStatus)

-- | A list containing the status of the delivery of the configuration stream
-- notification to the specified Amazon SNS topic.
deliveryChannelStatus_configStreamDeliveryInfo :: Lens.Lens' DeliveryChannelStatus (Prelude.Maybe ConfigStreamDeliveryInfo)
deliveryChannelStatus_configStreamDeliveryInfo :: Lens' DeliveryChannelStatus (Maybe ConfigStreamDeliveryInfo)
deliveryChannelStatus_configStreamDeliveryInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryChannelStatus' {Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo :: Maybe ConfigStreamDeliveryInfo
$sel:configStreamDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo} -> Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo) (\s :: DeliveryChannelStatus
s@DeliveryChannelStatus' {} Maybe ConfigStreamDeliveryInfo
a -> DeliveryChannelStatus
s {$sel:configStreamDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo = Maybe ConfigStreamDeliveryInfo
a} :: DeliveryChannelStatus)

-- | The name of the delivery channel.
deliveryChannelStatus_name :: Lens.Lens' DeliveryChannelStatus (Prelude.Maybe Prelude.Text)
deliveryChannelStatus_name :: Lens' DeliveryChannelStatus (Maybe Text)
deliveryChannelStatus_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryChannelStatus' {Maybe Text
name :: Maybe Text
$sel:name:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe Text
name} -> Maybe Text
name) (\s :: DeliveryChannelStatus
s@DeliveryChannelStatus' {} Maybe Text
a -> DeliveryChannelStatus
s {$sel:name:DeliveryChannelStatus' :: Maybe Text
name = Maybe Text
a} :: DeliveryChannelStatus)

instance Data.FromJSON DeliveryChannelStatus where
  parseJSON :: Value -> Parser DeliveryChannelStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DeliveryChannelStatus"
      ( \Object
x ->
          Maybe ConfigExportDeliveryInfo
-> Maybe ConfigExportDeliveryInfo
-> Maybe ConfigStreamDeliveryInfo
-> Maybe Text
-> DeliveryChannelStatus
DeliveryChannelStatus'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"configHistoryDeliveryInfo")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"configSnapshotDeliveryInfo")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"configStreamDeliveryInfo")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
      )

instance Prelude.Hashable DeliveryChannelStatus where
  hashWithSalt :: Int -> DeliveryChannelStatus -> Int
hashWithSalt Int
_salt DeliveryChannelStatus' {Maybe Text
Maybe ConfigStreamDeliveryInfo
Maybe ConfigExportDeliveryInfo
name :: Maybe Text
configStreamDeliveryInfo :: Maybe ConfigStreamDeliveryInfo
configSnapshotDeliveryInfo :: Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo :: Maybe ConfigExportDeliveryInfo
$sel:name:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe Text
$sel:configStreamDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigStreamDeliveryInfo
$sel:configSnapshotDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
$sel:configHistoryDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData DeliveryChannelStatus where
  rnf :: DeliveryChannelStatus -> ()
rnf DeliveryChannelStatus' {Maybe Text
Maybe ConfigStreamDeliveryInfo
Maybe ConfigExportDeliveryInfo
name :: Maybe Text
configStreamDeliveryInfo :: Maybe ConfigStreamDeliveryInfo
configSnapshotDeliveryInfo :: Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo :: Maybe ConfigExportDeliveryInfo
$sel:name:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe Text
$sel:configStreamDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigStreamDeliveryInfo
$sel:configSnapshotDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
$sel:configHistoryDeliveryInfo:DeliveryChannelStatus' :: DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name