{-# 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.KinesisAnalyticsV2.Types.KinesisStreamsInput
-- 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.KinesisAnalyticsV2.Types.KinesisStreamsInput where

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

-- | Identifies a Kinesis data stream as the streaming source. You provide
-- the stream\'s Amazon Resource Name (ARN).
--
-- /See:/ 'newKinesisStreamsInput' smart constructor.
data KinesisStreamsInput = KinesisStreamsInput'
  { -- | The ARN of the input Kinesis data stream to read.
    KinesisStreamsInput -> Text
resourceARN :: Prelude.Text
  }
  deriving (KinesisStreamsInput -> KinesisStreamsInput -> Bool
(KinesisStreamsInput -> KinesisStreamsInput -> Bool)
-> (KinesisStreamsInput -> KinesisStreamsInput -> Bool)
-> Eq KinesisStreamsInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamsInput -> KinesisStreamsInput -> Bool
$c/= :: KinesisStreamsInput -> KinesisStreamsInput -> Bool
== :: KinesisStreamsInput -> KinesisStreamsInput -> Bool
$c== :: KinesisStreamsInput -> KinesisStreamsInput -> Bool
Prelude.Eq, ReadPrec [KinesisStreamsInput]
ReadPrec KinesisStreamsInput
Int -> ReadS KinesisStreamsInput
ReadS [KinesisStreamsInput]
(Int -> ReadS KinesisStreamsInput)
-> ReadS [KinesisStreamsInput]
-> ReadPrec KinesisStreamsInput
-> ReadPrec [KinesisStreamsInput]
-> Read KinesisStreamsInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamsInput]
$creadListPrec :: ReadPrec [KinesisStreamsInput]
readPrec :: ReadPrec KinesisStreamsInput
$creadPrec :: ReadPrec KinesisStreamsInput
readList :: ReadS [KinesisStreamsInput]
$creadList :: ReadS [KinesisStreamsInput]
readsPrec :: Int -> ReadS KinesisStreamsInput
$creadsPrec :: Int -> ReadS KinesisStreamsInput
Prelude.Read, Int -> KinesisStreamsInput -> ShowS
[KinesisStreamsInput] -> ShowS
KinesisStreamsInput -> String
(Int -> KinesisStreamsInput -> ShowS)
-> (KinesisStreamsInput -> String)
-> ([KinesisStreamsInput] -> ShowS)
-> Show KinesisStreamsInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamsInput] -> ShowS
$cshowList :: [KinesisStreamsInput] -> ShowS
show :: KinesisStreamsInput -> String
$cshow :: KinesisStreamsInput -> String
showsPrec :: Int -> KinesisStreamsInput -> ShowS
$cshowsPrec :: Int -> KinesisStreamsInput -> ShowS
Prelude.Show, (forall x. KinesisStreamsInput -> Rep KinesisStreamsInput x)
-> (forall x. Rep KinesisStreamsInput x -> KinesisStreamsInput)
-> Generic KinesisStreamsInput
forall x. Rep KinesisStreamsInput x -> KinesisStreamsInput
forall x. KinesisStreamsInput -> Rep KinesisStreamsInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisStreamsInput x -> KinesisStreamsInput
$cfrom :: forall x. KinesisStreamsInput -> Rep KinesisStreamsInput x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamsInput' 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:
--
-- 'resourceARN', 'kinesisStreamsInput_resourceARN' - The ARN of the input Kinesis data stream to read.
newKinesisStreamsInput ::
  -- | 'resourceARN'
  Prelude.Text ->
  KinesisStreamsInput
newKinesisStreamsInput :: Text -> KinesisStreamsInput
newKinesisStreamsInput Text
pResourceARN_ =
  KinesisStreamsInput' :: Text -> KinesisStreamsInput
KinesisStreamsInput' {$sel:resourceARN:KinesisStreamsInput' :: Text
resourceARN = Text
pResourceARN_}

-- | The ARN of the input Kinesis data stream to read.
kinesisStreamsInput_resourceARN :: Lens.Lens' KinesisStreamsInput Prelude.Text
kinesisStreamsInput_resourceARN :: (Text -> f Text) -> KinesisStreamsInput -> f KinesisStreamsInput
kinesisStreamsInput_resourceARN = (KinesisStreamsInput -> Text)
-> (KinesisStreamsInput -> Text -> KinesisStreamsInput)
-> Lens KinesisStreamsInput KinesisStreamsInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamsInput' {Text
resourceARN :: Text
$sel:resourceARN:KinesisStreamsInput' :: KinesisStreamsInput -> Text
resourceARN} -> Text
resourceARN) (\s :: KinesisStreamsInput
s@KinesisStreamsInput' {} Text
a -> KinesisStreamsInput
s {$sel:resourceARN:KinesisStreamsInput' :: Text
resourceARN = Text
a} :: KinesisStreamsInput)

instance Prelude.Hashable KinesisStreamsInput

instance Prelude.NFData KinesisStreamsInput

instance Core.ToJSON KinesisStreamsInput where
  toJSON :: KinesisStreamsInput -> Value
toJSON KinesisStreamsInput' {Text
resourceARN :: Text
$sel:resourceARN:KinesisStreamsInput' :: KinesisStreamsInput -> 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
"ResourceARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceARN)]
      )