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

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

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

-- |
-- Create a value of 'KinesisStreamsInputDescription' 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', 'kinesisStreamsInputDescription_resourceARN' - Amazon Resource Name (ARN) of the Amazon Kinesis stream.
--
-- 'roleARN', 'kinesisStreamsInputDescription_roleARN' - ARN of the IAM role that Amazon Kinesis Analytics can assume to access
-- the stream.
newKinesisStreamsInputDescription ::
  KinesisStreamsInputDescription
newKinesisStreamsInputDescription :: KinesisStreamsInputDescription
newKinesisStreamsInputDescription =
  KinesisStreamsInputDescription' :: Maybe Text -> Maybe Text -> KinesisStreamsInputDescription
KinesisStreamsInputDescription'
    { $sel:resourceARN:KinesisStreamsInputDescription' :: Maybe Text
resourceARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:KinesisStreamsInputDescription' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

instance
  Prelude.NFData
    KinesisStreamsInputDescription