{-# 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.DynamoDB.Types.KinesisStreamingDestinationInput
-- 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.DynamoDB.Types.KinesisStreamingDestinationInput where

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

-- | /See:/ 'newKinesisStreamingDestinationInput' smart constructor.
data KinesisStreamingDestinationInput = KinesisStreamingDestinationInput'
  { -- | The name of the DynamoDB table.
    KinesisStreamingDestinationInput -> Text
tableName :: Prelude.Text,
    -- | The ARN for a Kinesis data stream.
    KinesisStreamingDestinationInput -> Text
streamArn :: Prelude.Text
  }
  deriving (KinesisStreamingDestinationInput
-> KinesisStreamingDestinationInput -> Bool
(KinesisStreamingDestinationInput
 -> KinesisStreamingDestinationInput -> Bool)
-> (KinesisStreamingDestinationInput
    -> KinesisStreamingDestinationInput -> Bool)
-> Eq KinesisStreamingDestinationInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamingDestinationInput
-> KinesisStreamingDestinationInput -> Bool
$c/= :: KinesisStreamingDestinationInput
-> KinesisStreamingDestinationInput -> Bool
== :: KinesisStreamingDestinationInput
-> KinesisStreamingDestinationInput -> Bool
$c== :: KinesisStreamingDestinationInput
-> KinesisStreamingDestinationInput -> Bool
Prelude.Eq, ReadPrec [KinesisStreamingDestinationInput]
ReadPrec KinesisStreamingDestinationInput
Int -> ReadS KinesisStreamingDestinationInput
ReadS [KinesisStreamingDestinationInput]
(Int -> ReadS KinesisStreamingDestinationInput)
-> ReadS [KinesisStreamingDestinationInput]
-> ReadPrec KinesisStreamingDestinationInput
-> ReadPrec [KinesisStreamingDestinationInput]
-> Read KinesisStreamingDestinationInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamingDestinationInput]
$creadListPrec :: ReadPrec [KinesisStreamingDestinationInput]
readPrec :: ReadPrec KinesisStreamingDestinationInput
$creadPrec :: ReadPrec KinesisStreamingDestinationInput
readList :: ReadS [KinesisStreamingDestinationInput]
$creadList :: ReadS [KinesisStreamingDestinationInput]
readsPrec :: Int -> ReadS KinesisStreamingDestinationInput
$creadsPrec :: Int -> ReadS KinesisStreamingDestinationInput
Prelude.Read, Int -> KinesisStreamingDestinationInput -> ShowS
[KinesisStreamingDestinationInput] -> ShowS
KinesisStreamingDestinationInput -> String
(Int -> KinesisStreamingDestinationInput -> ShowS)
-> (KinesisStreamingDestinationInput -> String)
-> ([KinesisStreamingDestinationInput] -> ShowS)
-> Show KinesisStreamingDestinationInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamingDestinationInput] -> ShowS
$cshowList :: [KinesisStreamingDestinationInput] -> ShowS
show :: KinesisStreamingDestinationInput -> String
$cshow :: KinesisStreamingDestinationInput -> String
showsPrec :: Int -> KinesisStreamingDestinationInput -> ShowS
$cshowsPrec :: Int -> KinesisStreamingDestinationInput -> ShowS
Prelude.Show, (forall x.
 KinesisStreamingDestinationInput
 -> Rep KinesisStreamingDestinationInput x)
-> (forall x.
    Rep KinesisStreamingDestinationInput x
    -> KinesisStreamingDestinationInput)
