{-# 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.KinesisFirehoseOutputUpdate
-- 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.KinesisFirehoseOutputUpdate 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 Firehose
-- delivery stream configured as the destination.
--
-- /See:/ 'newKinesisFirehoseOutputUpdate' smart constructor.
data KinesisFirehoseOutputUpdate = KinesisFirehoseOutputUpdate'
  { -- | 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.
    KinesisFirehoseOutputUpdate -> Maybe Text
roleARNUpdate :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery
    -- stream to write to.
    KinesisFirehoseOutputUpdate -> Maybe Text
resourceARNUpdate :: Prelude.Maybe Prelude.Text
  }
  deriving (KinesisFirehoseOutputUpdate -> KinesisFirehoseOutputUpdate -> Bool
(KinesisFirehoseOutputUpdate
 -> KinesisFirehoseOutputUpdate -> Bool)
-> (KinesisFirehoseOutputUpdate
    -> KinesisFirehoseOutputUpdate -> Bool)
-> Eq KinesisFirehoseOutputUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisFirehoseOutputUpdate -> KinesisFirehoseOutputUpdate -> Bool
$c/= :: KinesisFirehoseOutputUpdate -> KinesisFirehoseOutputUpdate -> Bool
== :: KinesisFirehoseOutputUpdate -> KinesisFirehoseOutputUpdate -> Bool
$c== :: KinesisFirehoseOutputUpdate -> KinesisFirehoseOutputUpdate -> Bool
Prelude.Eq, ReadPrec [KinesisFirehoseOutputUpdate]
ReadPrec KinesisFirehoseOutputUpdate
Int -> ReadS KinesisFirehoseOutputUpdate
ReadS [KinesisFirehoseOutputUpdate]
(Int -> ReadS KinesisFirehoseOutputUpdate)
-> ReadS [KinesisFirehoseOutputUpdate]
-> ReadPrec KinesisFirehoseOutputUpdate
-> ReadPrec [KinesisFirehoseOutputUpdate]
-> Read KinesisFirehoseOutputUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisFirehoseOutputUpdate]
$creadListPrec :: ReadPrec [KinesisFirehoseOutputUpdate]
readPrec :: ReadPrec KinesisFirehoseOutputUpdate
$creadPrec :: ReadPrec KinesisFirehoseOutputUpdate
readList :: ReadS [KinesisFirehoseOutputUpdate]
$creadList :: ReadS [KinesisFirehoseOutputUpdate]
readsPrec :: Int -> ReadS KinesisFirehoseOutputUpdate
$creadsPrec :: Int -> ReadS KinesisFirehoseOutputUpdate
Prelude.Read, Int -> KinesisFirehoseOutputUpdate -> ShowS
[KinesisFirehoseOutputUpdate] -> ShowS
KinesisFirehoseOutputUpdate -> String
(Int -> KinesisFirehoseOutputUpdate -> ShowS)
-> (KinesisFirehoseOutputUpdate -> String)
-> ([KinesisFirehoseOutputUpdate] -> ShowS)
-> Show KinesisFirehoseOutputUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisFirehoseOutputUpdate] -> ShowS
$cshowList :: [KinesisFirehoseOutputUpdate] -> ShowS
show :: KinesisFirehoseOutputUpdate -> String
$cshow :: KinesisFirehoseOutputUpdate -> String
showsPrec :: Int -> KinesisFirehoseOutputUpdate -> ShowS
$cshowsPrec :: Int -> KinesisFirehoseOutputUpdate -> ShowS
Prelude.Show, (forall x.
 KinesisFirehoseOutputUpdate -> Rep KinesisFirehoseOutputUpdate x)
-> (forall x.
    Rep KinesisFirehoseOutputUpdate x -> KinesisFirehoseOutputUpdate)
-> Generic KinesisFirehoseOutputUpdate
forall x.
Rep KinesisFirehoseOutputUpdate x -> KinesisFirehoseOutputUpdate
forall x.
KinesisFirehoseOutputUpdate -> Rep KinesisFirehoseOutputUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisFirehoseOutputUpdate x -> KinesisFirehoseOutputUpdate
$cfrom :: forall x.
KinesisFirehoseOutputUpdate -> Rep KinesisFirehoseOutputUpdate x
Prelude.Generic)

