{-# 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.KinesisStreamSourceDescription
-- 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.KinesisStreamSourceDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details about a Kinesis data stream used as the source for a Kinesis
-- Data Firehose delivery stream.
--
-- /See:/ 'newKinesisStreamSourceDescription' smart constructor.
data KinesisStreamSourceDescription = KinesisStreamSourceDescription'
  { -- | Kinesis Data Firehose starts retrieving records from the Kinesis data
    -- stream starting with this timestamp.
    KinesisStreamSourceDescription -> Maybe POSIX
deliveryStartTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the source Kinesis data stream. For
    -- more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams Amazon Kinesis Data Streams ARN Format>.
    KinesisStreamSourceDescription -> Maybe Text
kinesisStreamARN :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the role used by the source Kinesis data stream. For more
    -- information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam AWS Identity and Access Management (IAM) ARN Format>.
    KinesisStreamSourceDescription -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text
  }
  deriving (KinesisStreamSourceDescription
-> KinesisStreamSourceDescription -> Bool
(KinesisStreamSourceDescription
 -> KinesisStreamSourceDescription -> Bool)
-> (KinesisStreamSourceDescription
    -> KinesisStreamSourceDescription -> Bool)
-> Eq KinesisStreamSourceDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamSourceDescription
-> KinesisStreamSourceDescription -> Bool
$c/= :: KinesisStreamSourceDescription
-> KinesisStreamSourceDescription -> Bool
== :: KinesisStreamSourceDescription
-> KinesisStreamSourceDescription -> Bool
$c== :: KinesisStreamSourceDescription
-> KinesisStreamSourceDescription -> Bool
Prelude.Eq, ReadPrec [KinesisStreamSourceDescription]
ReadPrec KinesisStreamSourceDescription
Int -> ReadS KinesisStreamSourceDescription
ReadS [KinesisStreamSourceDescription]
(Int -> ReadS KinesisStreamSourceDescription)
-> ReadS [KinesisStreamSourceDescription]
-> ReadPrec KinesisStreamSourceDescription
-> ReadPrec [KinesisStreamSourceDescription]
-> Read KinesisStreamSourceDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamSourceDescription]
$creadListPrec :: ReadPrec [KinesisStreamSourceDescription]
readPrec :: ReadPrec KinesisStreamSourceDescription
$creadPrec :: ReadPrec KinesisStreamSourceDescription
readList :: ReadS [KinesisStreamSourceDescription]
$creadList :: ReadS [KinesisStreamSourceDescription]
readsPrec :: Int -> ReadS KinesisStreamSourceDescription
$creadsPrec :: Int -> ReadS KinesisStreamSourceDescription
Prelude.Read, Int -> KinesisStreamSourceDescription -> ShowS
[KinesisStreamSourceDescription] -> ShowS
KinesisStreamSourceDescription -> String
(Int -> KinesisStreamSourceDescription -> ShowS)
-> (KinesisStreamSourceDescription -> String)
-> ([KinesisStreamSourceDescription] -> ShowS)
-> Show KinesisStreamSourceDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamSourceDescription] -> ShowS
$cshowList :: [KinesisStreamSourceDescription] -> ShowS
show :: KinesisStreamSourceDescription -> String
$cshow :: KinesisStreamSourceDescription -> String
showsPrec :: Int -> KinesisStreamSourceDescription -> ShowS
$cshowsPrec :: Int -> KinesisStreamSourceDescription -> ShowS
Prelude.Show, (forall x.
 KinesisStreamSourceDescription
 -> Rep KinesisStreamSourceDescription x)
-> (forall x.
    Rep KinesisStreamSourceDescription x
    -> KinesisStreamSourceDescription)
-> Generic KinesisStreamSourceDescription
forall x.
Rep KinesisStreamSourceDescription x
-> KinesisStreamSourceDescription
forall x.
KinesisStreamSourceDescription
-> Rep KinesisStreamSourceDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisStreamSourceDescription x
-> KinesisStreamSourceDescription
$cfrom :: forall x.
KinesisStreamSourceDescription
-> Rep KinesisStreamSourceDescription x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamSourceDescription' 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:
--
-- 'deliveryStartTimestamp', 'kinesisStreamSourceDescription_deliveryStartTimestamp' - Kinesis Data Firehose starts retrieving records from the Kinesis data
-- stream starting with this timestamp.
--
-- 'kinesisStreamARN', 'kinesisStreamSourceDescription_kinesisStreamARN' - The Amazon Resource Name (ARN) of the source Kinesis data stream. For
-- more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams Amazon Kinesis Data Streams ARN Format>.
--
-- 'roleARN', 'kinesisStreamSourceDescription_roleARN' - The ARN of the role used by the source Kinesis data stream. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam AWS Identity and Access Management (IAM) ARN Format>.
newKinesisStreamSourceDescription ::
  KinesisStreamSourceDescription
newKinesisStreamSourceDescription :: KinesisStreamSourceDescription
newKinesisStreamSourceDescription =
  KinesisStreamSourceDescription' :: Maybe POSIX
