{-# 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.Connect.Types.KinesisStreamConfig
-- 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.Connect.Types.KinesisStreamConfig where

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

-- | Configuration information of a Kinesis data stream.
--
-- /See:/ 'newKinesisStreamConfig' smart constructor.
data KinesisStreamConfig = KinesisStreamConfig'
  { -- | The Amazon Resource Name (ARN) of the data stream.
    KinesisStreamConfig -> Text
streamArn :: Prelude.Text
  }
  deriving (KinesisStreamConfig -> KinesisStreamConfig -> Bool
(KinesisStreamConfig -> KinesisStreamConfig -> Bool)
-> (KinesisStreamConfig -> KinesisStreamConfig -> Bool)
-> Eq KinesisStreamConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
$c/= :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
== :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
$c== :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
Prelude.Eq, ReadPrec [KinesisStreamConfig]
ReadPrec KinesisStreamConfig
Int -> ReadS KinesisStreamConfig
ReadS [KinesisStreamConfig]
(Int -> ReadS KinesisStreamConfig)
-> ReadS [KinesisStreamConfig]
-> ReadPrec KinesisStreamConfig
-> ReadPrec [KinesisStreamConfig]
-> Read KinesisStreamConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamConfig]
$creadListPrec :: ReadPrec [KinesisStreamConfig]
readPrec :: ReadPrec KinesisStreamConfig
$creadPrec :: ReadPrec KinesisStreamConfig
readList :: ReadS [KinesisStreamConfig]
$creadList :: ReadS [KinesisStreamConfig]
readsPrec :: Int -> ReadS KinesisStreamConfig
$creadsPrec :: Int -> ReadS KinesisStreamConfig
Prelude.Read, Int -> KinesisStreamConfig -> ShowS
[KinesisStreamConfig] -> ShowS
KinesisStreamConfig -> String
(Int -> KinesisStreamConfig -> ShowS)
-> (KinesisStreamConfig -> String)
-> ([KinesisStreamConfig] -> ShowS)
-> Show KinesisStreamConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamConfig] -> ShowS
$cshowList :: [KinesisStreamConfig] -> ShowS
show :: KinesisStreamConfig -> String
$cshow :: KinesisStreamConfig -> String
showsPrec :: Int -> KinesisStreamConfig -> ShowS
$cshowsPrec :: Int -> KinesisStreamConfig -> ShowS
Prelude.Show, (forall x. KinesisStreamConfig -> Rep KinesisStreamConfig x)
-> (forall x. Rep KinesisStreamConfig x -> KinesisStreamConfig)
-> Generic KinesisStreamConfig
forall x. Rep KinesisStreamConfig x -> KinesisStreamConfig
forall x. KinesisStreamConfig -> Rep KinesisStreamConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisStreamConfig x -> KinesisStreamConfig
$cfrom :: forall x. KinesisStreamConfig -> Rep KinesisStreamConfig x
Prelude.Generic)

-- |
-- Create a value of 'KinesisStreamConfig' 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:
--
-- 'streamArn', 'kinesisStreamConfig_streamArn' - The Amazon Resource Name (ARN) of the data stream.
newKinesisStreamConfig ::
  -- | 'streamArn'
  Prelude.Text ->
  KinesisStreamConfig
newKinesisStreamConfig :: Text -> KinesisStreamConfig
newKinesisStreamConfig Text
pStreamArn_ =
  KinesisStreamConfig' :: Text -> KinesisStreamConfig
KinesisStreamConfig' {$sel:streamArn:KinesisStreamConfig' :: Text
streamArn = Text
pStreamArn_}

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

instance Core.FromJSON KinesisStreamConfig where
  parseJSON :: Value -> Parser KinesisStreamConfig
parseJSON =
    String
-> (Object -> Parser KinesisStreamConfig)
-> Value
-> Parser KinesisStreamConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KinesisStreamConfig"
      ( \Object
x ->
          Text -> KinesisStreamConfig
KinesisStreamConfig'
            (Text -> KinesisStreamConfig)
-> Parser Text -> Parser KinesisStreamConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StreamArn")
      )

instance Prelude.Hashable KinesisStreamConfig

instance Prelude.NFData KinesisStreamConfig

instance Core.ToJSON KinesisStreamConfig where
  toJSON :: KinesisStreamConfig -> Value
toJSON KinesisStreamConfig' {Text
streamArn :: Text
$sel:streamArn:KinesisStreamConfig' :: KinesisStreamConfig -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamArn)]
      )