{-# 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.KinesisStreamsOutput
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.KinesisAnalyticsV2.Types.KinesisStreamsOutput where

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

-- | When you configure a SQL-based Kinesis Data Analytics application\'s
-- output, identifies a Kinesis data stream as the destination. You provide
-- the stream Amazon Resource Name (ARN).
--
-- /See:/ 'newKinesisStreamsOutput' smart constructor.
data KinesisStreamsOutput = KinesisStreamsOutput'
  { -- | The ARN of the destination Kinesis data stream to write to.
    KinesisStreamsOutput -> Text
resourceARN :: Prelude.Text
  }
  deriving (KinesisStreamsOutput -> KinesisStreamsOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamsOutput -> KinesisStreamsOutput -> Bool
$c/= :: KinesisStreamsOutput -> KinesisStreamsOutput -> Bool
== :: KinesisStreamsOutput -> KinesisStreamsOutput -> Bool
$c== :: KinesisStreamsOutput -> KinesisStreamsOutput -> Bool
Prelude.Eq, ReadPrec [KinesisStreamsOutput]
ReadPrec KinesisStreamsOutput
Int -> ReadS KinesisStreamsOutput
ReadS [KinesisStreamsOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamsOutput]
$creadListPrec :: ReadPrec [KinesisStreamsOutput]
readPrec :: ReadPrec KinesisStreamsOutput
$creadPrec :: ReadPrec KinesisStreamsOutput
readList :: ReadS [KinesisStreamsOutput]
$creadList :: ReadS [KinesisStreamsOutput]
readsPrec :: Int -> ReadS KinesisStreamsOutput
$creadsPrec :: Int -> ReadS KinesisStreamsOutput
Prelude.Read, Int -> KinesisStreamsOutput -> ShowS
[KinesisStreamsOutput] -> ShowS
KinesisStreamsOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamsOutput] -> ShowS
$cshowList :: [KinesisStreamsOutput] -> ShowS
show :: KinesisStreamsOutput -> String
$cshow :: KinesisStreamsOutput -> String
showsPrec :: Int -> KinesisStreamsOutput -> ShowS
$cshowsPrec :: Int -> KinesisStreamsOutput -> ShowS
Prelude.Show, forall x. Rep KinesisStreamsOutput x -> KinesisStreamsOutput
forall x. KinesisStreamsOutput -> Rep KinesisStreamsOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisStreamsOutput x -> KinesisStreamsOutput
$cfrom :: forall x. KinesisStreamsOutput -> Rep KinesisStreamsOutput x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamsOutput' 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', 'kinesisStreamsOutput_resourceARN' - The ARN of the destination Kinesis data stream to write to.
newKinesisStreamsOutput ::
  -- | 'resourceARN'
  Prelude.Text ->
  KinesisStreamsOutput
newKinesisStreamsOutput :: Text -> KinesisStreamsOutput
newKinesisStreamsOutput Text
pResourceARN_ =
  KinesisStreamsOutput' {$sel:resourceARN:KinesisStreamsOutput' :: Text
resourceARN = Text
pResourceARN_}

-- | The ARN of the destination Kinesis data stream to write to.
kinesisStreamsOutput_resourceARN :: Lens.Lens' KinesisStreamsOutput Prelude.Text
kinesisStreamsOutput_resourceARN :: Lens' KinesisStreamsOutput Text
kinesisStreamsOutput_resourceARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamsOutput' {Text
resourceARN :: Text
$sel:resourceARN:KinesisStreamsOutput' :: KinesisStreamsOutput -> Text
resourceARN} -> Text
resourceARN) (\s :: KinesisStreamsOutput
s@KinesisStreamsOutput' {} Text
a -> KinesisStreamsOutput
s {$sel:resourceARN:KinesisStreamsOutput' :: Text
resourceARN = Text
a} :: KinesisStreamsOutput)

instance Prelude.Hashable KinesisStreamsOutput where
  hashWithSalt :: Int -> KinesisStreamsOutput -> Int
hashWithSalt Int
_salt KinesisStreamsOutput' {Text
resourceARN :: Text
$sel:resourceARN:KinesisStreamsOutput' :: KinesisStreamsOutput -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceARN

instance Prelude.NFData KinesisStreamsOutput where
  rnf :: KinesisStreamsOutput -> ()
rnf KinesisStreamsOutput' {Text
resourceARN :: Text
$sel:resourceARN:KinesisStreamsOutput' :: KinesisStreamsOutput -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
resourceARN

instance Data.ToJSON KinesisStreamsOutput where
  toJSON :: KinesisStreamsOutput -> Value
toJSON KinesisStreamsOutput' {Text
resourceARN :: Text
$sel:resourceARN:KinesisStreamsOutput' :: KinesisStreamsOutput -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"ResourceARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceARN)]
      )