-> Maybe Text -> Maybe Text -> KinesisStreamSourceDescription
KinesisStreamSourceDescription'
    { $sel:deliveryStartTimestamp:KinesisStreamSourceDescription' :: Maybe POSIX
deliveryStartTimestamp =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:kinesisStreamARN:KinesisStreamSourceDescription' :: Maybe Text
kinesisStreamARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:KinesisStreamSourceDescription' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Kinesis Data Firehose starts retrieving records from the Kinesis data
-- stream starting with this timestamp.
kinesisStreamSourceDescription_deliveryStartTimestamp :: Lens.Lens' KinesisStreamSourceDescription (Prelude.Maybe Prelude.UTCTime)
kinesisStreamSourceDescription_deliveryStartTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> KinesisStreamSourceDescription
-> f KinesisStreamSourceDescription
kinesisStreamSourceDescription_deliveryStartTimestamp = (KinesisStreamSourceDescription -> Maybe POSIX)
-> (KinesisStreamSourceDescription
    -> Maybe POSIX -> KinesisStreamSourceDescription)
-> Lens
     KinesisStreamSourceDescription
     KinesisStreamSourceDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamSourceDescription' {Maybe POSIX
deliveryStartTimestamp :: Maybe POSIX
$sel:deliveryStartTimestamp:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe POSIX
deliveryStartTimestamp} -> Maybe POSIX
deliveryStartTimestamp) (\s :: KinesisStreamSourceDescription
s@KinesisStreamSourceDescription' {} Maybe POSIX
a -> KinesisStreamSourceDescription
s {$sel:deliveryStartTimestamp:KinesisStreamSourceDescription' :: Maybe POSIX
deliveryStartTimestamp = Maybe POSIX
a} :: KinesisStreamSourceDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> KinesisStreamSourceDescription
 -> f KinesisStreamSourceDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> KinesisStreamSourceDescription
-> f KinesisStreamSourceDescription
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 Amazon Resource Name (ARN) of the source Kinesis data stream. For
-- more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams Amazon Kinesis Data Streams ARN Format>.
kinesisStreamSourceDescription_kinesisStreamARN :: Lens.Lens' KinesisStreamSourceDescription (Prelude.Maybe Prelude.Text)
kinesisStreamSourceDescription_kinesisStreamARN :: (Maybe Text -> f (Maybe Text))
-> KinesisStreamSourceDescription
-> f KinesisStreamSourceDescription
kinesisStreamSourceDescription_kinesisStreamARN = (KinesisStreamSourceDescription -> Maybe Text)
-> (KinesisStreamSourceDescription
    -> Maybe Text -> KinesisStreamSourceDescription)
-> Lens
     KinesisStreamSourceDescription
     KinesisStreamSourceDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamSourceDescription' {Maybe Text
kinesisStreamARN :: Maybe Text
$sel:kinesisStreamARN:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe Text
kinesisStreamARN} -> Maybe Text
kinesisStreamARN) (\s :: KinesisStreamSourceDescription
s@KinesisStreamSourceDescription' {} Maybe Text
a -> KinesisStreamSourceDescription
s {$sel:kinesisStreamARN:KinesisStreamSourceDescription' :: Maybe Text
kinesisStreamARN = Maybe Text
a} :: KinesisStreamSourceDescription)

-- | The ARN of the role used by the source Kinesis data stream. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam AWS Identity and Access Management (IAM) ARN Format>.
kinesisStreamSourceDescription_roleARN :: Lens.Lens' KinesisStreamSourceDescription (Prelude.Maybe Prelude.Text)
kinesisStreamSourceDescription_roleARN :: (Maybe Text -> f (Maybe Text))
-> KinesisStreamSourceDescription
-> f KinesisStreamSourceDescription
kinesisStreamSourceDescription_roleARN = (KinesisStreamSourceDescription -> Maybe Text)
-> (KinesisStreamSourceDescription
    -> Maybe Text -> KinesisStreamSourceDescription)
-> Lens
     KinesisStreamSourceDescription
     KinesisStreamSourceDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamSourceDescription' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: KinesisStreamSourceDescription
s@KinesisStreamSourceDescription' {} Maybe Text
a -> KinesisStreamSourceDescription
s {$sel:roleARN:KinesisStreamSourceDescription' :: Maybe Text
roleARN = Maybe Text
a} :: KinesisStreamSourceDescription)

instance Core.FromJSON KinesisStreamSourceDescription where
  parseJSON :: Value -> Parser KinesisStreamSourceDescription
parseJSON =
    String
-> (Object -> Parser KinesisStreamSourceDescription)
-> Value
-> Parser KinesisStreamSourceDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KinesisStreamSourceDescription"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text -> Maybe Text -> KinesisStreamSourceDescription
KinesisStreamSourceDescription'
            (Maybe POSIX
 -> Maybe Text -> Maybe Text -> KinesisStreamSourceDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe Text -> KinesisStreamSourceDescription)
forall (f :: * -> *) a b. Functor 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
"DeliveryStartTimestamp")
            Parser (Maybe Text -> Maybe Text -> KinesisStreamSourceDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> KinesisStreamSourceDescription)
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
"KinesisStreamARN")
            Parser (Maybe Text -> KinesisStreamSourceDescription)
-> Parser (Maybe Text) -> Parser KinesisStreamSourceDescription
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
"RoleARN")
      )

instance
  Prelude.Hashable
    KinesisStreamSourceDescription

instance
  Prelude.NFData
    KinesisStreamSourceDescription