{-# 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.Rekognition.Types.KinesisDataStream
-- 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.Rekognition.Types.KinesisDataStream where

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

-- | The Kinesis data stream Amazon Rekognition to which the analysis results
-- of a Amazon Rekognition stream processor are streamed. For more
-- information, see CreateStreamProcessor in the Amazon Rekognition
-- Developer Guide.
--
-- /See:/ 'newKinesisDataStream' smart constructor.
data KinesisDataStream = KinesisDataStream'
  { -- | ARN of the output Amazon Kinesis Data Streams stream.
    KinesisDataStream -> Maybe Text
arn :: Prelude.Maybe Prelude.Text
  }
  deriving (KinesisDataStream -> KinesisDataStream -> Bool
(KinesisDataStream -> KinesisDataStream -> Bool)
-> (KinesisDataStream -> KinesisDataStream -> Bool)
-> Eq KinesisDataStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisDataStream -> KinesisDataStream -> Bool
$c/= :: KinesisDataStream -> KinesisDataStream -> Bool
== :: KinesisDataStream -> KinesisDataStream -> Bool
$c== :: KinesisDataStream -> KinesisDataStream -> Bool
Prelude.Eq, ReadPrec [KinesisDataStream]
ReadPrec KinesisDataStream
Int -> ReadS KinesisDataStream
ReadS [KinesisDataStream]
(Int -> ReadS KinesisDataStream)
-> ReadS [KinesisDataStream]
-> ReadPrec KinesisDataStream
-> ReadPrec [KinesisDataStream]
-> Read KinesisDataStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisDataStream]
$creadListPrec :: ReadPrec [KinesisDataStream]
readPrec :: ReadPrec KinesisDataStream
$creadPrec :: ReadPrec KinesisDataStream
readList :: ReadS [KinesisDataStream]
$creadList :: ReadS [KinesisDataStream]
readsPrec :: Int -> ReadS KinesisDataStream
$creadsPrec :: Int -> ReadS KinesisDataStream
Prelude.Read, Int -> KinesisDataStream -> ShowS
[KinesisDataStream] -> ShowS
KinesisDataStream -> String
(Int -> KinesisDataStream -> ShowS)
-> (KinesisDataStream -> String)
-> ([KinesisDataStream] -> ShowS)
-> Show KinesisDataStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisDataStream] -> ShowS
$cshowList :: [KinesisDataStream] -> ShowS
show :: KinesisDataStream -> String
$cshow :: KinesisDataStream -> String
showsPrec :: Int -> KinesisDataStream -> ShowS
$cshowsPrec :: Int -> KinesisDataStream -> ShowS
Prelude.Show, (forall x. KinesisDataStream -> Rep KinesisDataStream x)
-> (forall x. Rep KinesisDataStream x -> KinesisDataStream)
-> Generic KinesisDataStream
forall x. Rep KinesisDataStream x -> KinesisDataStream
forall x. KinesisDataStream -> Rep KinesisDataStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisDataStream x -> KinesisDataStream
$cfrom :: forall x. KinesisDataStream -> Rep KinesisDataStream x
Prelude.Generic)

-- |
-- Create a value of 'KinesisDataStream' 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:
--
-- 'arn', 'kinesisDataStream_arn' - ARN of the output Amazon Kinesis Data Streams stream.
newKinesisDataStream ::
  KinesisDataStream
newKinesisDataStream :: KinesisDataStream
newKinesisDataStream =
  KinesisDataStream' :: Maybe Text -> KinesisDataStream
KinesisDataStream' {$sel:arn:KinesisDataStream' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | ARN of the output Amazon Kinesis Data Streams stream.
kinesisDataStream_arn :: Lens.Lens' KinesisDataStream (Prelude.Maybe Prelude.Text)
kinesisDataStream_arn :: (Maybe Text -> f (Maybe Text))
-> KinesisDataStream -> f KinesisDataStream
kinesisDataStream_arn = (KinesisDataStream -> Maybe Text)
-> (KinesisDataStream -> Maybe Text -> KinesisDataStream)
-> Lens
     KinesisDataStream KinesisDataStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisDataStream' {Maybe Text
arn :: Maybe Text
$sel:arn:KinesisDataStream' :: KinesisDataStream -> Maybe Text
arn} -> Maybe Text
arn) (\s :: KinesisDataStream
s@KinesisDataStream' {} Maybe Text
a -> KinesisDataStream
s {$sel:arn:KinesisDataStream' :: Maybe Text
arn = Maybe Text
a} :: KinesisDataStream)

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

instance Prelude.Hashable KinesisDataStream

instance Prelude.NFData KinesisDataStream

instance Core.ToJSON KinesisDataStream where
  toJSON :: KinesisDataStream -> Value
toJSON KinesisDataStream' {Maybe Text
arn :: Maybe Text
$sel:arn:KinesisDataStream' :: KinesisDataStream -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ([Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [(Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
arn])