{-# 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.IoT.Types.StreamInfo where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.StreamFile
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StreamInfo = StreamInfo'
{
StreamInfo -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
StreamInfo -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
StreamInfo -> Maybe Natural
streamVersion :: Prelude.Maybe Prelude.Natural,
StreamInfo -> Maybe Text
streamArn :: Prelude.Maybe Prelude.Text,
StreamInfo -> Maybe (NonEmpty StreamFile)
files :: Prelude.Maybe (Prelude.NonEmpty StreamFile),
StreamInfo -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
StreamInfo -> Maybe Text
streamId :: Prelude.Maybe Prelude.Text,
StreamInfo -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
}
deriving (StreamInfo -> StreamInfo -> Bool
(StreamInfo -> StreamInfo -> Bool)
-> (StreamInfo -> StreamInfo -> Bool) -> Eq StreamInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamInfo -> StreamInfo -> Bool
$c/= :: StreamInfo -> StreamInfo -> Bool
== :: StreamInfo -> StreamInfo -> Bool
$c== :: StreamInfo -> StreamInfo -> Bool
Prelude.Eq, ReadPrec [StreamInfo]
ReadPrec StreamInfo
Int -> ReadS StreamInfo
ReadS [StreamInfo]
(Int -> ReadS StreamInfo)
-> ReadS [StreamInfo]
-> ReadPrec StreamInfo
-> ReadPrec [StreamInfo]
-> Read StreamInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamInfo]
$creadListPrec :: ReadPrec [StreamInfo]
readPrec :: ReadPrec StreamInfo
$creadPrec :: ReadPrec StreamInfo
readList :: ReadS [StreamInfo]
$creadList :: ReadS [StreamInfo]
readsPrec :: Int -> ReadS StreamInfo
$creadsPrec :: Int -> ReadS StreamInfo
Prelude.Read, Int -> StreamInfo -> ShowS
[StreamInfo] -> ShowS
StreamInfo -> String
(Int -> StreamInfo -> ShowS)
-> (StreamInfo -> String)
-> ([StreamInfo] -> ShowS)
-> Show StreamInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamInfo] -> ShowS
$cshowList :: [StreamInfo] -> ShowS
show :: StreamInfo -> String
$cshow :: StreamInfo -> String
showsPrec :: Int -> StreamInfo -> ShowS
$cshowsPrec :: Int -> StreamInfo -> ShowS
Prelude.Show, (forall x. StreamInfo -> Rep StreamInfo x)
-> (forall x. Rep StreamInfo x -> StreamInfo) -> Generic StreamInfo
forall x. Rep StreamInfo x -> StreamInfo
forall x. StreamInfo -> Rep StreamInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamInfo x -> StreamInfo
$cfrom :: forall x. StreamInfo -> Rep StreamInfo x
Prelude.Generic)
newStreamInfo ::
StreamInfo
newStreamInfo :: StreamInfo
newStreamInfo =
StreamInfo' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo
StreamInfo'
{ $sel:lastUpdatedAt:StreamInfo' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:StreamInfo' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:streamVersion:StreamInfo' :: Maybe Natural
streamVersion = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:streamArn:StreamInfo' :: Maybe Text
streamArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:files:StreamInfo' :: Maybe (NonEmpty StreamFile)
files = Maybe (NonEmpty StreamFile)
forall a. Maybe a
Prelude.Nothing,
$sel:description:StreamInfo' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamId:StreamInfo' :: Maybe Text
streamId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:StreamInfo' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
streamInfo_lastUpdatedAt :: Lens.Lens' StreamInfo (Prelude.Maybe Prelude.UTCTime)
streamInfo_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> StreamInfo -> f StreamInfo
streamInfo_lastUpdatedAt = (StreamInfo -> Maybe POSIX)
-> (StreamInfo -> Maybe POSIX -> StreamInfo)
-> Lens StreamInfo StreamInfo (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:StreamInfo' :: StreamInfo -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: StreamInfo
s@StreamInfo' {} Maybe POSIX
a -> StreamInfo
s {$sel:lastUpdatedAt:StreamInfo' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: StreamInfo) ((Maybe POSIX -> f (Maybe POSIX)) -> StreamInfo -> f StreamInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StreamInfo
-> f StreamInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
streamInfo_createdAt :: Lens.Lens' StreamInfo (Prelude.Maybe Prelude.UTCTime)
streamInfo_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> StreamInfo -> f StreamInfo
streamInfo_createdAt = (StreamInfo -> Maybe POSIX)
-> (StreamInfo -> Maybe POSIX -> StreamInfo)
-> Lens StreamInfo StreamInfo (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:StreamInfo' :: StreamInfo -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: StreamInfo
s@StreamInfo' {} Maybe POSIX
a -> StreamInfo
s {$sel:createdAt:StreamInfo' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: StreamInfo) ((Maybe POSIX -> f (Maybe POSIX)) -> StreamInfo -> f StreamInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StreamInfo
-> f StreamInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
streamInfo_streamVersion :: Lens.Lens' StreamInfo (Prelude.Maybe Prelude.Natural)
streamInfo_streamVersion :: (Maybe Natural -> f (Maybe Natural)) -> StreamInfo -> f StreamInfo
streamInfo_streamVersion = (StreamInfo -> Maybe Natural)
-> (StreamInfo -> Maybe Natural -> StreamInfo)
-> Lens StreamInfo StreamInfo (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe Natural
streamVersion :: Maybe Natural
$sel:streamVersion:StreamInfo' :: StreamInfo -> Maybe Natural
streamVersion} -> Maybe Natural
streamVersion) (\s :: StreamInfo
s@StreamInfo' {} Maybe Natural
a -> StreamInfo
s {$sel:streamVersion:StreamInfo' :: Maybe Natural
streamVersion = Maybe Natural
a} :: StreamInfo)
streamInfo_streamArn :: Lens.Lens' StreamInfo (Prelude.Maybe Prelude.Text)
streamInfo_streamArn :: (Maybe Text -> f (Maybe Text)) -> StreamInfo -> f StreamInfo
streamInfo_streamArn = (StreamInfo -> Maybe Text)
-> (StreamInfo -> Maybe Text -> StreamInfo)
-> Lens StreamInfo StreamInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe Text
streamArn :: Maybe Text
$sel:streamArn:StreamInfo' :: StreamInfo -> Maybe Text
streamArn} -> Maybe Text
streamArn) (\s :: StreamInfo
s@StreamInfo' {} Maybe Text
a -> StreamInfo
s {$sel:streamArn:StreamInfo' :: Maybe Text
streamArn = Maybe Text
a} :: StreamInfo)
streamInfo_files :: Lens.Lens' StreamInfo (Prelude.Maybe (Prelude.NonEmpty StreamFile))
streamInfo_files :: (Maybe (NonEmpty StreamFile) -> f (Maybe (NonEmpty StreamFile)))
-> StreamInfo -> f StreamInfo
streamInfo_files = (StreamInfo -> Maybe (NonEmpty StreamFile))
-> (StreamInfo -> Maybe (NonEmpty StreamFile) -> StreamInfo)
-> Lens
StreamInfo
StreamInfo
(Maybe (NonEmpty StreamFile))
(Maybe (NonEmpty StreamFile))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe (NonEmpty StreamFile)
files :: Maybe (NonEmpty StreamFile)
$sel:files:StreamInfo' :: StreamInfo -> Maybe (NonEmpty StreamFile)
files} -> Maybe (NonEmpty StreamFile)
files) (\s :: StreamInfo
s@StreamInfo' {} Maybe (NonEmpty StreamFile)
a -> StreamInfo
s {$sel:files:StreamInfo' :: Maybe (NonEmpty StreamFile)
files = Maybe (NonEmpty StreamFile)
a} :: StreamInfo) ((Maybe (NonEmpty StreamFile) -> f (Maybe (NonEmpty StreamFile)))
-> StreamInfo -> f StreamInfo)
-> ((Maybe (NonEmpty StreamFile)
-> f (Maybe (NonEmpty StreamFile)))
-> Maybe (NonEmpty StreamFile) -> f (Maybe (NonEmpty StreamFile)))
-> (Maybe (NonEmpty StreamFile) -> f (Maybe (NonEmpty StreamFile)))
-> StreamInfo
-> f StreamInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty StreamFile)
(NonEmpty StreamFile)
(NonEmpty StreamFile)
(NonEmpty StreamFile)
-> Iso
(Maybe (NonEmpty StreamFile))
(Maybe (NonEmpty StreamFile))
(Maybe (NonEmpty StreamFile))
(Maybe (NonEmpty StreamFile))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty StreamFile)
(NonEmpty StreamFile)
(NonEmpty StreamFile)
(NonEmpty StreamFile)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
streamInfo_description :: Lens.Lens' StreamInfo (Prelude.Maybe Prelude.Text)
streamInfo_description :: (Maybe Text -> f (Maybe Text)) -> StreamInfo -> f StreamInfo
streamInfo_description = (StreamInfo -> Maybe Text)
-> (StreamInfo -> Maybe Text -> StreamInfo)
-> Lens StreamInfo StreamInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe Text
description :: Maybe Text
$sel:description:StreamInfo' :: StreamInfo -> Maybe Text
description} -> Maybe Text
description) (\s :: StreamInfo
s@StreamInfo' {} Maybe Text
a -> StreamInfo
s {$sel:description:StreamInfo' :: Maybe Text
description = Maybe Text
a} :: StreamInfo)
streamInfo_streamId :: Lens.Lens' StreamInfo (Prelude.Maybe Prelude.Text)
streamInfo_streamId :: (Maybe Text -> f (Maybe Text)) -> StreamInfo -> f StreamInfo
streamInfo_streamId = (StreamInfo -> Maybe Text)
-> (StreamInfo -> Maybe Text -> StreamInfo)
-> Lens StreamInfo StreamInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe Text
streamId :: Maybe Text
$sel:streamId:StreamInfo' :: StreamInfo -> Maybe Text
streamId} -> Maybe Text
streamId) (\s :: StreamInfo
s@StreamInfo' {} Maybe Text
a -> StreamInfo
s {$sel:streamId:StreamInfo' :: Maybe Text
streamId = Maybe Text
a} :: StreamInfo)
streamInfo_roleArn :: Lens.Lens' StreamInfo (Prelude.Maybe Prelude.Text)
streamInfo_roleArn :: (Maybe Text -> f (Maybe Text)) -> StreamInfo -> f StreamInfo
streamInfo_roleArn = (StreamInfo -> Maybe Text)
-> (StreamInfo -> Maybe Text -> StreamInfo)
-> Lens StreamInfo StreamInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamInfo' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:StreamInfo' :: StreamInfo -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: StreamInfo
s@StreamInfo' {} Maybe Text
a -> StreamInfo
s {$sel:roleArn:StreamInfo' :: Maybe Text
roleArn = Maybe Text
a} :: StreamInfo)
instance Core.FromJSON StreamInfo where
parseJSON :: Value -> Parser StreamInfo
parseJSON =
String
-> (Object -> Parser StreamInfo) -> Value -> Parser StreamInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StreamInfo"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo
StreamInfo'
(Maybe POSIX
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedAt")
Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"streamVersion")
Parser
(Maybe Text
-> Maybe (NonEmpty StreamFile)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StreamInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe (NonEmpty StreamFile)
-> Maybe Text -> Maybe Text -> Maybe Text -> StreamInfo)
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
"streamArn")
Parser
(Maybe (NonEmpty StreamFile)
-> Maybe Text -> Maybe Text -> Maybe Text -> StreamInfo)
-> Parser (Maybe (NonEmpty StreamFile))
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> StreamInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty StreamFile))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"files")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> StreamInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> StreamInfo)
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
"description")
Parser (Maybe Text -> Maybe Text -> StreamInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> StreamInfo)
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
"streamId")
Parser (Maybe Text -> StreamInfo)
-> Parser (Maybe Text) -> Parser StreamInfo
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 StreamInfo
instance Prelude.NFData StreamInfo