-> Generic KinesisStreamingDestinationInput
forall x.
Rep KinesisStreamingDestinationInput x
-> KinesisStreamingDestinationInput
forall x.
KinesisStreamingDestinationInput
-> Rep KinesisStreamingDestinationInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisStreamingDestinationInput x
-> KinesisStreamingDestinationInput
$cfrom :: forall x.
KinesisStreamingDestinationInput
-> Rep KinesisStreamingDestinationInput x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamingDestinationInput' 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:
--
-- 'tableName', 'kinesisStreamingDestinationInput_tableName' - The name of the DynamoDB table.
--
-- 'streamArn', 'kinesisStreamingDestinationInput_streamArn' - The ARN for a Kinesis data stream.
newKinesisStreamingDestinationInput ::
  -- | 'tableName'
  Prelude.Text ->
  -- | 'streamArn'
  Prelude.Text ->
  KinesisStreamingDestinationInput
newKinesisStreamingDestinationInput :: Text -> Text -> KinesisStreamingDestinationInput
newKinesisStreamingDestinationInput
  Text
pTableName_
  Text
pStreamArn_ =
    KinesisStreamingDestinationInput' :: Text -> Text -> KinesisStreamingDestinationInput
KinesisStreamingDestinationInput'
      { $sel:tableName:KinesisStreamingDestinationInput' :: Text
tableName =
          Text
pTableName_,
        $sel:streamArn:KinesisStreamingDestinationInput' :: Text
streamArn = Text
pStreamArn_
      }

-- | The name of the DynamoDB table.
kinesisStreamingDestinationInput_tableName :: Lens.Lens' KinesisStreamingDestinationInput Prelude.Text
kinesisStreamingDestinationInput_tableName :: (Text -> f Text)
-> KinesisStreamingDestinationInput
-> f KinesisStreamingDestinationInput
kinesisStreamingDestinationInput_tableName = (KinesisStreamingDestinationInput -> Text)
-> (KinesisStreamingDestinationInput
    -> Text -> KinesisStreamingDestinationInput)
-> Lens
     KinesisStreamingDestinationInput
     KinesisStreamingDestinationInput
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamingDestinationInput' {Text
tableName :: Text
$sel:tableName:KinesisStreamingDestinationInput' :: KinesisStreamingDestinationInput -> Text
tableName} -> Text
tableName) (\s :: KinesisStreamingDestinationInput
s@KinesisStreamingDestinationInput' {} Text
a -> KinesisStreamingDestinationInput
s {$sel:tableName:KinesisStreamingDestinationInput' :: Text
tableName = Text
a} :: KinesisStreamingDestinationInput)

-- | The ARN for a Kinesis data stream.
kinesisStreamingDestinationInput_streamArn :: Lens.Lens' KinesisStreamingDestinationInput Prelude.Text
kinesisStreamingDestinationInput_streamArn :: (Text -> f Text)
-> KinesisStreamingDestinationInput
-> f KinesisStreamingDestinationInput
kinesisStreamingDestinationInput_streamArn = (KinesisStreamingDestinationInput -> Text)
-> (KinesisStreamingDestinationInput
    -> Text -> KinesisStreamingDestinationInput)
-> Lens
     KinesisStreamingDestinationInput
     KinesisStreamingDestinationInput
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamingDestinationInput' {Text
streamArn :: Text
$sel:streamArn:KinesisStreamingDestinationInput' :: KinesisStreamingDestinationInput -> Text
streamArn} -> Text
streamArn) (\s :: KinesisStreamingDestinationInput
s@KinesisStreamingDestinationInput' {} Text
a -> KinesisStreamingDestinationInput
s {$sel:streamArn:KinesisStreamingDestinationInput' :: Text
streamArn = Text
a} :: KinesisStreamingDestinationInput)

instance
  Prelude.Hashable
    KinesisStreamingDestinationInput

instance
  Prelude.NFData
    KinesisStreamingDestinationInput

instance Core.ToJSON KinesisStreamingDestinationInput where
  toJSON :: KinesisStreamingDestinationInput -> Value
toJSON KinesisStreamingDestinationInput' {Text
streamArn :: Text
tableName :: Text
$sel:streamArn:KinesisStreamingDestinationInput' :: KinesisStreamingDestinationInput -> Text
$sel:tableName:KinesisStreamingDestinationInput' :: KinesisStreamingDestinationInput -> 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
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamArn)
          ]
      )