{-# 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.IoTAnalytics.Types.Channel where
import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.ChannelStatus
import Amazonka.IoTAnalytics.Types.ChannelStorage
import Amazonka.IoTAnalytics.Types.RetentionPeriod
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Channel = Channel'
{
Channel -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
Channel -> Maybe ChannelStatus
status :: Prelude.Maybe ChannelStatus,
Channel -> Maybe POSIX
lastMessageArrivalTime :: Prelude.Maybe Core.POSIX,
Channel -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Channel -> Maybe ChannelStorage
storage :: Prelude.Maybe ChannelStorage,
Channel -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
Channel -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Channel -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX
}
deriving (Channel -> Channel -> Bool
(Channel -> Channel -> Bool)
-> (Channel -> Channel -> Bool) -> Eq Channel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Channel -> Channel -> Bool
$c/= :: Channel -> Channel -> Bool
== :: Channel -> Channel -> Bool
$c== :: Channel -> Channel -> Bool
Prelude.Eq, ReadPrec [Channel]
ReadPrec Channel
Int -> ReadS Channel
ReadS [Channel]
(Int -> ReadS Channel)
-> ReadS [Channel]
-> ReadPrec Channel
-> ReadPrec [Channel]
-> Read Channel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Channel]
$creadListPrec :: ReadPrec [Channel]
readPrec :: ReadPrec Channel
$creadPrec :: ReadPrec Channel
readList :: ReadS [Channel]
$creadList :: ReadS [Channel]
readsPrec :: Int -> ReadS Channel
$creadsPrec :: Int -> ReadS Channel
Prelude.Read, Int -> Channel -> ShowS
[Channel] -> ShowS
Channel -> String
(Int -> Channel -> ShowS)
-> (Channel -> String) -> ([Channel] -> ShowS) -> Show Channel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Channel] -> ShowS
$cshowList :: [Channel] -> ShowS
show :: Channel -> String
$cshow :: Channel -> String
showsPrec :: Int -> Channel -> ShowS
$cshowsPrec :: Int -> Channel -> ShowS
Prelude.Show, (forall x. Channel -> Rep Channel x)
-> (forall x. Rep Channel x -> Channel) -> Generic Channel
forall x. Rep Channel x -> Channel
forall x. Channel -> Rep Channel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Channel x -> Channel
$cfrom :: forall x. Channel -> Rep Channel x
Prelude.Generic)
newChannel ::
Channel
newChannel :: Channel
newChannel =
Channel' :: Maybe POSIX
-> Maybe ChannelStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel
Channel'
{ $sel:creationTime:Channel' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:status:Channel' :: Maybe ChannelStatus
status = Maybe ChannelStatus
forall a. Maybe a
Prelude.Nothing,
$sel:lastMessageArrivalTime:Channel' :: Maybe POSIX
lastMessageArrivalTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Channel' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:storage:Channel' :: Maybe ChannelStorage
storage = Maybe ChannelStorage
forall a. Maybe a
Prelude.Nothing,
$sel:retentionPeriod:Channel' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
$sel:name:Channel' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdateTime:Channel' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
channel_creationTime :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_creationTime = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Channel' :: Channel -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:creationTime:Channel' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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
channel_status :: Lens.Lens' Channel (Prelude.Maybe ChannelStatus)
channel_status :: (Maybe ChannelStatus -> f (Maybe ChannelStatus))
-> Channel -> f Channel
channel_status = (Channel -> Maybe ChannelStatus)
-> (Channel -> Maybe ChannelStatus -> Channel)
-> Lens Channel Channel (Maybe ChannelStatus) (Maybe ChannelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe ChannelStatus
status :: Maybe ChannelStatus
$sel:status:Channel' :: Channel -> Maybe ChannelStatus
status} -> Maybe ChannelStatus
status) (\s :: Channel
s@Channel' {} Maybe ChannelStatus
a -> Channel
s {$sel:status:Channel' :: Maybe ChannelStatus
status = Maybe ChannelStatus
a} :: Channel)
channel_lastMessageArrivalTime :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_lastMessageArrivalTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_lastMessageArrivalTime = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
lastMessageArrivalTime :: Maybe POSIX
$sel:lastMessageArrivalTime:Channel' :: Channel -> Maybe POSIX
lastMessageArrivalTime} -> Maybe POSIX
lastMessageArrivalTime) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:lastMessageArrivalTime:Channel' :: Maybe POSIX
lastMessageArrivalTime = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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
channel_arn :: Lens.Lens' Channel (Prelude.Maybe Prelude.Text)
channel_arn :: (Maybe Text -> f (Maybe Text)) -> Channel -> f Channel
channel_arn = (Channel -> Maybe Text)
-> (Channel -> Maybe Text -> Channel)
-> Lens Channel Channel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe Text
arn :: Maybe Text
$sel:arn:Channel' :: Channel -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Channel
s@Channel' {} Maybe Text
a -> Channel
s {$sel:arn:Channel' :: Maybe Text
arn = Maybe Text
a} :: Channel)
channel_storage :: Lens.Lens' Channel (Prelude.Maybe ChannelStorage)
channel_storage :: (Maybe ChannelStorage -> f (Maybe ChannelStorage))
-> Channel -> f Channel
channel_storage = (Channel -> Maybe ChannelStorage)
-> (Channel -> Maybe ChannelStorage -> Channel)
-> Lens
Channel Channel (Maybe ChannelStorage) (Maybe ChannelStorage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe ChannelStorage
storage :: Maybe ChannelStorage
$sel:storage:Channel' :: Channel -> Maybe ChannelStorage
storage} -> Maybe ChannelStorage
storage) (\s :: Channel
s@Channel' {} Maybe ChannelStorage
a -> Channel
s {$sel:storage:Channel' :: Maybe ChannelStorage
storage = Maybe ChannelStorage
a} :: Channel)
channel_retentionPeriod :: Lens.Lens' Channel (Prelude.Maybe RetentionPeriod)
channel_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> Channel -> f Channel
channel_retentionPeriod = (Channel -> Maybe RetentionPeriod)
-> (Channel -> Maybe RetentionPeriod -> Channel)
-> Lens
Channel Channel (Maybe RetentionPeriod) (Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:Channel' :: Channel -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: Channel
s@Channel' {} Maybe RetentionPeriod
a -> Channel
s {$sel:retentionPeriod:Channel' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: Channel)
channel_name :: Lens.Lens' Channel (Prelude.Maybe Prelude.Text)
channel_name :: (Maybe Text -> f (Maybe Text)) -> Channel -> f Channel
channel_name = (Channel -> Maybe Text)
-> (Channel -> Maybe Text -> Channel)
-> Lens Channel Channel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe Text
name :: Maybe Text
$sel:name:Channel' :: Channel -> Maybe Text
name} -> Maybe Text
name) (\s :: Channel
s@Channel' {} Maybe Text
a -> Channel
s {$sel:name:Channel' :: Maybe Text
name = Maybe Text
a} :: Channel)
channel_lastUpdateTime :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_lastUpdateTime = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:Channel' :: Channel -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:lastUpdateTime:Channel' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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
instance Core.FromJSON Channel where
parseJSON :: Value -> Parser Channel
parseJSON =
String -> (Object -> Parser Channel) -> Value -> Parser Channel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Channel"
( \Object
x ->
Maybe POSIX
-> Maybe ChannelStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel
Channel'
(Maybe POSIX
-> Maybe ChannelStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ChannelStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel)
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
"creationTime")
Parser
(Maybe ChannelStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel)
-> Parser (Maybe ChannelStatus)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel)
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
"lastMessageArrivalTime")
Parser
(Maybe Text
-> Maybe ChannelStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Channel)
-> Parser (Maybe Text)
-> Parser
(Maybe ChannelStorage
-> Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Channel)
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
"arn")
Parser
(Maybe ChannelStorage
-> Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Channel)
-> Parser (Maybe ChannelStorage)
-> Parser
(Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelStorage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"storage")
Parser
(Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Channel)
-> Parser (Maybe RetentionPeriod)
-> Parser (Maybe Text -> Maybe POSIX -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RetentionPeriod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"retentionPeriod")
Parser (Maybe Text -> Maybe POSIX -> Channel)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> Channel)
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
"name")
Parser (Maybe POSIX -> Channel)
-> Parser (Maybe POSIX) -> Parser Channel
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
"lastUpdateTime")
)
instance Prelude.Hashable Channel
instance Prelude.NFData Channel