{-# 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.Firehose.Types.DeliveryStreamDescription
-- 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.Firehose.Types.DeliveryStreamDescription where

import qualified Amazonka.Core as Core
import Amazonka.Firehose.Types.DeliveryStreamEncryptionConfiguration
import Amazonka.Firehose.Types.DeliveryStreamStatus
import Amazonka.Firehose.Types.DeliveryStreamType
import Amazonka.Firehose.Types.DestinationDescription
import Amazonka.Firehose.Types.FailureDescription
import Amazonka.Firehose.Types.SourceDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a delivery stream.
--
-- /See:/ 'newDeliveryStreamDescription' smart constructor.
data DeliveryStreamDescription = DeliveryStreamDescription'
  { -- | Provides details in case one of the following operations fails due to an
    -- error related to KMS: CreateDeliveryStream, DeleteDeliveryStream,
    -- StartDeliveryStreamEncryption, StopDeliveryStreamEncryption.
    DeliveryStreamDescription -> Maybe FailureDescription
failureDescription :: Prelude.Maybe FailureDescription,
    -- | Indicates the server-side encryption (SSE) status for the delivery
    -- stream.
    DeliveryStreamDescription
-> Maybe DeliveryStreamEncryptionConfiguration
deliveryStreamEncryptionConfiguration :: Prelude.Maybe DeliveryStreamEncryptionConfiguration,
    -- | The date and time that the delivery stream was created.
    DeliveryStreamDescription -> Maybe POSIX
createTimestamp :: Prelude.Maybe Core.POSIX,
    -- | If the @DeliveryStreamType@ parameter is @KinesisStreamAsSource@, a
    -- SourceDescription object describing the source Kinesis data stream.
    DeliveryStreamDescription -> Maybe SourceDescription
source :: Prelude.Maybe SourceDescription,
    -- | The date and time that the delivery stream was last updated.
    DeliveryStreamDescription -> Maybe POSIX
lastUpdateTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The name of the delivery stream.
    DeliveryStreamDescription -> Text
deliveryStreamName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the delivery stream. For more
    -- information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
    DeliveryStreamDescription -> Text
deliveryStreamARN :: Prelude.Text,
    -- | The status of the delivery stream. If the status of a delivery stream is
    -- @CREATING_FAILED@, this status doesn\'t change, and you can\'t invoke
    -- @CreateDeliveryStream@ again on it. However, you can invoke the
    -- DeleteDeliveryStream operation to delete it.
    DeliveryStreamDescription -> DeliveryStreamStatus
deliveryStreamStatus :: DeliveryStreamStatus,
    -- | The delivery stream type. This can be one of the following values:
    --
    -- -   @DirectPut@: Provider applications access the delivery stream
    --     directly.
    --
    -- -   @KinesisStreamAsSource@: The delivery stream uses a Kinesis data
    --     stream as a source.
    DeliveryStreamDescription -> DeliveryStreamType
deliveryStreamType :: DeliveryStreamType,
    -- | Each time the destination is updated for a delivery stream, the version
    -- ID is changed, and the current version ID is required when updating the
    -- destination. This is so that the service knows it is applying the
    -- changes to the correct version of the delivery stream.
    DeliveryStreamDescription -> Text
versionId :: Prelude.Text,
    -- | The destinations.
    DeliveryStreamDescription -> [DestinationDescription]
destinations :: [DestinationDescription],
    -- | Indicates whether there are more destinations available to list.
    DeliveryStreamDescription -> Bool
hasMoreDestinations :: Prelude.Bool
  }
  deriving (DeliveryStreamDescription -> DeliveryStreamDescription -> Bool
(DeliveryStreamDescription -> DeliveryStreamDescription -> Bool)
-> (DeliveryStreamDescription -> DeliveryStreamDescription -> Bool)
-> Eq DeliveryStreamDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeliveryStreamDescription -> DeliveryStreamDescription -> Bool
$c/= :: DeliveryStreamDescription -> DeliveryStreamDescription -> Bool
== :: DeliveryStreamDescription -> DeliveryStreamDescription -> Bool
$c== :: DeliveryStreamDescription -> DeliveryStreamDescription -> Bool
Prelude.Eq, Int -> DeliveryStreamDescription -> ShowS
[DeliveryStreamDescription] -> ShowS
DeliveryStreamDescription -> String
(Int -> DeliveryStreamDescription -> ShowS)
-> (DeliveryStreamDescription -> String)
-> ([DeliveryStreamDescription] -> ShowS)
-> Show DeliveryStreamDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeliveryStreamDescription] -> ShowS
$cshowList :: [DeliveryStreamDescription] -> ShowS
show :: DeliveryStreamDescription -> String
$cshow :: DeliveryStreamDescription -> String
showsPrec :: Int -> DeliveryStreamDescription -> ShowS
$cshowsPrec :: Int -> DeliveryStreamDescription -> ShowS
Prelude.Show, (forall x.
 DeliveryStreamDescription -> Rep DeliveryStreamDescription x)
-> (forall x.
    Rep DeliveryStreamDescription x -> DeliveryStreamDescription)
-> Generic DeliveryStreamDescription
forall x.
Rep DeliveryStreamDescription x -> DeliveryStreamDescription
forall x.
DeliveryStreamDescription -> Rep DeliveryStreamDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeliveryStreamDescription x -> DeliveryStreamDescription
$cfrom :: forall x.
DeliveryStreamDescription -> Rep DeliveryStreamDescription x
Prelude.Generic)

