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

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

-- | When updating an output configuration using the
-- <https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_UpdateApplication.html UpdateApplication>
-- operation, provides information about an Amazon Kinesis stream
-- configured as the destination.
--
-- /See:/ 'newKinesisStreamsOutputUpdate' smart constructor.
data KinesisStreamsOutputUpdate = KinesisStreamsOutputUpdate'
  { -- | ARN of the IAM role that Amazon Kinesis Analytics can assume to access
    -- the stream on your behalf. You need to grant the necessary permissions
    -- to this role.
    KinesisStreamsOutputUpdate -> Maybe Text
roleARNUpdate :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Name (ARN) of the Amazon Kinesis stream where you want
    -- to write the output.
    KinesisStreamsOutputUpdate -> Maybe Text
resourceARNUpdate :: Prelude.Maybe 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:
--
-- 'roleARNUpdate', 'kinesisStreamsOutputUpdate_roleARNUpdate' - ARN of the IAM role that Amazon Kinesis Analytics can assume to access
-- the stream on your behalf. You need to grant the necessary permissions
-- to this role.
--
-- 'resourceARNUpdate', 'kinesisStreamsOutputUpdate_resourceARNUpdate' - Amazon Resource Name (ARN) of the Amazon Kinesis stream where you want
-- to write the output.
newKinesisStreamsOutputUpdate ::
  KinesisStreamsOutputUpdate
newKinesisStreamsOutputUpdate :: KinesisStreamsOutputUpdate
newKinesisStreamsOutputUpdate =
  KinesisStreamsOutputUpdate' :: Maybe Text -> Maybe Text -> KinesisStreamsOutputUpdate
KinesisStreamsOutputUpdate'
    { $sel:roleARNUpdate:KinesisStreamsOutputUpdate' :: Maybe Text
roleARNUpdate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARNUpdate:KinesisStreamsOutputUpdate' :: Maybe Text
resourceARNUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | ARN of the IAM role that Amazon Kinesis Analytics can assume to access
-- the stream on your behalf. You need to grant the necessary permissions
-- to this role.
kinesisStreamsOutputUpdate_roleARNUpdate :: Lens.Lens' KinesisStreamsOutputUpdate (Prelude.Maybe Prelude.Text)
kinesisStreamsOutputUpdate_roleARNUpdate :: (Maybe Text -> f (Maybe Text))
-> KinesisStreamsOutputUpdate -> f KinesisStreamsOutputUpdate
kinesisStreamsOutputUpdate_roleARNUpdate = (KinesisStreamsOutputUpdate -> Maybe Text)
-> (KinesisStreamsOutputUpdate
    -> Maybe Text -> KinesisStreamsOutputUpdate)
-> Lens
     KinesisStreamsOutputUpdate
     KinesisStreamsOutputUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamsOutputUpdate' {Maybe Text
roleARNUpdate :: Maybe Text
$sel:roleARNUpdate:KinesisStreamsOutputUpdate' :: KinesisStreamsOutputUpdate -> Maybe Text
roleARNUpdate} -> Maybe Text
roleARNUpdate) (\s :: KinesisStreamsOutputUpdate
s@KinesisStreamsOutputUpdate' {} Maybe Text
a -> KinesisStreamsOutputUpdate
s {$sel:roleARNUpdate:KinesisStreamsOutputUpdate' :: Maybe Text
roleARNUpdate = Maybe Text
a} :: KinesisStreamsOutputUpdate)

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

instance Prelude.Hashable KinesisStreamsOutputUpdate

instance Prelude.NFData KinesisStreamsOutputUpdate

instance Core.ToJSON KinesisStreamsOutputUpdate where
  toJSON :: KinesisStreamsOutputUpdate -> Value
toJSON KinesisStreamsOutputUpdate' {Maybe Text
resourceARNUpdate :: Maybe Text
roleARNUpdate :: Maybe Text
$sel:resourceARNUpdate:KinesisStreamsOutputUpdate' :: KinesisStreamsOutputUpdate -> Maybe Text
$sel:roleARNUpdate:KinesisStreamsOutputUpdate' :: KinesisStreamsOutputUpdate -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RoleARNUpdate" 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
roleARNUpdate,
            (Text
"ResourceARNUpdate" 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
resourceARNUpdate
          ]
      )