{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CognitoStreams = CognitoStreams'
{
CognitoStreams -> Maybe StreamingStatus
streamingStatus :: Prelude.Maybe StreamingStatus,
CognitoStreams -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
CognitoStreams -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
}
deriving (CognitoStreams -> CognitoStreams -> Bool
(CognitoStreams -> CognitoStreams -> Bool)
-> (CognitoStreams -> CognitoStreams -> Bool) -> Eq CognitoStreams
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]
(Int -> ReadS CognitoStreams)
-> ReadS [CognitoStreams]
-> ReadPrec CognitoStreams
-> ReadPrec [CognitoStreams]
-> Read 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
(Int -> CognitoStreams -> ShowS)
-> (CognitoStreams -> String)
-> ([CognitoStreams] -> ShowS)
-> Show CognitoStreams
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. CognitoStreams -> Rep CognitoStreams x)
-> (forall x. Rep CognitoStreams x -> CognitoStreams)
-> Generic CognitoStreams
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' :: Maybe StreamingStatus -> Maybe Text -> Maybe Text -> CognitoStreams
CognitoStreams'
{ $sel:streamingStatus:CognitoStreams' :: Maybe StreamingStatus
streamingStatus = Maybe StreamingStatus
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:CognitoStreams' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:CognitoStreams' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cognitoStreams_streamingStatus :: Lens.Lens' CognitoStreams (Prelude.Maybe StreamingStatus)
cognitoStreams_streamingStatus :: (Maybe StreamingStatus -> f (Maybe StreamingStatus))
-> CognitoStreams -> f CognitoStreams
cognitoStreams_streamingStatus = (CognitoStreams -> Maybe StreamingStatus)
-> (CognitoStreams -> Maybe StreamingStatus -> CognitoStreams)
-> Lens
CognitoStreams
CognitoStreams
(Maybe StreamingStatus)
(Maybe 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)
cognitoStreams_streamName :: Lens.Lens' CognitoStreams (Prelude.Maybe Prelude.Text)
cognitoStreams_streamName :: (Maybe Text -> f (Maybe Text))
-> CognitoStreams -> f CognitoStreams
cognitoStreams_streamName = (CognitoStreams -> Maybe Text)
-> (CognitoStreams -> Maybe Text -> CognitoStreams)
-> Lens CognitoStreams CognitoStreams (Maybe Text) (Maybe Text)
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_roleArn :: Lens.Lens' CognitoStreams (Prelude.Maybe Prelude.Text)
cognitoStreams_roleArn :: (Maybe Text -> f (Maybe Text))
-> CognitoStreams -> f CognitoStreams
cognitoStreams_roleArn = (CognitoStreams -> Maybe Text)
-> (CognitoStreams -> Maybe Text -> CognitoStreams)
-> Lens CognitoStreams CognitoStreams (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON CognitoStreams where
parseJSON :: Value -> Parser CognitoStreams
parseJSON =
String
-> (Object -> Parser CognitoStreams)
-> Value
-> Parser CognitoStreams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CognitoStreams"
( \Object
x ->
Maybe StreamingStatus -> Maybe Text -> Maybe Text -> CognitoStreams
CognitoStreams'
(Maybe StreamingStatus
-> Maybe Text -> Maybe Text -> CognitoStreams)
-> Parser (Maybe StreamingStatus)
-> Parser (Maybe Text -> Maybe Text -> CognitoStreams)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StreamingStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StreamingStatus")
Parser (Maybe Text -> Maybe Text -> CognitoStreams)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CognitoStreams)
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
"StreamName")
Parser (Maybe Text -> CognitoStreams)
-> Parser (Maybe Text) -> Parser CognitoStreams
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 CognitoStreams
instance Prelude.NFData CognitoStreams
instance Core.ToJSON CognitoStreams where
toJSON :: CognitoStreams -> Value
toJSON CognitoStreams' {Maybe Text
Maybe StreamingStatus
roleArn :: Maybe Text
streamName :: Maybe Text
streamingStatus :: Maybe StreamingStatus
$sel:roleArn:CognitoStreams' :: CognitoStreams -> Maybe Text
$sel:streamName:CognitoStreams' :: CognitoStreams -> Maybe Text
$sel:streamingStatus:CognitoStreams' :: CognitoStreams -> Maybe StreamingStatus
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"StreamingStatus" Text -> StreamingStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(StreamingStatus -> Pair) -> Maybe StreamingStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamingStatus
streamingStatus,
(Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName,
(Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleArn
]
)