-- |
-- Create a value of 'DeliveryStreamDescription' 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:
--
-- 'failureDescription', 'deliveryStreamDescription_failureDescription' - Provides details in case one of the following operations fails due to an
-- error related to KMS: CreateDeliveryStream, DeleteDeliveryStream,
-- StartDeliveryStreamEncryption, StopDeliveryStreamEncryption.
--
-- 'deliveryStreamEncryptionConfiguration', 'deliveryStreamDescription_deliveryStreamEncryptionConfiguration' - Indicates the server-side encryption (SSE) status for the delivery
-- stream.
--
-- 'createTimestamp', 'deliveryStreamDescription_createTimestamp' - The date and time that the delivery stream was created.
--
-- 'source', 'deliveryStreamDescription_source' - If the @DeliveryStreamType@ parameter is @KinesisStreamAsSource@, a
-- SourceDescription object describing the source Kinesis data stream.
--
-- 'lastUpdateTimestamp', 'deliveryStreamDescription_lastUpdateTimestamp' - The date and time that the delivery stream was last updated.
--
-- 'deliveryStreamName', 'deliveryStreamDescription_deliveryStreamName' - The name of the delivery stream.
--
-- 'deliveryStreamARN', 'deliveryStreamDescription_deliveryStreamARN' - The Amazon Resource Name (ARN) of the delivery stream. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
--
-- 'deliveryStreamStatus', 'deliveryStreamDescription_deliveryStreamStatus' - The status of the delivery stream. If the status of a delivery stream is
-- @CREATING_FAILED@, this status doesn\'t change, and you can\'t invoke
-- @CreateDeliveryStream@ again on it. However, you can invoke the
-- DeleteDeliveryStream operation to delete it.
--
-- 'deliveryStreamType', 'deliveryStreamDescription_deliveryStreamType' - The delivery stream type. This can be one of the following values:
--
-- -   @DirectPut@: Provider applications access the delivery stream
--     directly.
--
-- -   @KinesisStreamAsSource@: The delivery stream uses a Kinesis data
--     stream as a source.
--
-- 'versionId', 'deliveryStreamDescription_versionId' - Each time the destination is updated for a delivery stream, the version
-- ID is changed, and the current version ID is required when updating the
-- destination. This is so that the service knows it is applying the
-- changes to the correct version of the delivery stream.
--
-- 'destinations', 'deliveryStreamDescription_destinations' - The destinations.
--
-- 'hasMoreDestinations', 'deliveryStreamDescription_hasMoreDestinations' - Indicates whether there are more destinations available to list.
newDeliveryStreamDescription ::
  -- | 'deliveryStreamName'
  Prelude.Text ->
  -- | 'deliveryStreamARN'
  Prelude.Text ->
  -- | 'deliveryStreamStatus'
  DeliveryStreamStatus ->
  -- | 'deliveryStreamType'
  DeliveryStreamType ->
  -- | 'versionId'
  Prelude.Text ->
  -- | 'hasMoreDestinations'
  Prelude.Bool ->
  DeliveryStreamDescription
