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

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

-- | For a SQL-based Kinesis Data Analytics application\'s output, describes
-- the Kinesis Data Firehose delivery stream that is configured as its
-- destination.
--
-- /See:/ 'newKinesisFirehoseOutputDescription' smart constructor.
data KinesisFirehoseOutputDescription = KinesisFirehoseOutputDescription'
  { -- | The ARN of the IAM role that Kinesis Data Analytics can assume 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.
    KinesisFirehoseOutputDescription -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the delivery stream.
    KinesisFirehoseOutputDescription -> Text
resourceARN :: Prelude.Text
  }
  deriving (KinesisFirehoseOutputDescription
-> KinesisFirehoseOutputDescription -> Bool
(KinesisFirehoseOutputDescription
 -> KinesisFirehoseOutputDescription -> Bool)
-> (KinesisFirehoseOutputDescription
    -> KinesisFirehoseOutputDescription -> Bool)
-> Eq KinesisFirehoseOutputDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisFirehoseOutputDescription
-> KinesisFirehoseOutputDescription -> Bool
$c/= :: KinesisFirehoseOutputDescription
-> KinesisFirehoseOutputDescription -> Bool
== :: KinesisFirehoseOutputDescription
-> KinesisFirehoseOutputDescription -> Bool
$c== :: KinesisFirehoseOutputDescription
-> KinesisFirehoseOutputDescription -> Bool
Prelude.Eq, ReadPrec [KinesisFirehoseOutputDescription]
ReadPrec KinesisFirehoseOutputDescription
Int -> ReadS KinesisFirehoseOutputDescription
ReadS [KinesisFirehoseOutputDescription]
(Int -> ReadS KinesisFirehoseOutputDescription)
-> ReadS [KinesisFirehoseOutputDescription]
-> ReadPrec KinesisFirehoseOutputDescription
-> ReadPrec [KinesisFirehoseOutputDescription]
-> Read KinesisFirehoseOutputDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisFirehoseOutputDescription]
$creadListPrec :: ReadPrec [KinesisFirehoseOutputDescription]
readPrec :: ReadPrec KinesisFirehoseOutputDescription
$creadPrec :: ReadPrec KinesisFirehoseOutputDescription
readList :: ReadS [KinesisFirehoseOutputDescription]
$creadList :: ReadS [KinesisFirehoseOutputDescription]
readsPrec :: Int -> ReadS KinesisFirehoseOutputDescription
$creadsPrec :: Int -> ReadS KinesisFirehoseOutputDescription
Prelude.Read, Int -> KinesisFirehoseOutputDescription -> ShowS
[KinesisFirehoseOutputDescription] -> ShowS
KinesisFirehoseOutputDescription -> String
(Int -> KinesisFirehoseOutputDescription -> ShowS)
-> (KinesisFirehoseOutputDescription -> String)
-> ([KinesisFirehoseOutputDescription] -> ShowS)
-> Show KinesisFirehoseOutputDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisFirehoseOutputDescription] -> ShowS
$cshowList :: [KinesisFirehoseOutputDescription] -> ShowS
show :: KinesisFirehoseOutputDescription -> String
$cshow :: KinesisFirehoseOutputDescription -> String
showsPrec :: Int -> KinesisFirehoseOutputDescription -> ShowS
$cshowsPrec :: Int -> KinesisFirehoseOutputDescription -> ShowS
Prelude.Show, (forall x.
 KinesisFirehoseOutputDescription
 -> Rep KinesisFirehoseOutputDescription x)
-> (forall x.
    Rep KinesisFirehoseOutputDescription x
    -> KinesisFirehoseOutputDescription)
-> Generic KinesisFirehoseOutputDescription
forall x.
Rep KinesisFirehoseOutputDescription x
-> KinesisFirehoseOutputDescription
forall x.
KinesisFirehoseOutputDescription
-> Rep KinesisFirehoseOutputDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KinesisFirehoseOutputDescription x
-> KinesisFirehoseOutputDescription
$cfrom :: forall x.
KinesisFirehoseOutputDescription
-> Rep KinesisFirehoseOutputDescription x
Prelude.Generic)

-- |
-- Create a value of 'KinesisFirehoseOutputDescription' 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', 'kinesisFirehoseOutputDescription_roleARN' - The ARN of the IAM role that Kinesis Data Analytics can assume 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', 'kinesisFirehoseOutputDescription_resourceARN' - The Amazon Resource Name (ARN) of the delivery stream.
newKinesisFirehoseOutputDescription ::
  -- | 'resourceARN'
  Prelude.Text ->
  KinesisFirehoseOutputDescription
newKinesisFirehoseOutputDescription :: Text -> KinesisFirehoseOutputDescription
newKinesisFirehoseOutputDescription Text
pResourceARN_ =
  KinesisFirehoseOutputDescription' :: Maybe Text -> Text -> KinesisFirehoseOutputDescription
KinesisFirehoseOutputDescription'
    { $sel:roleARN:KinesisFirehoseOutputDescription' :: Maybe Text
roleARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARN:KinesisFirehoseOutputDescription' :: Text
resourceARN = Text
pResourceARN_
    }

-- | The ARN of the IAM role that Kinesis Data Analytics can assume 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.
kinesisFirehoseOutputDescription_roleARN :: Lens.Lens' KinesisFirehoseOutputDescription (Prelude.Maybe Prelude.Text)
kinesisFirehoseOutputDescription_roleARN :: (Maybe Text -> f (Maybe Text))
-> KinesisFirehoseOutputDescription
-> f KinesisFirehoseOutputDescription
kinesisFirehoseOutputDescription_roleARN = (KinesisFirehoseOutputDescription -> Maybe Text)
-> (KinesisFirehoseOutputDescription
    -> Maybe Text -> KinesisFirehoseOutputDescription)
-> Lens
     KinesisFirehoseOutputDescription
     KinesisFirehoseOutputDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseOutputDescription' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:KinesisFirehoseOutputDescription' :: KinesisFirehoseOutputDescription -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: KinesisFirehoseOutputDescription
s@KinesisFirehoseOutputDescription' {} Maybe Text
a -> KinesisFirehoseOutputDescription
s {$sel:roleARN:KinesisFirehoseOutputDescription' :: Maybe Text
roleARN = Maybe Text
a} :: KinesisFirehoseOutputDescription)

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

instance
  Core.FromJSON
    KinesisFirehoseOutputDescription
  where
  parseJSON :: Value -> Parser KinesisFirehoseOutputDescription
parseJSON =
    String
-> (Object -> Parser KinesisFirehoseOutputDescription)
-> Value
-> Parser KinesisFirehoseOutputDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KinesisFirehoseOutputDescription"
      ( \Object
x ->
          Maybe Text -> Text -> KinesisFirehoseOutputDescription
KinesisFirehoseOutputDescription'
            (Maybe Text -> Text -> KinesisFirehoseOutputDescription)
-> Parser (Maybe Text)
-> Parser (Text -> KinesisFirehoseOutputDescription)
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 -> KinesisFirehoseOutputDescription)
-> Parser Text -> Parser KinesisFirehoseOutputDescription
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
    KinesisFirehoseOutputDescription

instance
  Prelude.NFData
    KinesisFirehoseOutputDescription