{-# 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.KinesisAnalyticsV2.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.KinesisAnalyticsV2.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 Data Firehose delivery stream that is
-- configured as the streaming source in the application input
-- configuration.
--
-- /See:/ 'newKinesisFirehoseInputDescription' smart constructor.
data KinesisFirehoseInputDescription = KinesisFirehoseInputDescription'
  { -- | The ARN of the IAM role that Kinesis Data Analytics assumes to access
    -- the stream.
    --
    -- Provided for backward compatibility. Applications that are created with
    -- the current API version have an application-level service execution role
    -- rather than a resource-level role.
    KinesisFirehoseInputDescription -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the delivery stream.
    KinesisFirehoseInputDescription -> Text
resourceARN :: 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:
--
-- 'roleARN', 'kinesisFirehoseInputDescription_roleARN' - The ARN of the IAM role that Kinesis Data Analytics assumes to access
-- the stream.
--
-- Provided for backward compatibility. Applications that are created with
-- the current API version have an application-level service execution role
-- rather than a resource-level role.
--
-- 'resourceARN', 'kinesisFirehoseInputDescription_resourceARN' - The Amazon Resource Name (ARN) of the delivery stream.
newKinesisFirehoseInputDescription ::
  -- | 'resourceARN'
  Prelude.Text ->
  KinesisFirehoseInputDescription
newKinesisFirehoseInputDescription :: Text -> KinesisFirehoseInputDescription
newKinesisFirehoseInputDescription Text
pResourceARN_ =
  KinesisFirehoseInputDescription' :: Maybe Text -> Text -> KinesisFirehoseInputDescription
KinesisFirehoseInputDescription'
    { $sel:roleARN:KinesisFirehoseInputDescription' :: Maybe Text
roleARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARN:KinesisFirehoseInputDescription' :: Text
resourceARN = Text
pResourceARN_
    }

-- | The ARN of the IAM role that Kinesis Data Analytics assumes to access
-- the stream.
--
-- Provided for backward compatibility. Applications that are created with
-- the current API version have an application-level service execution role
-- rather than a resource-level role.
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)

-- | The Amazon Resource Name (ARN) of the delivery stream.
kinesisFirehoseInputDescription_resourceARN :: Lens.Lens' KinesisFirehoseInputDescription Prelude.Text
kinesisFirehoseInputDescription_resourceARN :: (Text -> f Text)
-> KinesisFirehoseInputDescription
-> f KinesisFirehoseInputDescription
kinesisFirehoseInputDescription_resourceARN = (KinesisFirehoseInputDescription -> Text)
-> (KinesisFirehoseInputDescription
    -> Text -> KinesisFirehoseInputDescription)
-> Lens
     KinesisFirehoseInputDescription
     KinesisFirehoseInputDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseInputDescription' {Text
resourceARN :: Text
$sel:resourceARN:KinesisFirehoseInputDescription' :: KinesisFirehoseInputDescription -> Text
resourceARN} -> Text
resourceARN) (\s :: KinesisFirehoseInputDescription
s@KinesisFirehoseInputDescription' {} Text
a -> KinesisFirehoseInputDescription
s {$sel:resourceARN:KinesisFirehoseInputDescription' :: Text
resourceARN = 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 -> Text -> KinesisFirehoseInputDescription
KinesisFirehoseInputDescription'
            (Maybe Text -> Text -> KinesisFirehoseInputDescription)
-> Parser (Maybe Text)
-> Parser (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
"RoleARN")
            Parser (Text -> KinesisFirehoseInputDescription)
-> Parser Text -> Parser KinesisFirehoseInputDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ResourceARN")
      )

instance
  Prelude.Hashable
    KinesisFirehoseInputDescription

instance
  Prelude.NFData
    KinesisFirehoseInputDescription