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

import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.DestinationStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'KinesisStreamingDestinationOutput' 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:
--
-- 'destinationStatus', 'kinesisStreamingDestinationOutput_destinationStatus' - The current status of the replication.
--
-- 'streamArn', 'kinesisStreamingDestinationOutput_streamArn' - The ARN for the specific Kinesis data stream.
--
-- 'tableName', 'kinesisStreamingDestinationOutput_tableName' - The name of the table being modified.
newKinesisStreamingDestinationOutput ::
  KinesisStreamingDestinationOutput
newKinesisStreamingDestinationOutput :: KinesisStreamingDestinationOutput
newKinesisStreamingDestinationOutput =
  KinesisStreamingDestinationOutput' :: Maybe DestinationStatus
-> Maybe Text -> Maybe Text -> KinesisStreamingDestinationOutput
KinesisStreamingDestinationOutput'
    { $sel:destinationStatus:KinesisStreamingDestinationOutput' :: Maybe DestinationStatus
destinationStatus =
        Maybe DestinationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:streamArn:KinesisStreamingDestinationOutput' :: Maybe Text
streamArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tableName:KinesisStreamingDestinationOutput' :: Maybe Text
tableName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the replication.
kinesisStreamingDestinationOutput_destinationStatus :: Lens.Lens' KinesisStreamingDestinationOutput (Prelude.Maybe DestinationStatus)
kinesisStreamingDestinationOutput_destinationStatus :: (Maybe DestinationStatus -> f (Maybe DestinationStatus))
-> KinesisStreamingDestinationOutput
-> f KinesisStreamingDestinationOutput
kinesisStreamingDestinationOutput_destinationStatus = (KinesisStreamingDestinationOutput -> Maybe DestinationStatus)
-> (KinesisStreamingDestinationOutput
    -> Maybe DestinationStatus -> KinesisStreamingDestinationOutput)
-> Lens
     KinesisStreamingDestinationOutput
     KinesisStreamingDestinationOutput
     (Maybe DestinationStatus)
     (Maybe DestinationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamingDestinationOutput' {Maybe DestinationStatus
destinationStatus :: Maybe DestinationStatus
$sel:destinationStatus:KinesisStreamingDestinationOutput' :: KinesisStreamingDestinationOutput -> Maybe DestinationStatus
destinationStatus} -> Maybe DestinationStatus
destinationStatus) (\s :: KinesisStreamingDestinationOutput
s@KinesisStreamingDestinationOutput' {} Maybe DestinationStatus
a -> KinesisStreamingDestinationOutput
s {$sel:destinationStatus:KinesisStreamingDestinationOutput' :: Maybe DestinationStatus
destinationStatus = Maybe DestinationStatus
a} :: KinesisStreamingDestinationOutput)

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

-- | The name of the table being modified.
kinesisStreamingDestinationOutput_tableName :: Lens.Lens' KinesisStreamingDestinationOutput (Prelude.Maybe Prelude.Text)
kinesisStreamingDestinationOutput_tableName :: (Maybe Text -> f (Maybe Text))
-> KinesisStreamingDestinationOutput
-> f KinesisStreamingDestinationOutput
kinesisStreamingDestinationOutput_tableName = (KinesisStreamingDestinationOutput -> Maybe Text)
-> (KinesisStreamingDestinationOutput
    -> Maybe Text -> KinesisStreamingDestinationOutput)
-> Lens
     KinesisStreamingDestinationOutput
     KinesisStreamingDestinationOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamingDestinationOutput' {Maybe Text
tableName :: Maybe Text
$sel:tableName:KinesisStreamingDestinationOutput' :: KinesisStreamingDestinationOutput -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: KinesisStreamingDestinationOutput
s@KinesisStreamingDestinationOutput' {} Maybe Text
a -> KinesisStreamingDestinationOutput
s {$sel:tableName:KinesisStreamingDestinationOutput' :: Maybe Text
tableName = Maybe Text
a} :: KinesisStreamingDestinationOutput)

instance
  Core.FromJSON
    KinesisStreamingDestinationOutput
  where
  parseJSON :: Value -> Parser KinesisStreamingDestinationOutput
parseJSON =
    String
-> (Object -> Parser KinesisStreamingDestinationOutput)
-> Value
-> Parser KinesisStreamingDestinationOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KinesisStreamingDestinationOutput"
      ( \Object
x ->
          Maybe DestinationStatus
-> Maybe Text -> Maybe Text -> KinesisStreamingDestinationOutput
KinesisStreamingDestinationOutput'
            (Maybe DestinationStatus
 -> Maybe Text -> Maybe Text -> KinesisStreamingDestinationOutput)
-> Parser (Maybe DestinationStatus)
-> Parser
     (Maybe Text -> Maybe Text -> KinesisStreamingDestinationOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DestinationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DestinationStatus")
            Parser
  (Maybe Text -> Maybe Text -> KinesisStreamingDestinationOutput)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> KinesisStreamingDestinationOutput)
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
"StreamArn")
            Parser (Maybe Text -> KinesisStreamingDestinationOutput)
-> Parser (Maybe Text) -> Parser KinesisStreamingDestinationOutput
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
"TableName")
      )

instance
  Prelude.Hashable
    KinesisStreamingDestinationOutput

instance
  Prelude.NFData
    KinesisStreamingDestinationOutput