newDeliveryStreamDescription :: Text
-> Text
-> DeliveryStreamStatus
-> DeliveryStreamType
-> Text
-> Bool
-> DeliveryStreamDescription
newDeliveryStreamDescription
  Text
pDeliveryStreamName_
  Text
pDeliveryStreamARN_
  DeliveryStreamStatus
pDeliveryStreamStatus_
  DeliveryStreamType
pDeliveryStreamType_
  Text
pVersionId_
  Bool
pHasMoreDestinations_ =
    DeliveryStreamDescription' :: Maybe FailureDescription
-> Maybe DeliveryStreamEncryptionConfiguration
-> Maybe POSIX
-> Maybe SourceDescription
-> Maybe POSIX
-> Text
-> Text
-> DeliveryStreamStatus
-> DeliveryStreamType
-> Text
-> [DestinationDescription]
-> Bool
-> DeliveryStreamDescription
DeliveryStreamDescription'
      { $sel:failureDescription:DeliveryStreamDescription' :: Maybe FailureDescription
failureDescription =
          Maybe FailureDescription
forall a. Maybe a
Prelude.Nothing,
        $sel:deliveryStreamEncryptionConfiguration:DeliveryStreamDescription' :: Maybe DeliveryStreamEncryptionConfiguration
deliveryStreamEncryptionConfiguration =
          Maybe DeliveryStreamEncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:createTimestamp:DeliveryStreamDescription' :: Maybe POSIX
createTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:source:DeliveryStreamDescription' :: Maybe SourceDescription
source = Maybe SourceDescription
forall a. Maybe a
Prelude.Nothing,
        $sel:lastUpdateTimestamp:DeliveryStreamDescription' :: Maybe POSIX
lastUpdateTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:deliveryStreamName:DeliveryStreamDescription' :: Text
deliveryStreamName = Text
pDeliveryStreamName_,
        $sel:deliveryStreamARN:DeliveryStreamDescription' :: Text
deliveryStreamARN = Text
pDeliveryStreamARN_,
        $sel:deliveryStreamStatus:DeliveryStreamDescription' :: DeliveryStreamStatus
deliveryStreamStatus = DeliveryStreamStatus
pDeliveryStreamStatus_,
        $sel:deliveryStreamType:DeliveryStreamDescription' :: DeliveryStreamType
deliveryStreamType = DeliveryStreamType
pDeliveryStreamType_,
        $sel:versionId:DeliveryStreamDescription' :: Text
versionId = Text
pVersionId_,
        $sel:destinations:DeliveryStreamDescription' :: [DestinationDescription]
destinations = [DestinationDescription]
forall a. Monoid a => a
Prelude.mempty,
        $sel:hasMoreDestinations:DeliveryStreamDescription' :: Bool
hasMoreDestinations = Bool
pHasMoreDestinations_
      }

-- | Provides details in case one of the following operations fails due to an
-- error related to KMS: CreateDeliveryStream, DeleteDeliveryStream,
-- StartDeliveryStreamEncryption, StopDeliveryStreamEncryption.
deliveryStreamDescription_failureDescription :: Lens.Lens' DeliveryStreamDescription (Prelude.Maybe FailureDescription)
deliveryStreamDescription_failureDescription :: (Maybe FailureDescription -> f (Maybe FailureDescription))
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_failureDescription = (DeliveryStreamDescription -> Maybe FailureDescription)
-> (DeliveryStreamDescription
    -> Maybe FailureDescription -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     (Maybe FailureDescription)
     (Maybe FailureDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Maybe FailureDescription
failureDescription :: Maybe FailureDescription
$sel:failureDescription:DeliveryStreamDescription' :: DeliveryStreamDescription -> Maybe FailureDescription
failureDescription} -> Maybe FailureDescription
failureDescription) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Maybe FailureDescription
a -> DeliveryStreamDescription
s {$sel:failureDescription:DeliveryStreamDescription' :: Maybe FailureDescription
failureDescription = Maybe FailureDescription
a} :: DeliveryStreamDescription)

