{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Firehose.Types.KinesisStreamSourceDescription where

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

-- | 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 Data.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 Amazon Web Services Identity and Access Management (IAM) ARN Format>.
    KinesisStreamSourceDescription -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text
  }
  deriving (KinesisStreamSourceDescription
-> KinesisStreamSourceDescription -> Bool
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]
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
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.
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 Amazon Web Services Identity and Access Management (IAM) ARN Format>.
newKinesisStreamSourceDescription ::
  KinesisStreamSourceDescription
newKinesisStreamSourceDescription :: KinesisStreamSourceDescription
newKinesisStreamSourceDescription =
  KinesisStreamSourceDescription'
    { $sel:deliveryStartTimestamp:KinesisStreamSourceDescription' :: Maybe POSIX
deliveryStartTimestamp =
        forall a. Maybe a
Prelude.Nothing,
      $sel:kinesisStreamARN:KinesisStreamSourceDescription' :: Maybe Text
kinesisStreamARN = forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:KinesisStreamSourceDescription' :: Maybe Text
roleARN = 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 :: Lens' KinesisStreamSourceDescription (Maybe UTCTime)
kinesisStreamSourceDescription_deliveryStartTimestamp = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._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 :: Lens' KinesisStreamSourceDescription (Maybe Text)
kinesisStreamSourceDescription_kinesisStreamARN = 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 Amazon Web Services Identity and Access Management (IAM) ARN Format>.
kinesisStreamSourceDescription_roleARN :: Lens.Lens' KinesisStreamSourceDescription (Prelude.Maybe Prelude.Text)
kinesisStreamSourceDescription_roleARN :: Lens' KinesisStreamSourceDescription (Maybe Text)
kinesisStreamSourceDescription_roleARN = 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 Data.FromJSON KinesisStreamSourceDescription where
  parseJSON :: Value -> Parser KinesisStreamSourceDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"KinesisStreamSourceDescription"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text -> Maybe Text -> KinesisStreamSourceDescription
KinesisStreamSourceDescription'
            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
"DeliveryStartTimestamp")
            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
"KinesisStreamARN")
            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
"RoleARN")
      )

instance
  Prelude.Hashable
    KinesisStreamSourceDescription
  where
  hashWithSalt :: Int -> KinesisStreamSourceDescription -> Int
hashWithSalt
    Int
_salt
    KinesisStreamSourceDescription' {Maybe Text
Maybe POSIX
roleARN :: Maybe Text
kinesisStreamARN :: Maybe Text
deliveryStartTimestamp :: Maybe POSIX
$sel:roleARN:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe Text
$sel:kinesisStreamARN:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe Text
$sel:deliveryStartTimestamp:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe POSIX
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
deliveryStartTimestamp
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kinesisStreamARN
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleARN

instance
  Prelude.NFData
    KinesisStreamSourceDescription
  where
  rnf :: KinesisStreamSourceDescription -> ()
rnf KinesisStreamSourceDescription' {Maybe Text
Maybe POSIX
roleARN :: Maybe Text
kinesisStreamARN :: Maybe Text
deliveryStartTimestamp :: Maybe POSIX
$sel:roleARN:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe Text
$sel:kinesisStreamARN:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe Text
$sel:deliveryStartTimestamp:KinesisStreamSourceDescription' :: KinesisStreamSourceDescription -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
deliveryStartTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kinesisStreamARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleARN