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

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

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

-- |
-- Create a value of 'KinesisStreamsOutputDescription' 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', 'kinesisStreamsOutputDescription_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', 'kinesisStreamsOutputDescription_resourceARN' - The Amazon Resource Name (ARN) of the Kinesis data stream.
newKinesisStreamsOutputDescription ::
  -- | 'resourceARN'
  Prelude.Text ->
  KinesisStreamsOutputDescription
newKinesisStreamsOutputDescription :: Text -> KinesisStreamsOutputDescription
newKinesisStreamsOutputDescription Text
pResourceARN_ =
  KinesisStreamsOutputDescription' :: Maybe Text -> Text -> KinesisStreamsOutputDescription
KinesisStreamsOutputDescription'
    { $sel:roleARN:KinesisStreamsOutputDescription' :: Maybe Text
roleARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARN:KinesisStreamsOutputDescription' :: 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.
kinesisStreamsOutputDescription_roleARN :: Lens.Lens' KinesisStreamsOutputDescription (Prelude.Maybe Prelude.Text)
kinesisStreamsOutputDescription_roleARN :: (Maybe Text -> f (Maybe Text))
-> KinesisStreamsOutputDescription
-> f KinesisStreamsOutputDescription
kinesisStreamsOutputDescription_roleARN = (KinesisStreamsOutputDescription -> Maybe Text)
-> (KinesisStreamsOutputDescription
    -> Maybe Text -> KinesisStreamsOutputDescription)
-> Lens
     KinesisStreamsOutputDescription
     KinesisStreamsOutputDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamsOutputDescription' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:KinesisStreamsOutputDescription' :: KinesisStreamsOutputDescription -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: KinesisStreamsOutputDescription
s@KinesisStreamsOutputDescription' {} Maybe Text
a -> KinesisStreamsOutputDescription
s {$sel:roleARN:KinesisStreamsOutputDescription' :: Maybe Text
roleARN = Maybe Text
a} :: KinesisStreamsOutputDescription)

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

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

instance
  Prelude.NFData
    KinesisStreamsOutputDescription