-- |
-- Create a value of 'KinesisFirehoseOutputUpdate' 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', 'kinesisFirehoseOutputUpdate_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', 'kinesisFirehoseOutputUpdate_resourceARNUpdate' - Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery
-- stream to write to.
newKinesisFirehoseOutputUpdate ::
  KinesisFirehoseOutputUpdate
newKinesisFirehoseOutputUpdate :: KinesisFirehoseOutputUpdate
newKinesisFirehoseOutputUpdate =
  KinesisFirehoseOutputUpdate' :: Maybe Text -> Maybe Text -> KinesisFirehoseOutputUpdate
KinesisFirehoseOutputUpdate'
    { $sel:roleARNUpdate:KinesisFirehoseOutputUpdate' :: Maybe Text
roleARNUpdate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARNUpdate:KinesisFirehoseOutputUpdate' :: 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.
kinesisFirehoseOutputUpdate_roleARNUpdate :: Lens.Lens' KinesisFirehoseOutputUpdate (Prelude.Maybe Prelude.Text)
kinesisFirehoseOutputUpdate_roleARNUpdate :: (Maybe Text -> f (Maybe Text))
-> KinesisFirehoseOutputUpdate -> f KinesisFirehoseOutputUpdate
kinesisFirehoseOutputUpdate_roleARNUpdate = (KinesisFirehoseOutputUpdate -> Maybe Text)
-> (KinesisFirehoseOutputUpdate
    -> Maybe Text -> KinesisFirehoseOutputUpdate)
-> Lens
     KinesisFirehoseOutputUpdate
     KinesisFirehoseOutputUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseOutputUpdate' {Maybe Text
roleARNUpdate :: Maybe Text
$sel:roleARNUpdate:KinesisFirehoseOutputUpdate' :: KinesisFirehoseOutputUpdate -> Maybe Text
roleARNUpdate} -> Maybe Text
roleARNUpdate) (\s :: KinesisFirehoseOutputUpdate
s@KinesisFirehoseOutputUpdate' {} Maybe Text
a -> KinesisFirehoseOutputUpdate
s {$sel:roleARNUpdate:KinesisFirehoseOutputUpdate' :: Maybe Text
roleARNUpdate = Maybe Text
a} :: KinesisFirehoseOutputUpdate)

-- | Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery
-- stream to write to.
kinesisFirehoseOutputUpdate_resourceARNUpdate :: Lens.Lens' KinesisFirehoseOutputUpdate (Prelude.Maybe Prelude.Text)
kinesisFirehoseOutputUpdate_resourceARNUpdate :: (Maybe Text -> f (Maybe Text))
-> KinesisFirehoseOutputUpdate -> f KinesisFirehoseOutputUpdate
kinesisFirehoseOutputUpdate_resourceARNUpdate = (KinesisFirehoseOutputUpdate -> Maybe Text)
-> (KinesisFirehoseOutputUpdate
    -> Maybe Text -> KinesisFirehoseOutputUpdate)
-> Lens
     KinesisFirehoseOutputUpdate
     KinesisFirehoseOutputUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseOutputUpdate' {Maybe Text
resourceARNUpdate :: Maybe Text
$sel:resourceARNUpdate:KinesisFirehoseOutputUpdate' :: KinesisFirehoseOutputUpdate -> Maybe Text
resourceARNUpdate} -> Maybe Text
resourceARNUpdate) (\s :: KinesisFirehoseOutputUpdate
s@KinesisFirehoseOutputUpdate' {} Maybe Text
a -> KinesisFirehoseOutputUpdate
s {$sel:resourceARNUpdate:KinesisFirehoseOutputUpdate' :: Maybe Text
resourceARNUpdate = Maybe Text
a} :: KinesisFirehoseOutputUpdate)

instance Prelude.Hashable KinesisFirehoseOutputUpdate

instance Prelude.NFData KinesisFirehoseOutputUpdate

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