{-# 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.CognitoSync.Types.CognitoStreams where
import Amazonka.CognitoSync.Types.StreamingStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CognitoStreams = CognitoStreams'
{
CognitoStreams -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
CognitoStreams -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
CognitoStreams -> Maybe StreamingStatus
streamingStatus :: Prelude.Maybe StreamingStatus
}
deriving (CognitoStreams -> CognitoStreams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CognitoStreams -> CognitoStreams -> Bool
$c/= :: CognitoStreams -> CognitoStreams -> Bool
== :: CognitoStreams -> CognitoStreams -> Bool
$c== :: CognitoStreams -> CognitoStreams -> Bool
Prelude.Eq, ReadPrec [CognitoStreams]
ReadPrec CognitoStreams
Int -> ReadS CognitoStreams
ReadS [CognitoStreams]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CognitoStreams]
$creadListPrec :: ReadPrec [CognitoStreams]
readPrec :: ReadPrec CognitoStreams
$creadPrec :: ReadPrec CognitoStreams
readList :: ReadS [CognitoStreams]
$creadList :: ReadS [CognitoStreams]
readsPrec :: Int -> ReadS CognitoStreams
$creadsPrec :: Int -> ReadS CognitoStreams
Prelude.Read, Int -> CognitoStreams -> ShowS
[CognitoStreams] -> ShowS
CognitoStreams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CognitoStreams] -> ShowS
$cshowList :: [CognitoStreams] -> ShowS
show :: CognitoStreams -> String
$cshow :: CognitoStreams -> String
showsPrec :: Int -> CognitoStreams -> ShowS
$cshowsPrec :: Int -> CognitoStreams -> ShowS
Prelude.Show, forall x. Rep CognitoStreams x -> CognitoStreams
forall x. CognitoStreams -> Rep CognitoStreams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CognitoStreams x -> CognitoStreams
$cfrom :: forall x. CognitoStreams -> Rep CognitoStreams x
Prelude.Generic)
newCognitoStreams ::
CognitoStreams
newCognitoStreams :: CognitoStreams
newCognitoStreams =
CognitoStreams'
{ $sel:roleArn:CognitoStreams' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
$sel:streamName:CognitoStreams' :: Maybe Text
streamName = forall a. Maybe a
Prelude.Nothing,
$sel:streamingStatus:CognitoStreams' :: Maybe StreamingStatus
streamingStatus = forall a. Maybe a
Prelude.Nothing
}
cognitoStreams_roleArn :: Lens.Lens' CognitoStreams (Prelude.Maybe Prelude.Text)
cognitoStreams_roleArn :: Lens' CognitoStreams (Maybe Text)
cognitoStreams_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoStreams' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:CognitoStreams' :: CognitoStreams -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: CognitoStreams
s@CognitoStreams' {} Maybe Text
a -> CognitoStreams
s {$sel:roleArn:CognitoStreams' :: Maybe Text
roleArn = Maybe Text
a} :: CognitoStreams)
cognitoStreams_streamName :: Lens.Lens' CognitoStreams (Prelude.Maybe Prelude.Text)
cognitoStreams_streamName :: Lens' CognitoStreams (Maybe Text)
cognitoStreams_streamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoStreams' {Maybe Text
streamName :: Maybe Text
$sel:streamName:CognitoStreams' :: CognitoStreams -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: CognitoStreams
s@CognitoStreams' {} Maybe Text
a -> CognitoStreams
s {$sel:streamName:CognitoStreams' :: Maybe Text
streamName = Maybe Text
a} :: CognitoStreams)
cognitoStreams_streamingStatus :: Lens.Lens' CognitoStreams (Prelude.Maybe StreamingStatus)
cognitoStreams_streamingStatus :: Lens' CognitoStreams (Maybe StreamingStatus)
cognitoStreams_streamingStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoStreams' {Maybe StreamingStatus
streamingStatus :: Maybe StreamingStatus
$sel:streamingStatus:CognitoStreams' :: CognitoStreams -> Maybe StreamingStatus
streamingStatus} -> Maybe StreamingStatus
streamingStatus) (\s :: CognitoStreams
s@CognitoStreams' {} Maybe StreamingStatus
a -> CognitoStreams
s {$sel:streamingStatus:CognitoStreams' :: Maybe StreamingStatus
streamingStatus = Maybe StreamingStatus
a} :: CognitoStreams)
instance Data.FromJSON CognitoStreams where
parseJSON :: Value -> Parser CognitoStreams
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CognitoStreams"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe StreamingStatus -> CognitoStreams
CognitoStreams'
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
"RoleArn")
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
"StreamName")
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
"StreamingStatus")
)
instance Prelude.Hashable CognitoStreams where
hashWithSalt :: Int -> CognitoStreams -> Int
hashWithSalt Int
_salt CognitoStreams' {Maybe Text
Maybe StreamingStatus
streamingStatus :: Maybe StreamingStatus
streamName :: Maybe Text
roleArn :: Maybe Text
$sel:streamingStatus:CognitoStreams' :: CognitoStreams -> Maybe StreamingStatus
$sel:streamName:CognitoStreams' :: CognitoStreams -> Maybe Text
$sel:roleArn:CognitoStreams' :: CognitoStreams -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamingStatus
streamingStatus
instance Prelude.NFData CognitoStreams where
rnf :: CognitoStreams -> ()
rnf CognitoStreams' {Maybe Text
Maybe StreamingStatus
streamingStatus :: Maybe StreamingStatus
streamName :: Maybe Text
roleArn :: Maybe Text
$sel:streamingStatus:CognitoStreams' :: CognitoStreams -> Maybe StreamingStatus
$sel:streamName:CognitoStreams' :: CognitoStreams -> Maybe Text
$sel:roleArn:CognitoStreams' :: CognitoStreams -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingStatus
streamingStatus
instance Data.ToJSON CognitoStreams where
toJSON :: CognitoStreams -> Value
toJSON CognitoStreams' {Maybe Text
Maybe StreamingStatus
streamingStatus :: Maybe StreamingStatus
streamName :: Maybe Text
roleArn :: Maybe Text
$sel:streamingStatus:CognitoStreams' :: CognitoStreams -> Maybe StreamingStatus
$sel:streamName:CognitoStreams' :: CognitoStreams -> Maybe Text
$sel:roleArn:CognitoStreams' :: CognitoStreams -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"RoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleArn,
(Key
"StreamName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName,
(Key
"StreamingStatus" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamingStatus
streamingStatus
]
)