{-# 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.DynamoDBStreams.Types.Stream where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDBStreams.Internal
import qualified Amazonka.Prelude as Prelude
data Stream = Stream'
{
Stream -> Maybe Text
streamArn :: Prelude.Maybe Prelude.Text,
Stream -> Maybe Text
streamLabel :: Prelude.Maybe Prelude.Text,
Stream -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text
}
deriving (Stream -> Stream -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Stream -> Stream -> Bool
$c/= :: Stream -> Stream -> Bool
== :: Stream -> Stream -> Bool
$c== :: Stream -> Stream -> Bool
Prelude.Eq, ReadPrec [Stream]
ReadPrec Stream
Int -> ReadS Stream
ReadS [Stream]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Stream]
$creadListPrec :: ReadPrec [Stream]
readPrec :: ReadPrec Stream
$creadPrec :: ReadPrec Stream
readList :: ReadS [Stream]
$creadList :: ReadS [Stream]
readsPrec :: Int -> ReadS Stream
$creadsPrec :: Int -> ReadS Stream
Prelude.Read, Int -> Stream -> ShowS
[Stream] -> ShowS
Stream -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Stream] -> ShowS
$cshowList :: [Stream] -> ShowS
show :: Stream -> String
$cshow :: Stream -> String
showsPrec :: Int -> Stream -> ShowS
$cshowsPrec :: Int -> Stream -> ShowS
Prelude.Show, forall x. Rep Stream x -> Stream
forall x. Stream -> Rep Stream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Stream x -> Stream
$cfrom :: forall x. Stream -> Rep Stream x
Prelude.Generic)
newStream ::
Stream
newStream :: Stream
newStream =
Stream'
{ $sel:streamArn:Stream' :: Maybe Text
streamArn = forall a. Maybe a
Prelude.Nothing,
$sel:streamLabel:Stream' :: Maybe Text
streamLabel = forall a. Maybe a
Prelude.Nothing,
$sel:tableName:Stream' :: Maybe Text
tableName = forall a. Maybe a
Prelude.Nothing
}
stream_streamArn :: Lens.Lens' Stream (Prelude.Maybe Prelude.Text)
stream_streamArn :: Lens' Stream (Maybe Text)
stream_streamArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stream' {Maybe Text
streamArn :: Maybe Text
$sel:streamArn:Stream' :: Stream -> Maybe Text
streamArn} -> Maybe Text
streamArn) (\s :: Stream
s@Stream' {} Maybe Text
a -> Stream
s {$sel:streamArn:Stream' :: Maybe Text
streamArn = Maybe Text
a} :: Stream)
stream_streamLabel :: Lens.Lens' Stream (Prelude.Maybe Prelude.Text)
stream_streamLabel :: Lens' Stream (Maybe Text)
stream_streamLabel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stream' {Maybe Text
streamLabel :: Maybe Text
$sel:streamLabel:Stream' :: Stream -> Maybe Text
streamLabel} -> Maybe Text
streamLabel) (\s :: Stream
s@Stream' {} Maybe Text
a -> Stream
s {$sel:streamLabel:Stream' :: Maybe Text
streamLabel = Maybe Text
a} :: Stream)
stream_tableName :: Lens.Lens' Stream (Prelude.Maybe Prelude.Text)
stream_tableName :: Lens' Stream (Maybe Text)
stream_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stream' {Maybe Text
tableName :: Maybe Text
$sel:tableName:Stream' :: Stream -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: Stream
s@Stream' {} Maybe Text
a -> Stream
s {$sel:tableName:Stream' :: Maybe Text
tableName = Maybe Text
a} :: Stream)
instance Data.FromJSON Stream where
parseJSON :: Value -> Parser Stream
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Stream"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Stream
Stream'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StreamArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StreamLabel")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TableName")
)
instance Prelude.Hashable Stream where
hashWithSalt :: Int -> Stream -> Int
hashWithSalt Int
_salt Stream' {Maybe Text
tableName :: Maybe Text
streamLabel :: Maybe Text
streamArn :: Maybe Text
$sel:tableName:Stream' :: Stream -> Maybe Text
$sel:streamLabel:Stream' :: Stream -> Maybe Text
$sel:streamArn:Stream' :: Stream -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamLabel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tableName
instance Prelude.NFData Stream where
rnf :: Stream -> ()
rnf Stream' {Maybe Text
tableName :: Maybe Text
streamLabel :: Maybe Text
streamArn :: Maybe Text
$sel:tableName:Stream' :: Stream -> Maybe Text
$sel:streamLabel:Stream' :: Stream -> Maybe Text
$sel:streamArn:Stream' :: Stream -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamLabel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tableName