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

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

-- | Identifies an Amazon Kinesis Firehose delivery stream as the streaming
-- source. You provide the delivery stream\'s Amazon Resource Name (ARN)
-- and an IAM role ARN that enables Amazon Kinesis Analytics to access the
-- stream on your behalf.
--
-- /See:/ 'newKinesisFirehoseInput' smart constructor.
data KinesisFirehoseInput = KinesisFirehoseInput'
  { -- | ARN of the input delivery stream.
    KinesisFirehoseInput -> Text
resourceARN :: Prelude.Text,
    -- | ARN of the IAM role that Amazon Kinesis Analytics can assume to access
    -- the stream on your behalf. You need to make sure that the role has the
    -- necessary permissions to access the stream.
    KinesisFirehoseInput -> Text
roleARN :: Prelude.Text
  }
  deriving (KinesisFirehoseInput -> KinesisFirehoseInput -> Bool
(KinesisFirehoseInput -> KinesisFirehoseInput -> Bool)
-> (KinesisFirehoseInput -> KinesisFirehoseInput -> Bool)
-> Eq KinesisFirehoseInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisFirehoseInput -> KinesisFirehoseInput -> Bool
$c/= :: KinesisFirehoseInput -> KinesisFirehoseInput -> Bool
== :: KinesisFirehoseInput -> KinesisFirehoseInput -> Bool
$c== :: KinesisFirehoseInput -> KinesisFirehoseInput -> Bool
Prelude.Eq, ReadPrec [KinesisFirehoseInput]
ReadPrec KinesisFirehoseInput
Int -> ReadS KinesisFirehoseInput
ReadS [KinesisFirehoseInput]
(Int -> ReadS KinesisFirehoseInput)
-> ReadS [KinesisFirehoseInput]
-> ReadPrec KinesisFirehoseInput
-> ReadPrec [KinesisFirehoseInput]
-> Read KinesisFirehoseInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisFirehoseInput]
$creadListPrec :: ReadPrec [KinesisFirehoseInput]
readPrec :: ReadPrec KinesisFirehoseInput
$creadPrec :: ReadPrec KinesisFirehoseInput
readList :: ReadS [KinesisFirehoseInput]
$creadList :: ReadS [KinesisFirehoseInput]
readsPrec :: Int -> ReadS KinesisFirehoseInput
$creadsPrec :: Int -> ReadS KinesisFirehoseInput
Prelude.Read, Int -> KinesisFirehoseInput -> ShowS
[KinesisFirehoseInput] -> ShowS
KinesisFirehoseInput -> String
(Int -> KinesisFirehoseInput -> ShowS)
-> (KinesisFirehoseInput -> String)
-> ([KinesisFirehoseInput] -> ShowS)
-> Show KinesisFirehoseInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisFirehoseInput] -> ShowS
$cshowList :: [KinesisFirehoseInput] -> ShowS
show :: KinesisFirehoseInput -> String
$cshow :: KinesisFirehoseInput -> String
showsPrec :: Int -> KinesisFirehoseInput -> ShowS
$cshowsPrec :: Int -> KinesisFirehoseInput -> ShowS
Prelude.Show, (forall x. KinesisFirehoseInput -> Rep KinesisFirehoseInput x)
-> (forall x. Rep KinesisFirehoseInput x -> KinesisFirehoseInput)
-> Generic KinesisFirehoseInput
forall x. Rep KinesisFirehoseInput x -> KinesisFirehoseInput
forall x. KinesisFirehoseInput -> Rep KinesisFirehoseInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisFirehoseInput x -> KinesisFirehoseInput
$cfrom :: forall x. KinesisFirehoseInput -> Rep KinesisFirehoseInput x
Prelude.Generic)

-- |
-- Create a value of 'KinesisFirehoseInput' 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', 'kinesisFirehoseInput_resourceARN' - ARN of the input delivery stream.
--
-- 'roleARN', 'kinesisFirehoseInput_roleARN' - ARN of the IAM role that Amazon Kinesis Analytics can assume to access
-- the stream on your behalf. You need to make sure that the role has the
-- necessary permissions to access the stream.
newKinesisFirehoseInput ::
  -- | 'resourceARN'
  Prelude.Text ->
  -- | 'roleARN'
  Prelude.Text ->
  KinesisFirehoseInput
newKinesisFirehoseInput :: Text -> Text -> KinesisFirehoseInput
newKinesisFirehoseInput Text
pResourceARN_ Text
pRoleARN_ =
  KinesisFirehoseInput' :: Text -> Text -> KinesisFirehoseInput
KinesisFirehoseInput'
    { $sel:resourceARN:KinesisFirehoseInput' :: Text
resourceARN = Text
pResourceARN_,
      $sel:roleARN:KinesisFirehoseInput' :: Text
roleARN = Text
pRoleARN_
    }

-- | ARN of the input delivery stream.
kinesisFirehoseInput_resourceARN :: Lens.Lens' KinesisFirehoseInput Prelude.Text
kinesisFirehoseInput_resourceARN :: (Text -> f Text) -> KinesisFirehoseInput -> f KinesisFirehoseInput
kinesisFirehoseInput_resourceARN = (KinesisFirehoseInput -> Text)
-> (KinesisFirehoseInput -> Text -> KinesisFirehoseInput)
-> Lens KinesisFirehoseInput KinesisFirehoseInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseInput' {Text
resourceARN :: Text
$sel:resourceARN:KinesisFirehoseInput' :: KinesisFirehoseInput -> Text
resourceARN} -> Text
resourceARN) (\s :: KinesisFirehoseInput
s@KinesisFirehoseInput' {} Text
a -> KinesisFirehoseInput
s {$sel:resourceARN:KinesisFirehoseInput' :: Text
resourceARN = Text
a} :: KinesisFirehoseInput)

-- | ARN of the IAM role that Amazon Kinesis Analytics can assume to access
-- the stream on your behalf. You need to make sure that the role has the
-- necessary permissions to access the stream.
kinesisFirehoseInput_roleARN :: Lens.Lens' KinesisFirehoseInput Prelude.Text
kinesisFirehoseInput_roleARN :: (Text -> f Text) -> KinesisFirehoseInput -> f KinesisFirehoseInput
kinesisFirehoseInput_roleARN = (KinesisFirehoseInput -> Text)
-> (KinesisFirehoseInput -> Text -> KinesisFirehoseInput)
-> Lens KinesisFirehoseInput KinesisFirehoseInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseInput' {Text
roleARN :: Text
$sel:roleARN:KinesisFirehoseInput' :: KinesisFirehoseInput -> Text
roleARN} -> Text
roleARN) (\s :: KinesisFirehoseInput
s@KinesisFirehoseInput' {} Text
a -> KinesisFirehoseInput
s {$sel:roleARN:KinesisFirehoseInput' :: Text
roleARN = Text
a} :: KinesisFirehoseInput)

instance Prelude.Hashable KinesisFirehoseInput

instance Prelude.NFData KinesisFirehoseInput

instance Core.ToJSON KinesisFirehoseInput where
  toJSON :: KinesisFirehoseInput -> Value
toJSON KinesisFirehoseInput' {Text
roleARN :: Text
resourceARN :: Text
$sel:roleARN:KinesisFirehoseInput' :: KinesisFirehoseInput -> Text
$sel:resourceARN:KinesisFirehoseInput' :: KinesisFirehoseInput -> 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
"ResourceARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceARN),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleARN)
          ]
      )