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

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

-- | When updating application input configuration, provides information
-- about an Amazon Kinesis Firehose delivery stream as the streaming
-- source.
--
-- /See:/ 'newKinesisFirehoseInputUpdate' smart constructor.
data KinesisFirehoseInputUpdate = KinesisFirehoseInputUpdate'
  { -- | 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.
    KinesisFirehoseInputUpdate -> Maybe Text
roleARNUpdate :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Name (ARN) of the input Amazon Kinesis Firehose delivery
    -- stream to read.
    KinesisFirehoseInputUpdate -> Maybe Text
resourceARNUpdate :: Prelude.Maybe Prelude.Text
  }
  deriving (KinesisFirehoseInputUpdate -> KinesisFirehoseInputUpdate -> Bool
(KinesisFirehoseInputUpdate -> KinesisFirehoseInputUpdate -> Bool)
-> (KinesisFirehoseInputUpdate
    -> KinesisFirehoseInputUpdate -> Bool)
-> Eq KinesisFirehoseInputUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisFirehoseInputUpdate -> KinesisFirehoseInputUpdate -> Bool
$c/= :: KinesisFirehoseInputUpdate -> KinesisFirehoseInputUpdate -> Bool
== :: KinesisFirehoseInputUpdate -> KinesisFirehoseInputUpdate -> Bool
$c== :: KinesisFirehoseInputUpdate -> KinesisFirehoseInputUpdate -> Bool
Prelude.Eq, ReadPrec [KinesisFirehoseInputUpdate]
ReadPrec KinesisFirehoseInputUpdate
Int -> ReadS KinesisFirehoseInputUpdate
ReadS [KinesisFirehoseInputUpdate]
(Int -> ReadS KinesisFirehoseInputUpdate)
-> ReadS [KinesisFirehoseInputUpdate]
-> ReadPrec KinesisFirehoseInputUpdate
-> ReadPrec [KinesisFirehoseInputUpdate]
-> Read KinesisFirehoseInputUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisFirehoseInputUpdate]
$creadListPrec :: ReadPrec [KinesisFirehoseInputUpdate]
readPrec :: ReadPrec KinesisFirehoseInputUpdate
$creadPrec :: ReadPrec KinesisFirehoseInputUpdate
readList :: ReadS [KinesisFirehoseInputUpdate]
$creadList :: ReadS [KinesisFirehoseInputUpdate]
readsPrec :: Int -> ReadS KinesisFirehoseInputUpdate
$creadsPrec :: Int -> ReadS KinesisFirehoseInputUpdate
Prelude.Read, Int -> KinesisFirehoseInputUpdate -> ShowS
[KinesisFirehoseInputUpdate] -> ShowS
KinesisFirehoseInputUpdate -> String
(Int -> KinesisFirehoseInputUpdate -> ShowS)
-> (KinesisFirehoseInputUpdate -> String)
-> ([KinesisFirehoseInputUpdate] -> ShowS)
-> Show KinesisFirehoseInputUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisFirehoseInputUpdate] -> ShowS
$cshowList :: [KinesisFirehoseInputUpdate] -> ShowS
show :: KinesisFirehoseInputUpdate -> String
$cshow :: KinesisFirehoseInputUpdate -> String
showsPrec :: Int -> KinesisFirehoseInputUpdate -> ShowS
$cshowsPrec :: Int -> KinesisFirehoseInputUpdate -> ShowS
Prelude.Show, (forall x.
 KinesisFirehoseInputUpdate -> Rep KinesisFirehoseInputUpdate x)
-> (forall x.
    Rep KinesisFirehoseInputUpdate x -> KinesisFirehoseInputUpdate)
-> Generic KinesisFirehoseInputUpdate
forall x.
Rep KinesisFirehoseInputUpdate x -> KinesisFirehoseInputUpdate
forall x.
KinesisFirehoseInputUpdate -> Rep KinesisFirehoseInputUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisFirehoseInputUpdate x -> KinesisFirehoseInputUpdate
$cfrom :: forall x.
KinesisFirehoseInputUpdate -> Rep KinesisFirehoseInputUpdate x
Prelude.Generic)

-- |
-- Create a value of 'KinesisFirehoseInputUpdate' 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', 'kinesisFirehoseInputUpdate_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', 'kinesisFirehoseInputUpdate_resourceARNUpdate' - Amazon Resource Name (ARN) of the input Amazon Kinesis Firehose delivery
-- stream to read.
newKinesisFirehoseInputUpdate ::
  KinesisFirehoseInputUpdate
newKinesisFirehoseInputUpdate :: KinesisFirehoseInputUpdate
newKinesisFirehoseInputUpdate =
  KinesisFirehoseInputUpdate' :: Maybe Text -> Maybe Text -> KinesisFirehoseInputUpdate
KinesisFirehoseInputUpdate'
    { $sel:roleARNUpdate:KinesisFirehoseInputUpdate' :: Maybe Text
roleARNUpdate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARNUpdate:KinesisFirehoseInputUpdate' :: 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.
kinesisFirehoseInputUpdate_roleARNUpdate :: Lens.Lens' KinesisFirehoseInputUpdate (Prelude.Maybe Prelude.Text)
kinesisFirehoseInputUpdate_roleARNUpdate :: (Maybe Text -> f (Maybe Text))
-> KinesisFirehoseInputUpdate -> f KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate_roleARNUpdate = (KinesisFirehoseInputUpdate -> Maybe Text)
-> (KinesisFirehoseInputUpdate
    -> Maybe Text -> KinesisFirehoseInputUpdate)
-> Lens
     KinesisFirehoseInputUpdate
     KinesisFirehoseInputUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseInputUpdate' {Maybe Text
roleARNUpdate :: Maybe Text
$sel:roleARNUpdate:KinesisFirehoseInputUpdate' :: KinesisFirehoseInputUpdate -> Maybe Text
roleARNUpdate} -> Maybe Text
roleARNUpdate) (\s :: KinesisFirehoseInputUpdate
s@KinesisFirehoseInputUpdate' {} Maybe Text
a -> KinesisFirehoseInputUpdate
s {$sel:roleARNUpdate:KinesisFirehoseInputUpdate' :: Maybe Text
roleARNUpdate = Maybe Text
a} :: KinesisFirehoseInputUpdate)

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

instance Prelude.Hashable KinesisFirehoseInputUpdate

instance Prelude.NFData KinesisFirehoseInputUpdate

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