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

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

-- | The stream and role Amazon Resource Names (ARNs) for a Kinesis data
-- stream used as the source for a delivery stream.
--
-- /See:/ 'newKinesisStreamSourceConfiguration' smart constructor.
data KinesisStreamSourceConfiguration = KinesisStreamSourceConfiguration'
  { -- | The 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>.
    KinesisStreamSourceConfiguration -> Text
kinesisStreamARN :: Prelude.Text,
    -- | The ARN of the role that provides access to 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>.
    KinesisStreamSourceConfiguration -> Text
roleARN :: Prelude.Text
  }
  deriving (KinesisStreamSourceConfiguration
-> KinesisStreamSourceConfiguration -> Bool
(KinesisStreamSourceConfiguration
 -> KinesisStreamSourceConfiguration -> Bool)
-> (KinesisStreamSourceConfiguration
    -> KinesisStreamSourceConfiguration -> Bool)
-> Eq KinesisStreamSourceConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamSourceConfiguration
-> KinesisStreamSourceConfiguration -> Bool
$c/= :: KinesisStreamSourceConfiguration
-> KinesisStreamSourceConfiguration -> Bool
== :: KinesisStreamSourceConfiguration
-> KinesisStreamSourceConfiguration -> Bool
$c== :: KinesisStreamSourceConfiguration
-> KinesisStreamSourceConfiguration -> Bool
Prelude.Eq, ReadPrec [KinesisStreamSourceConfiguration]
ReadPrec KinesisStreamSourceConfiguration
Int -> ReadS KinesisStreamSourceConfiguration
ReadS [KinesisStreamSourceConfiguration]
(Int -> ReadS KinesisStreamSourceConfiguration)
-> ReadS [KinesisStreamSourceConfiguration]
-> ReadPrec KinesisStreamSourceConfiguration
-> ReadPrec [KinesisStreamSourceConfiguration]
-> Read KinesisStreamSourceConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamSourceConfiguration]
$creadListPrec :: ReadPrec [KinesisStreamSourceConfiguration]
readPrec :: ReadPrec KinesisStreamSourceConfiguration
$creadPrec :: ReadPrec KinesisStreamSourceConfiguration
readList :: ReadS [KinesisStreamSourceConfiguration]
$creadList :: ReadS [KinesisStreamSourceConfiguration]
readsPrec :: Int -> ReadS KinesisStreamSourceConfiguration
$creadsPrec :: Int -> ReadS KinesisStreamSourceConfiguration
Prelude.Read, Int -> KinesisStreamSourceConfiguration -> ShowS
[KinesisStreamSourceConfiguration] -> ShowS
KinesisStreamSourceConfiguration -> String
(Int -> KinesisStreamSourceConfiguration -> ShowS)
-> (KinesisStreamSourceConfiguration -> String)
-> ([KinesisStreamSourceConfiguration] -> ShowS)
-> Show KinesisStreamSourceConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamSourceConfiguration] -> ShowS
$cshowList :: [KinesisStreamSourceConfiguration] -> ShowS
show :: KinesisStreamSourceConfiguration -> String
$cshow :: KinesisStreamSourceConfiguration -> String
showsPrec :: Int -> KinesisStreamSourceConfiguration -> ShowS
$cshowsPrec :: Int -> KinesisStreamSourceConfiguration -> ShowS
Prelude.Show, (forall x.
 KinesisStreamSourceConfiguration
 -> Rep KinesisStreamSourceConfiguration x)
-> (forall x.
    Rep KinesisStreamSourceConfiguration x
    -> KinesisStreamSourceConfiguration)
-> Generic KinesisStreamSourceConfiguration
forall x.
Rep KinesisStreamSourceConfiguration x
-> KinesisStreamSourceConfiguration
forall x.
KinesisStreamSourceConfiguration
-> Rep KinesisStreamSourceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisStreamSourceConfiguration x
-> KinesisStreamSourceConfiguration
$cfrom :: forall x.
KinesisStreamSourceConfiguration
-> Rep KinesisStreamSourceConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamSourceConfiguration' 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:
--
-- 'kinesisStreamARN', 'kinesisStreamSourceConfiguration_kinesisStreamARN' - The 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', 'kinesisStreamSourceConfiguration_roleARN' - The ARN of the role that provides access to 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>.
newKinesisStreamSourceConfiguration ::
  -- | 'kinesisStreamARN'
  Prelude.Text ->
  -- | 'roleARN'
  Prelude.Text ->
  KinesisStreamSourceConfiguration