-- | Indicates the server-side encryption (SSE) status for the delivery
-- stream.
deliveryStreamDescription_deliveryStreamEncryptionConfiguration :: Lens.Lens' DeliveryStreamDescription (Prelude.Maybe DeliveryStreamEncryptionConfiguration)
deliveryStreamDescription_deliveryStreamEncryptionConfiguration :: (Maybe DeliveryStreamEncryptionConfiguration
 -> f (Maybe DeliveryStreamEncryptionConfiguration))
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_deliveryStreamEncryptionConfiguration = (DeliveryStreamDescription
 -> Maybe DeliveryStreamEncryptionConfiguration)
-> (DeliveryStreamDescription
    -> Maybe DeliveryStreamEncryptionConfiguration
    -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     (Maybe DeliveryStreamEncryptionConfiguration)
     (Maybe DeliveryStreamEncryptionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Maybe DeliveryStreamEncryptionConfiguration
deliveryStreamEncryptionConfiguration :: Maybe DeliveryStreamEncryptionConfiguration
$sel:deliveryStreamEncryptionConfiguration:DeliveryStreamDescription' :: DeliveryStreamDescription
-> Maybe DeliveryStreamEncryptionConfiguration
deliveryStreamEncryptionConfiguration} -> Maybe DeliveryStreamEncryptionConfiguration
deliveryStreamEncryptionConfiguration) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Maybe DeliveryStreamEncryptionConfiguration
a -> DeliveryStreamDescription
s {$sel:deliveryStreamEncryptionConfiguration:DeliveryStreamDescription' :: Maybe DeliveryStreamEncryptionConfiguration
deliveryStreamEncryptionConfiguration = Maybe DeliveryStreamEncryptionConfiguration
a} :: DeliveryStreamDescription)

-- | The date and time that the delivery stream was created.
deliveryStreamDescription_createTimestamp :: Lens.Lens' DeliveryStreamDescription (Prelude.Maybe Prelude.UTCTime)
deliveryStreamDescription_createTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_createTimestamp = (DeliveryStreamDescription -> Maybe POSIX)
-> (DeliveryStreamDescription
    -> Maybe POSIX -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Maybe POSIX
createTimestamp :: Maybe POSIX
$sel:createTimestamp:DeliveryStreamDescription' :: DeliveryStreamDescription -> Maybe POSIX
createTimestamp} -> Maybe POSIX
createTimestamp) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Maybe POSIX
a -> DeliveryStreamDescription
s {$sel:createTimestamp:DeliveryStreamDescription' :: Maybe POSIX
createTimestamp = Maybe POSIX
a} :: DeliveryStreamDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> DeliveryStreamDescription -> f DeliveryStreamDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DeliveryStreamDescription
-> f DeliveryStreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | If the @DeliveryStreamType@ parameter is @KinesisStreamAsSource@, a
-- SourceDescription object describing the source Kinesis data stream.
deliveryStreamDescription_source :: Lens.Lens' DeliveryStreamDescription (Prelude.Maybe SourceDescription)
deliveryStreamDescription_source :: (Maybe SourceDescription -> f (Maybe SourceDescription))
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_source = (DeliveryStreamDescription -> Maybe SourceDescription)
-> (DeliveryStreamDescription
    -> Maybe SourceDescription -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     (Maybe SourceDescription)
     (Maybe SourceDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Maybe SourceDescription
source :: Maybe SourceDescription
$sel:source:DeliveryStreamDescription' :: DeliveryStreamDescription -> Maybe SourceDescription
source} -> Maybe SourceDescription
source) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Maybe SourceDescription
a -> DeliveryStreamDescription
s {$sel:source:DeliveryStreamDescription' :: Maybe SourceDescription
source = Maybe SourceDescription
a} :: DeliveryStreamDescription)

