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

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

-- | When you update the input configuration for a SQL-based Kinesis Data
-- Analytics application, provides information about a Kinesis stream as
-- the streaming source.
--
-- /See:/ 'newKinesisStreamsInputUpdate' smart constructor.
data KinesisStreamsInputUpdate = KinesisStreamsInputUpdate'
  { -- | The Amazon Resource Name (ARN) of the input Kinesis data stream to read.
    KinesisStreamsInputUpdate -> Text
resourceARNUpdate :: Prelude.Text
  }
  deriving (KinesisStreamsInputUpdate -> KinesisStreamsInputUpdate -> Bool
(KinesisStreamsInputUpdate -> KinesisStreamsInputUpdate -> Bool)
-> (KinesisStreamsInputUpdate -> KinesisStreamsInputUpdate -> Bool)
-> Eq KinesisStreamsInputUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamsInputUpdate -> KinesisStreamsInputUpdate -> Bool
$c/= :: KinesisStreamsInputUpdate -> KinesisStreamsInputUpdate -> Bool
== :: KinesisStreamsInputUpdate -> KinesisStreamsInputUpdate -> Bool
$c== :: KinesisStreamsInputUpdate -> KinesisStreamsInputUpdate -> Bool
Prelude.Eq, ReadPrec [KinesisStreamsInputUpdate]
ReadPrec KinesisStreamsInputUpdate
Int -> ReadS KinesisStreamsInputUpdate
ReadS [KinesisStreamsInputUpdate]
(Int -> ReadS KinesisStreamsInputUpdate)
-> ReadS [KinesisStreamsInputUpdate]
-> ReadPrec KinesisStreamsInputUpdate
-> ReadPrec [KinesisStreamsInputUpdate]
-> Read KinesisStreamsInputUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamsInputUpdate]
$creadListPrec :: ReadPrec [KinesisStreamsInputUpdate]
readPrec :: ReadPrec KinesisStreamsInputUpdate
$creadPrec :: ReadPrec KinesisStreamsInputUpdate
readList :: ReadS [KinesisStreamsInputUpdate]
$creadList :: ReadS [KinesisStreamsInputUpdate]
readsPrec :: Int -> ReadS KinesisStreamsInputUpdate
$creadsPrec :: Int -> ReadS KinesisStreamsInputUpdate
Prelude.Read, Int -> KinesisStreamsInputUpdate -> ShowS
[KinesisStreamsInputUpdate] -> ShowS
KinesisStreamsInputUpdate -> String
(Int -> KinesisStreamsInputUpdate -> ShowS)
-> (KinesisStreamsInputUpdate -> String)
-> ([KinesisStreamsInputUpdate] -> ShowS)
-> Show KinesisStreamsInputUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamsInputUpdate] -> ShowS
$cshowList :: [KinesisStreamsInputUpdate] -> ShowS
show :: KinesisStreamsInputUpdate -> String
$cshow :: KinesisStreamsInputUpdate -> String
showsPrec :: Int -> KinesisStreamsInputUpdate -> ShowS
$cshowsPrec :: Int -> KinesisStreamsInputUpdate -> ShowS
Prelude.Show, (forall x.
 KinesisStreamsInputUpdate -> Rep KinesisStreamsInputUpdate x)
-> (forall x.
    Rep KinesisStreamsInputUpdate x -> KinesisStreamsInputUpdate)
-> Generic KinesisStreamsInputUpdate
forall x.
Rep KinesisStreamsInputUpdate x -> KinesisStreamsInputUpdate
forall x.
KinesisStreamsInputUpdate -> Rep KinesisStreamsInputUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisStreamsInputUpdate x -> KinesisStreamsInputUpdate
$cfrom :: forall x.
KinesisStreamsInputUpdate -> Rep KinesisStreamsInputUpdate x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamsInputUpdate' 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:
--
-- 'resourceARNUpdate', 'kinesisStreamsInputUpdate_resourceARNUpdate' - The Amazon Resource Name (ARN) of the input Kinesis data stream to read.
newKinesisStreamsInputUpdate ::
  -- | 'resourceARNUpdate'
  Prelude.Text ->
  KinesisStreamsInputUpdate
newKinesisStreamsInputUpdate :: Text -> KinesisStreamsInputUpdate
newKinesisStreamsInputUpdate Text
pResourceARNUpdate_ =
  KinesisStreamsInputUpdate' :: Text -> KinesisStreamsInputUpdate
KinesisStreamsInputUpdate'
    { $sel:resourceARNUpdate:KinesisStreamsInputUpdate' :: Text
resourceARNUpdate =
        Text
pResourceARNUpdate_
    }

-- | The Amazon Resource Name (ARN) of the input Kinesis data stream to read.
kinesisStreamsInputUpdate_resourceARNUpdate :: Lens.Lens' KinesisStreamsInputUpdate Prelude.Text
kinesisStreamsInputUpdate_resourceARNUpdate :: (Text -> f Text)
-> KinesisStreamsInputUpdate -> f KinesisStreamsInputUpdate
kinesisStreamsInputUpdate_resourceARNUpdate = (KinesisStreamsInputUpdate -> Text)
-> (KinesisStreamsInputUpdate -> Text -> KinesisStreamsInputUpdate)
-> Lens
     KinesisStreamsInputUpdate KinesisStreamsInputUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamsInputUpdate' {Text
resourceARNUpdate :: Text
$sel:resourceARNUpdate:KinesisStreamsInputUpdate' :: KinesisStreamsInputUpdate -> Text
resourceARNUpdate} -> Text
resourceARNUpdate) (\s :: KinesisStreamsInputUpdate
s@KinesisStreamsInputUpdate' {} Text
a -> KinesisStreamsInputUpdate
s {$sel:resourceARNUpdate:KinesisStreamsInputUpdate' :: Text
resourceARNUpdate = Text
a} :: KinesisStreamsInputUpdate)

instance Prelude.Hashable KinesisStreamsInputUpdate

instance Prelude.NFData KinesisStreamsInputUpdate

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