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

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

-- | When you update a SQL-based Kinesis Data Analytics application\'s output
-- configuration using the UpdateApplication operation, provides
-- information about a Kinesis data stream that is configured as the
-- destination.
--
-- /See:/ 'newKinesisStreamsOutputUpdate' smart constructor.
data KinesisStreamsOutputUpdate = KinesisStreamsOutputUpdate'
  { -- | The Amazon Resource Name (ARN) of the Kinesis data stream where you want
    -- to write the output.
    KinesisStreamsOutputUpdate -> Text
resourceARNUpdate :: Prelude.Text
  }
  deriving (KinesisStreamsOutputUpdate -> KinesisStreamsOutputUpdate -> Bool
(KinesisStreamsOutputUpdate -> KinesisStreamsOutputUpdate -> Bool)
-> (KinesisStreamsOutputUpdate
    -> KinesisStreamsOutputUpdate -> Bool)
-> Eq KinesisStreamsOutputUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamsOutputUpdate -> KinesisStreamsOutputUpdate -> Bool
$c/= :: KinesisStreamsOutputUpdate -> KinesisStreamsOutputUpdate -> Bool
== :: KinesisStreamsOutputUpdate -> KinesisStreamsOutputUpdate -> Bool
$c== :: KinesisStreamsOutputUpdate -> KinesisStreamsOutputUpdate -> Bool
Prelude.Eq, ReadPrec [KinesisStreamsOutputUpdate]
ReadPrec KinesisStreamsOutputUpdate
Int -> ReadS KinesisStreamsOutputUpdate
ReadS [KinesisStreamsOutputUpdate]
(Int -> ReadS KinesisStreamsOutputUpdate)
-> ReadS [KinesisStreamsOutputUpdate]
-> ReadPrec KinesisStreamsOutputUpdate
-> ReadPrec [KinesisStreamsOutputUpdate]
-> Read KinesisStreamsOutputUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamsOutputUpdate]
$creadListPrec :: ReadPrec [KinesisStreamsOutputUpdate]
readPrec :: ReadPrec KinesisStreamsOutputUpdate
$creadPrec :: ReadPrec KinesisStreamsOutputUpdate
readList :: ReadS [KinesisStreamsOutputUpdate]
$creadList :: ReadS [KinesisStreamsOutputUpdate]
readsPrec :: Int -> ReadS KinesisStreamsOutputUpdate
$creadsPrec :: Int -> ReadS KinesisStreamsOutputUpdate
Prelude.Read, Int -> KinesisStreamsOutputUpdate -> ShowS
[KinesisStreamsOutputUpdate] -> ShowS
KinesisStreamsOutputUpdate -> String
(Int -> KinesisStreamsOutputUpdate -> ShowS)
-> (KinesisStreamsOutputUpdate -> String)
-> ([KinesisStreamsOutputUpdate] -> ShowS)
-> Show KinesisStreamsOutputUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamsOutputUpdate] -> ShowS
$cshowList :: [KinesisStreamsOutputUpdate] -> ShowS
show :: KinesisStreamsOutputUpdate -> String
$cshow :: KinesisStreamsOutputUpdate -> String
showsPrec :: Int -> KinesisStreamsOutputUpdate -> ShowS
$cshowsPrec :: Int -> KinesisStreamsOutputUpdate -> ShowS
Prelude.Show, (forall x.
 KinesisStreamsOutputUpdate -> Rep KinesisStreamsOutputUpdate x)
-> (forall x.
    Rep KinesisStreamsOutputUpdate x -> KinesisStreamsOutputUpdate)
-> Generic KinesisStreamsOutputUpdate
forall x.
Rep KinesisStreamsOutputUpdate x -> KinesisStreamsOutputUpdate
forall x.
KinesisStreamsOutputUpdate -> Rep KinesisStreamsOutputUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisStreamsOutputUpdate x -> KinesisStreamsOutputUpdate
$cfrom :: forall x.
KinesisStreamsOutputUpdate -> Rep KinesisStreamsOutputUpdate x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamsOutputUpdate' 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', 'kinesisStreamsOutputUpdate_resourceARNUpdate' - The Amazon Resource Name (ARN) of the Kinesis data stream where you want
-- to write the output.
newKinesisStreamsOutputUpdate ::
  -- | 'resourceARNUpdate'
  Prelude.Text ->
  KinesisStreamsOutputUpdate
newKinesisStreamsOutputUpdate :: Text -> KinesisStreamsOutputUpdate
newKinesisStreamsOutputUpdate Text
pResourceARNUpdate_ =
  KinesisStreamsOutputUpdate' :: Text -> KinesisStreamsOutputUpdate
KinesisStreamsOutputUpdate'
    { $sel:resourceARNUpdate:KinesisStreamsOutputUpdate' :: Text
resourceARNUpdate =
        Text
pResourceARNUpdate_
    }

-- | The Amazon Resource Name (ARN) of the Kinesis data stream where you want
-- to write the output.
kinesisStreamsOutputUpdate_resourceARNUpdate :: Lens.Lens' KinesisStreamsOutputUpdate Prelude.Text
kinesisStreamsOutputUpdate_resourceARNUpdate :: (Text -> f Text)
-> KinesisStreamsOutputUpdate -> f KinesisStreamsOutputUpdate
kinesisStreamsOutputUpdate_resourceARNUpdate = (KinesisStreamsOutputUpdate -> Text)
-> (KinesisStreamsOutputUpdate
    -> Text -> KinesisStreamsOutputUpdate)
-> Lens
     KinesisStreamsOutputUpdate KinesisStreamsOutputUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamsOutputUpdate' {Text
resourceARNUpdate :: Text
$sel:resourceARNUpdate:KinesisStreamsOutputUpdate' :: KinesisStreamsOutputUpdate -> Text
resourceARNUpdate} -> Text
resourceARNUpdate) (\s :: KinesisStreamsOutputUpdate
s@KinesisStreamsOutputUpdate' {} Text
a -> KinesisStreamsOutputUpdate
s {$sel:resourceARNUpdate:KinesisStreamsOutputUpdate' :: Text
resourceARNUpdate = Text
a} :: KinesisStreamsOutputUpdate)

instance Prelude.Hashable KinesisStreamsOutputUpdate

instance Prelude.NFData KinesisStreamsOutputUpdate

instance Core.ToJSON KinesisStreamsOutputUpdate where
  toJSON :: KinesisStreamsOutputUpdate -> Value
toJSON KinesisStreamsOutputUpdate' {Text
resourceARNUpdate :: Text
$sel:resourceARNUpdate:KinesisStreamsOutputUpdate' :: KinesisStreamsOutputUpdate -> 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)
          ]
      )