-- | The date and time that the delivery stream was last updated.
deliveryStreamDescription_lastUpdateTimestamp :: Lens.Lens' DeliveryStreamDescription (Prelude.Maybe Prelude.UTCTime)
deliveryStreamDescription_lastUpdateTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_lastUpdateTimestamp = (DeliveryStreamDescription -> Maybe POSIX)
-> (DeliveryStreamDescription
    -> Maybe POSIX -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Maybe POSIX
lastUpdateTimestamp :: Maybe POSIX
$sel:lastUpdateTimestamp:DeliveryStreamDescription' :: DeliveryStreamDescription -> Maybe POSIX
lastUpdateTimestamp} -> Maybe POSIX
lastUpdateTimestamp) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Maybe POSIX
a -> DeliveryStreamDescription
s {$sel:lastUpdateTimestamp:DeliveryStreamDescription' :: Maybe POSIX
lastUpdateTimestamp = Maybe POSIX
a} :: DeliveryStreamDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> DeliveryStreamDescription -> f DeliveryStreamDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DeliveryStreamDescription
-> f DeliveryStreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the delivery stream.
deliveryStreamDescription_deliveryStreamName :: Lens.Lens' DeliveryStreamDescription Prelude.Text
deliveryStreamDescription_deliveryStreamName :: (Text -> f Text)
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_deliveryStreamName = (DeliveryStreamDescription -> Text)
-> (DeliveryStreamDescription -> Text -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription DeliveryStreamDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Text
deliveryStreamName :: Text
$sel:deliveryStreamName:DeliveryStreamDescription' :: DeliveryStreamDescription -> Text
deliveryStreamName} -> Text
deliveryStreamName) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Text
a -> DeliveryStreamDescription
s {$sel:deliveryStreamName:DeliveryStreamDescription' :: Text
deliveryStreamName = Text
a} :: DeliveryStreamDescription)

-- | The Amazon Resource Name (ARN) of the delivery stream. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
deliveryStreamDescription_deliveryStreamARN :: Lens.Lens' DeliveryStreamDescription Prelude.Text
deliveryStreamDescription_deliveryStreamARN :: (Text -> f Text)
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_deliveryStreamARN = (DeliveryStreamDescription -> Text)
-> (DeliveryStreamDescription -> Text -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription DeliveryStreamDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Text
deliveryStreamARN :: Text
$sel:deliveryStreamARN:DeliveryStreamDescription' :: DeliveryStreamDescription -> Text
deliveryStreamARN} -> Text
deliveryStreamARN) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Text
a -> DeliveryStreamDescription
s {$sel:deliveryStreamARN:DeliveryStreamDescription' :: Text
deliveryStreamARN = Text
a} :: DeliveryStreamDescription)

-- | The status of the delivery stream. If the status of a delivery stream is
-- @CREATING_FAILED@, this status doesn\'t change, and you can\'t invoke
-- @CreateDeliveryStream@ again on it. However, you can invoke the
-- DeleteDeliveryStream operation to delete it.
deliveryStreamDescription_deliveryStreamStatus :: Lens.Lens' DeliveryStreamDescription DeliveryStreamStatus
deliveryStreamDescription_deliveryStreamStatus :: (DeliveryStreamStatus -> f DeliveryStreamStatus)
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_deliveryStreamStatus = (DeliveryStreamDescription -> DeliveryStreamStatus)
-> (DeliveryStreamDescription
    -> DeliveryStreamStatus -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     DeliveryStreamStatus
     DeliveryStreamStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {DeliveryStreamStatus
deliveryStreamStatus :: DeliveryStreamStatus
$sel:deliveryStreamStatus:DeliveryStreamDescription' :: DeliveryStreamDescription -> DeliveryStreamStatus
deliveryStreamStatus} -> DeliveryStreamStatus
deliveryStreamStatus) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} DeliveryStreamStatus
a -> DeliveryStreamDescription
s {$sel:deliveryStreamStatus:DeliveryStreamDescription' :: DeliveryStreamStatus
deliveryStreamStatus = DeliveryStreamStatus
a} :: DeliveryStreamDescription)

-- | The delivery stream type. This can be one of the following values:
--
-- -   @DirectPut@: Provider applications access the delivery stream
--     directly.
--
-- -   @KinesisStreamAsSource@: The delivery stream uses a Kinesis data
--     stream as a source.
deliveryStreamDescription_deliveryStreamType :: Lens.Lens' DeliveryStreamDescription DeliveryStreamType
deliveryStreamDescription_deliveryStreamType :: (DeliveryStreamType -> f DeliveryStreamType)
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_deliveryStreamType = (DeliveryStreamDescription -> DeliveryStreamType)
-> (DeliveryStreamDescription
    -> DeliveryStreamType -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     DeliveryStreamType
     DeliveryStreamType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {DeliveryStreamType
deliveryStreamType :: DeliveryStreamType
$sel:deliveryStreamType:DeliveryStreamDescription' :: DeliveryStreamDescription -> DeliveryStreamType
deliveryStreamType} -> DeliveryStreamType
deliveryStreamType) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} DeliveryStreamType
a -> DeliveryStreamDescription
s {$sel:deliveryStreamType:DeliveryStreamDescription' :: DeliveryStreamType
deliveryStreamType = DeliveryStreamType
a} :: DeliveryStreamDescription)

-- | Each time the destination is updated for a delivery stream, the version
-- ID is changed, and the current version ID is required when updating the
-- destination. This is so that the service knows it is applying the
-- changes to the correct version of the delivery stream.
deliveryStreamDescription_versionId :: Lens.Lens' DeliveryStreamDescription Prelude.Text
deliveryStreamDescription_versionId :: (Text -> f Text)
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_versionId = (DeliveryStreamDescription -> Text)
-> (DeliveryStreamDescription -> Text -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription DeliveryStreamDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Text
versionId :: Text
$sel:versionId:DeliveryStreamDescription' :: DeliveryStreamDescription -> Text
versionId} -> Text
versionId) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Text
a -> DeliveryStreamDescription
s {$sel:versionId:DeliveryStreamDescription' :: Text
versionId = Text
a} :: DeliveryStreamDescription)

-- | The destinations.
deliveryStreamDescription_destinations :: Lens.Lens' DeliveryStreamDescription [DestinationDescription]
deliveryStreamDescription_destinations :: ([DestinationDescription] -> f [DestinationDescription])
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_destinations = (DeliveryStreamDescription -> [DestinationDescription])
-> (DeliveryStreamDescription
    -> [DestinationDescription] -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription
     DeliveryStreamDescription
     [DestinationDescription]
     [DestinationDescription]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {[DestinationDescription]
destinations :: [DestinationDescription]
$sel:destinations:DeliveryStreamDescription' :: DeliveryStreamDescription -> [DestinationDescription]
destinations} -> [DestinationDescription]
destinations) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} [DestinationDescription]
a -> DeliveryStreamDescription
s {$sel:destinations:DeliveryStreamDescription' :: [DestinationDescription]
destinations = [DestinationDescription]
a} :: DeliveryStreamDescription) (([DestinationDescription] -> f [DestinationDescription])
 -> DeliveryStreamDescription -> f DeliveryStreamDescription)
-> (([DestinationDescription] -> f [DestinationDescription])
    -> [DestinationDescription] -> f [DestinationDescription])
-> ([DestinationDescription] -> f [DestinationDescription])
-> DeliveryStreamDescription
-> f DeliveryStreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DestinationDescription] -> f [DestinationDescription])
-> [DestinationDescription] -> f [DestinationDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether there are more destinations available to list.
deliveryStreamDescription_hasMoreDestinations :: Lens.Lens' DeliveryStreamDescription Prelude.Bool
deliveryStreamDescription_hasMoreDestinations :: (Bool -> f Bool)
-> DeliveryStreamDescription -> f DeliveryStreamDescription
deliveryStreamDescription_hasMoreDestinations = (DeliveryStreamDescription -> Bool)
-> (DeliveryStreamDescription -> Bool -> DeliveryStreamDescription)
-> Lens
     DeliveryStreamDescription DeliveryStreamDescription Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliveryStreamDescription' {Bool
hasMoreDestinations :: Bool
$sel:hasMoreDestinations:DeliveryStreamDescription' :: DeliveryStreamDescription -> Bool
hasMoreDestinations} -> Bool
hasMoreDestinations) (\s :: DeliveryStreamDescription
s@DeliveryStreamDescription' {} Bool
a -> DeliveryStreamDescription
s {$sel:hasMoreDestinations:DeliveryStreamDescription' :: Bool
hasMoreDestinations = Bool
a} :: DeliveryStreamDescription)

instance Core.FromJSON DeliveryStreamDescription where
  parseJSON :: Value -> Parser DeliveryStreamDescription
parseJSON =
    String
