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

import Amazonka.Config.Types.ConfigExportDeliveryInfo
import Amazonka.Config.Types.ConfigStreamDeliveryInfo
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | 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,
    -- | The name of the delivery channel.
    DeliveryChannelStatus -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (DeliveryChannelStatus -> DeliveryChannelStatus -> Bool
(DeliveryChannelStatus -> DeliveryChannelStatus -> Bool)
-> (DeliveryChannelStatus -> DeliveryChannelStatus -> Bool)
-> Eq DeliveryChannelStatus
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]
(Int -> ReadS DeliveryChannelStatus)
-> ReadS [DeliveryChannelStatus]
-> ReadPrec DeliveryChannelStatus
-> ReadPrec [DeliveryChannelStatus]
-> Read 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
(Int -> DeliveryChannelStatus -> ShowS)
-> (DeliveryChannelStatus -> String)
-> ([DeliveryChannelStatus] -> ShowS)
-> Show DeliveryChannelStatus
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. DeliveryChannelStatus -> Rep DeliveryChannelStatus x)
-> (forall x. Rep DeliveryChannelStatus x -> DeliveryChannelStatus)
-> Generic DeliveryChannelStatus
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:
--
-- '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.
--
-- 'configHistoryDeliveryInfo', 'deliveryChannelStatus_configHistoryDeliveryInfo' - A list that contains the status of the delivery of the configuration
-- history to the specified Amazon S3 bucket.
--
-- 'name', 'deliveryChannelStatus_name' - The name of the delivery channel.
newDeliveryChannelStatus ::
  DeliveryChannelStatus
newDeliveryChannelStatus :: DeliveryChannelStatus
newDeliveryChannelStatus =
  DeliveryChannelStatus' :: Maybe ConfigExportDeliveryInfo
-> Maybe ConfigStreamDeliveryInfo
-> Maybe ConfigExportDeliveryInfo
-> Maybe Text
-> DeliveryChannelStatus
DeliveryChannelStatus'
    { $sel:configSnapshotDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigExportDeliveryInfo
configSnapshotDeliveryInfo =
        Maybe ConfigExportDeliveryInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:configStreamDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigStreamDeliveryInfo
configStreamDeliveryInfo = Maybe ConfigStreamDeliveryInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:configHistoryDeliveryInfo:DeliveryChannelStatus' :: Maybe ConfigExportDeliveryInfo
configHistoryDeliveryInfo = Maybe ConfigExportDeliveryInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DeliveryChannelStatus' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe ConfigExportDeliveryInfo
 -> f (Maybe ConfigExportDeliveryInfo))
-> DeliveryChannelStatus -> f DeliveryChannelStatus
deliveryChannelStatus_configSnapshotDeliveryInfo = (DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo)
-> (DeliveryChannelStatus
    -> Maybe ConfigExportDeliveryInfo -> DeliveryChannelStatus)
-> Lens
     DeliveryChannelStatus
     DeliveryChannelStatus
     (Maybe ConfigExportDeliveryInfo)
     (Maybe ConfigExportDeliveryInfo)
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 :: (Maybe ConfigStreamDeliveryInfo
 -> f (Maybe ConfigStreamDeliveryInfo))
-> DeliveryChannelStatus -> f DeliveryChannelStatus
deliveryChannelStatus_configStreamDeliveryInfo = (DeliveryChannelStatus -> Maybe ConfigStreamDeliveryInfo)
-> (DeliveryChannelStatus
    -> Maybe ConfigStreamDeliveryInfo -> DeliveryChannelStatus)
-> Lens
     DeliveryChannelStatus
     DeliveryChannelStatus
     (Maybe ConfigStreamDeliveryInfo)
     (Maybe 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)

-- | 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 :: (Maybe ConfigExportDeliveryInfo
 -> f (Maybe ConfigExportDeliveryInfo))
-> DeliveryChannelStatus -> f DeliveryChannelStatus
deliveryChannelStatus_configHistoryDeliveryInfo = (DeliveryChannelStatus -> Maybe ConfigExportDeliveryInfo)
-> (DeliveryChannelStatus
    -> Maybe ConfigExportDeliveryInfo -> DeliveryChannelStatus)
-> Lens
     DeliveryChannelStatus
     DeliveryChannelStatus
     (Maybe ConfigExportDeliveryInfo)
     (Maybe ConfigExportDeliveryInfo)
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)

-- | The name of the delivery channel.
deliveryChannelStatus_name :: Lens.Lens' DeliveryChannelStatus (Prelude.Maybe Prelude.Text)
deliveryChannelStatus_name :: (Maybe Text -> f (Maybe Text))
-> DeliveryChannelStatus -> f DeliveryChannelStatus
deliveryChannelStatus_name = (DeliveryChannelStatus -> Maybe Text)
-> (DeliveryChannelStatus -> Maybe Text -> DeliveryChannelStatus)
-> Lens
     DeliveryChannelStatus
     DeliveryChannelStatus
     (Maybe Text)
     (Maybe Text)
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 Core.FromJSON DeliveryChannelStatus where
  parseJSON :: Value -> Parser DeliveryChannelStatus
parseJSON =
    String
-> (Object -> Parser DeliveryChannelStatus)
-> Value
-> Parser DeliveryChannelStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DeliveryChannelStatus"
      ( \Object
x ->
          Maybe ConfigExportDeliveryInfo
-> Maybe ConfigStreamDeliveryInfo
-> Maybe ConfigExportDeliveryInfo
-> Maybe Text
-> DeliveryChannelStatus
DeliveryChannelStatus'
            (Maybe ConfigExportDeliveryInfo
 -> Maybe ConfigStreamDeliveryInfo
 -> Maybe ConfigExportDeliveryInfo
 -> Maybe Text
 -> DeliveryChannelStatus)
-> Parser (Maybe ConfigExportDeliveryInfo)
-> Parser
     (Maybe ConfigStreamDeliveryInfo
      -> Maybe ConfigExportDeliveryInfo
      -> Maybe Text
      -> DeliveryChannelStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ConfigExportDeliveryInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configSnapshotDeliveryInfo")
            Parser
  (Maybe ConfigStreamDeliveryInfo
   -> Maybe ConfigExportDeliveryInfo
   -> Maybe Text
   -> DeliveryChannelStatus)
-> Parser (Maybe ConfigStreamDeliveryInfo)
-> Parser
     (Maybe ConfigExportDeliveryInfo
      -> Maybe Text -> DeliveryChannelStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConfigStreamDeliveryInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configStreamDeliveryInfo")
            Parser
  (Maybe ConfigExportDeliveryInfo
   -> Maybe Text -> DeliveryChannelStatus)
-> Parser (Maybe ConfigExportDeliveryInfo)
-> Parser (Maybe Text -> DeliveryChannelStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConfigExportDeliveryInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configHistoryDeliveryInfo")
            Parser (Maybe Text -> DeliveryChannelStatus)
-> Parser (Maybe Text) -> Parser DeliveryChannelStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
      )

instance Prelude.Hashable DeliveryChannelStatus

instance Prelude.NFData DeliveryChannelStatus