newKinesisStreamSourceConfiguration :: Text -> Text -> KinesisStreamSourceConfiguration
newKinesisStreamSourceConfiguration
  Text
pKinesisStreamARN_
  Text
pRoleARN_ =
    KinesisStreamSourceConfiguration' :: Text -> Text -> KinesisStreamSourceConfiguration
KinesisStreamSourceConfiguration'
      { $sel:kinesisStreamARN:KinesisStreamSourceConfiguration' :: Text
kinesisStreamARN =
          Text
pKinesisStreamARN_,
        $sel:roleARN:KinesisStreamSourceConfiguration' :: Text
roleARN = Text
pRoleARN_
      }

-- | The 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>.
kinesisStreamSourceConfiguration_kinesisStreamARN :: Lens.Lens' KinesisStreamSourceConfiguration Prelude.Text
kinesisStreamSourceConfiguration_kinesisStreamARN :: (Text -> f Text)
-> KinesisStreamSourceConfiguration
-> f KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration_kinesisStreamARN = (KinesisStreamSourceConfiguration -> Text)
-> (KinesisStreamSourceConfiguration
    -> Text -> KinesisStreamSourceConfiguration)
-> Lens
     KinesisStreamSourceConfiguration
     KinesisStreamSourceConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamSourceConfiguration' {Text
kinesisStreamARN :: Text
$sel:kinesisStreamARN:KinesisStreamSourceConfiguration' :: KinesisStreamSourceConfiguration -> Text
kinesisStreamARN} -> Text
kinesisStreamARN) (\s :: KinesisStreamSourceConfiguration
s@KinesisStreamSourceConfiguration' {} Text
a -> KinesisStreamSourceConfiguration
s {$sel:kinesisStreamARN:KinesisStreamSourceConfiguration' :: Text
kinesisStreamARN = Text
a} :: KinesisStreamSourceConfiguration)

-- | The ARN of the role that provides access to 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>.
kinesisStreamSourceConfiguration_roleARN :: Lens.Lens' KinesisStreamSourceConfiguration Prelude.Text
kinesisStreamSourceConfiguration_roleARN :: (Text -> f Text)
-> KinesisStreamSourceConfiguration
-> f KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration_roleARN = (KinesisStreamSourceConfiguration -> Text)
-> (KinesisStreamSourceConfiguration
    -> Text -> KinesisStreamSourceConfiguration)
-> Lens
     KinesisStreamSourceConfiguration
     KinesisStreamSourceConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamSourceConfiguration' {Text
roleARN :: Text
$sel:roleARN:KinesisStreamSourceConfiguration' :: KinesisStreamSourceConfiguration -> Text
roleARN} -> Text
roleARN) (\s :: KinesisStreamSourceConfiguration
s@KinesisStreamSourceConfiguration' {} Text
a -> KinesisStreamSourceConfiguration
s {$sel:roleARN:KinesisStreamSourceConfiguration' :: Text
roleARN = Text
a} :: KinesisStreamSourceConfiguration)

instance
  Prelude.Hashable
    KinesisStreamSourceConfiguration

instance
  Prelude.NFData
    KinesisStreamSourceConfiguration

instance Core.ToJSON KinesisStreamSourceConfiguration where
  toJSON :: KinesisStreamSourceConfiguration -> Value
toJSON KinesisStreamSourceConfiguration' {Text
roleARN :: Text
kinesisStreamARN :: Text
$sel:roleARN:KinesisStreamSourceConfiguration' :: KinesisStreamSourceConfiguration -> Text
$sel:kinesisStreamARN:KinesisStreamSourceConfiguration' :: KinesisStreamSourceConfiguration -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"KinesisStreamARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
kinesisStreamARN),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleARN)
          ]
      )