{-# 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 #-}
module Amazonka.Connect.Types.KinesisStreamConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data KinesisStreamConfig = KinesisStreamConfig'
{
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)
newKinesisStreamConfig ::
Prelude.Text ->
KinesisStreamConfig
newKinesisStreamConfig :: Text -> KinesisStreamConfig
newKinesisStreamConfig Text
pStreamArn_ =
KinesisStreamConfig' :: Text -> KinesisStreamConfig
KinesisStreamConfig' {$sel:streamArn:KinesisStreamConfig' :: Text
streamArn = Text
pStreamArn_}
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)]
)