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

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

-- | Describes the Amazon Kinesis Firehose delivery stream that is configured
-- as the streaming source in the application input configuration.
--
-- /See:/ 'newKinesisFirehoseInputDescription' smart constructor.
data KinesisFirehoseInputDescription = KinesisFirehoseInputDescription'
  { -- | Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery
    -- stream.
    KinesisFirehoseInputDescription -> Maybe Text
resourceARN :: Prelude.Maybe Prelude.Text,
    -- | ARN of the IAM role that Amazon Kinesis Analytics assumes to access the
    -- stream.
    KinesisFirehoseInputDescription -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text
  }
  deriving (KinesisFirehoseInputDescription
-> KinesisFirehoseInputDescription -> Bool
(KinesisFirehoseInputDescription
 -> KinesisFirehoseInputDescription -> Bool)
-> (KinesisFirehoseInputDescription
    -> KinesisFirehoseInputDescription -> Bool)
-> Eq KinesisFirehoseInputDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisFirehoseInputDescription
-> KinesisFirehoseInputDescription -> Bool
$c/= :: KinesisFirehoseInputDescription
-> KinesisFirehoseInputDescription -> Bool
== :: KinesisFirehoseInputDescription
-> KinesisFirehoseInputDescription -> Bool
$c== :: KinesisFirehoseInputDescription
-> KinesisFirehoseInputDescription -> Bool
Prelude.Eq, ReadPrec [KinesisFirehoseInputDescription]
ReadPrec KinesisFirehoseInputDescription
Int -> ReadS KinesisFirehoseInputDescription
ReadS [KinesisFirehoseInputDescription]
(Int -> ReadS KinesisFirehoseInputDescription)
-> ReadS [KinesisFirehoseInputDescription]
-> ReadPrec KinesisFirehoseInputDescription
-> ReadPrec [KinesisFirehoseInputDescription]
-> Read KinesisFirehoseInputDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisFirehoseInputDescription]
$creadListPrec :: ReadPrec [KinesisFirehoseInputDescription]
readPrec :: ReadPrec KinesisFirehoseInputDescription
$creadPrec :: ReadPrec KinesisFirehoseInputDescription
readList :: ReadS [KinesisFirehoseInputDescription]
$creadList :: ReadS [KinesisFirehoseInputDescription]
readsPrec :: Int -> ReadS KinesisFirehoseInputDescription
$creadsPrec :: Int -> ReadS KinesisFirehoseInputDescription
Prelude.Read, Int -> KinesisFirehoseInputDescription -> ShowS
[KinesisFirehoseInputDescription] -> ShowS
KinesisFirehoseInputDescription -> String
(Int -> KinesisFirehoseInputDescription -> ShowS)
-> (KinesisFirehoseInputDescription -> String)
-> ([KinesisFirehoseInputDescription] -> ShowS)
-> Show KinesisFirehoseInputDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisFirehoseInputDescription] -> ShowS
$cshowList :: [KinesisFirehoseInputDescription] -> ShowS
show :: KinesisFirehoseInputDescription -> String
$cshow :: KinesisFirehoseInputDescription -> String
showsPrec :: Int -> KinesisFirehoseInputDescription -> ShowS
$cshowsPrec :: Int -> KinesisFirehoseInputDescription -> ShowS
Prelude.Show, (forall x.
 KinesisFirehoseInputDescription
 -> Rep KinesisFirehoseInputDescription x)
-> (forall x.
    Rep KinesisFirehoseInputDescription x
    -> KinesisFirehoseInputDescription)
-> Generic KinesisFirehoseInputDescription
forall x.
Rep KinesisFirehoseInputDescription x
-> KinesisFirehoseInputDescription
forall x.
KinesisFirehoseInputDescription
-> Rep KinesisFirehoseInputDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisFirehoseInputDescription x
-> KinesisFirehoseInputDescription
$cfrom :: forall x.
KinesisFirehoseInputDescription
-> Rep KinesisFirehoseInputDescription x
Prelude.Generic)

-- |
-- Create a value of 'KinesisFirehoseInputDescription' 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', 'kinesisFirehoseInputDescription_resourceARN' - Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery
-- stream.
--
-- 'roleARN', 'kinesisFirehoseInputDescription_roleARN' - ARN of the IAM role that Amazon Kinesis Analytics assumes to access the
-- stream.
newKinesisFirehoseInputDescription ::
  KinesisFirehoseInputDescription
newKinesisFirehoseInputDescription :: KinesisFirehoseInputDescription
newKinesisFirehoseInputDescription =
  KinesisFirehoseInputDescription' :: Maybe Text -> Maybe Text -> KinesisFirehoseInputDescription
KinesisFirehoseInputDescription'
    { $sel:resourceARN:KinesisFirehoseInputDescription' :: Maybe Text
resourceARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:KinesisFirehoseInputDescription' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | ARN of the IAM role that Amazon Kinesis Analytics assumes to access the
-- stream.
kinesisFirehoseInputDescription_roleARN :: Lens.Lens' KinesisFirehoseInputDescription (Prelude.Maybe Prelude.Text)
kinesisFirehoseInputDescription_roleARN :: (Maybe Text -> f (Maybe Text))
-> KinesisFirehoseInputDescription
-> f KinesisFirehoseInputDescription
kinesisFirehoseInputDescription_roleARN = (KinesisFirehoseInputDescription -> Maybe Text)
-> (KinesisFirehoseInputDescription
    -> Maybe Text -> KinesisFirehoseInputDescription)
-> Lens
     KinesisFirehoseInputDescription
     KinesisFirehoseInputDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseInputDescription' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:KinesisFirehoseInputDescription' :: KinesisFirehoseInputDescription -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: KinesisFirehoseInputDescription
s@KinesisFirehoseInputDescription' {} Maybe Text
a -> KinesisFirehoseInputDescription
s {$sel:roleARN:KinesisFirehoseInputDescription' :: Maybe Text
roleARN = Maybe Text
a} :: KinesisFirehoseInputDescription)

instance
  Core.FromJSON
    KinesisFirehoseInputDescription
  where
  parseJSON :: Value -> Parser KinesisFirehoseInputDescription
parseJSON =
    String
-> (Object -> Parser KinesisFirehoseInputDescription)
-> Value
-> Parser KinesisFirehoseInputDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KinesisFirehoseInputDescription"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> KinesisFirehoseInputDescription
KinesisFirehoseInputDescription'
            (Maybe Text -> Maybe Text -> KinesisFirehoseInputDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> KinesisFirehoseInputDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceARN")
            Parser (Maybe Text -> KinesisFirehoseInputDescription)
-> Parser (Maybe Text) -> Parser KinesisFirehoseInputDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RoleARN")
      )

instance
  Prelude.Hashable
    KinesisFirehoseInputDescription

instance
  Prelude.NFData
    KinesisFirehoseInputDescription