-> (Object -> Parser DeliveryStreamDescription)
-> Value
-> Parser DeliveryStreamDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DeliveryStreamDescription"
      ( \Object
x ->
          Maybe FailureDescription
-> Maybe DeliveryStreamEncryptionConfiguration
-> Maybe POSIX
-> Maybe SourceDescription
-> Maybe POSIX
-> Text
-> Text
-> DeliveryStreamStatus
-> DeliveryStreamType
-> Text
-> [DestinationDescription]
-> Bool
-> DeliveryStreamDescription
DeliveryStreamDescription'
            (Maybe FailureDescription
 -> Maybe DeliveryStreamEncryptionConfiguration
 -> Maybe POSIX
 -> Maybe SourceDescription
 -> Maybe POSIX
 -> Text
 -> Text
 -> DeliveryStreamStatus
 -> DeliveryStreamType
 -> Text
 -> [DestinationDescription]
 -> Bool
 -> DeliveryStreamDescription)
-> Parser (Maybe FailureDescription)
-> Parser
     (Maybe DeliveryStreamEncryptionConfiguration
      -> Maybe POSIX
      -> Maybe SourceDescription
      -> Maybe POSIX
      -> Text
      -> Text
      -> DeliveryStreamStatus
      -> DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FailureDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailureDescription")
            Parser
  (Maybe DeliveryStreamEncryptionConfiguration
   -> Maybe POSIX
   -> Maybe SourceDescription
   -> Maybe POSIX
   -> Text
   -> Text
   -> DeliveryStreamStatus
   -> DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser (Maybe DeliveryStreamEncryptionConfiguration)
-> Parser
     (Maybe POSIX
      -> Maybe SourceDescription
      -> Maybe POSIX
      -> Text
      -> Text
      -> DeliveryStreamStatus
      -> DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe DeliveryStreamEncryptionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeliveryStreamEncryptionConfiguration")
            Parser
  (Maybe POSIX
   -> Maybe SourceDescription
   -> Maybe POSIX
   -> Text
   -> Text
   -> DeliveryStreamStatus
   -> DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe SourceDescription
      -> Maybe POSIX
      -> Text
      -> Text
      -> DeliveryStreamStatus
      -> DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateTimestamp")
            Parser
  (Maybe SourceDescription
   -> Maybe POSIX
   -> Text
   -> Text
   -> DeliveryStreamStatus
   -> DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser (Maybe SourceDescription)
-> Parser
     (Maybe POSIX
      -> Text
      -> Text
      -> DeliveryStreamStatus
      -> DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SourceDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Source")
            Parser
  (Maybe POSIX
   -> Text
   -> Text
   -> DeliveryStreamStatus
   -> DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Text
      -> Text
      -> DeliveryStreamStatus
      -> DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdateTimestamp")
            Parser
  (Text
   -> Text
   -> DeliveryStreamStatus
   -> DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser Text
-> Parser
     (Text
      -> DeliveryStreamStatus
      -> DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DeliveryStreamName")
            Parser
  (Text
   -> DeliveryStreamStatus
   -> DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser Text
-> Parser
     (DeliveryStreamStatus
      -> DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DeliveryStreamARN")
            Parser
  (DeliveryStreamStatus
   -> DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser DeliveryStreamStatus
-> Parser
     (DeliveryStreamType
      -> Text
      -> [DestinationDescription]
      -> Bool
      -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeliveryStreamStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DeliveryStreamStatus")
            Parser
  (DeliveryStreamType
   -> Text
   -> [DestinationDescription]
   -> Bool
   -> DeliveryStreamDescription)
-> Parser DeliveryStreamType
-> Parser
     (Text
      -> [DestinationDescription] -> Bool -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeliveryStreamType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DeliveryStreamType")
            Parser
  (Text
   -> [DestinationDescription] -> Bool -> DeliveryStreamDescription)
-> Parser Text
-> Parser
     ([DestinationDescription] -> Bool -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VersionId")
            Parser
  ([DestinationDescription] -> Bool -> DeliveryStreamDescription)
-> Parser [DestinationDescription]
-> Parser (Bool -> DeliveryStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [DestinationDescription])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Destinations" Parser (Maybe [DestinationDescription])
-> [DestinationDescription] -> Parser [DestinationDescription]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [DestinationDescription]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Bool -> DeliveryStreamDescription)
-> Parser Bool -> Parser DeliveryStreamDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"HasMoreDestinations")
      )

instance Prelude.Hashable DeliveryStreamDescription

instance Prelude.NFData DeliveryStreamDescription