{-# 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.ElasticTranscoder.Types.Notifications where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Notifications = Notifications'
{
Notifications -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
Notifications -> Maybe Text
warning :: Prelude.Maybe Prelude.Text,
Notifications -> Maybe Text
progressing :: Prelude.Maybe Prelude.Text,
Notifications -> Maybe Text
completed :: Prelude.Maybe Prelude.Text
}
deriving (Notifications -> Notifications -> Bool
(Notifications -> Notifications -> Bool)
-> (Notifications -> Notifications -> Bool) -> Eq Notifications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Notifications -> Notifications -> Bool
$c/= :: Notifications -> Notifications -> Bool
== :: Notifications -> Notifications -> Bool
$c== :: Notifications -> Notifications -> Bool
Prelude.Eq, ReadPrec [Notifications]
ReadPrec Notifications
Int -> ReadS Notifications
ReadS [Notifications]
(Int -> ReadS Notifications)
-> ReadS [Notifications]
-> ReadPrec Notifications
-> ReadPrec [Notifications]
-> Read Notifications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Notifications]
$creadListPrec :: ReadPrec [Notifications]
readPrec :: ReadPrec Notifications
$creadPrec :: ReadPrec Notifications
readList :: ReadS [Notifications]
$creadList :: ReadS [Notifications]
readsPrec :: Int -> ReadS Notifications
$creadsPrec :: Int -> ReadS Notifications
Prelude.Read, Int -> Notifications -> ShowS
[Notifications] -> ShowS
Notifications -> String
(Int -> Notifications -> ShowS)
-> (Notifications -> String)
-> ([Notifications] -> ShowS)
-> Show Notifications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Notifications] -> ShowS
$cshowList :: [Notifications] -> ShowS
show :: Notifications -> String
$cshow :: Notifications -> String
showsPrec :: Int -> Notifications -> ShowS
$cshowsPrec :: Int -> Notifications -> ShowS
Prelude.Show, (forall x. Notifications -> Rep Notifications x)
-> (forall x. Rep Notifications x -> Notifications)
-> Generic Notifications
forall x. Rep Notifications x -> Notifications
forall x. Notifications -> Rep Notifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Notifications x -> Notifications
$cfrom :: forall x. Notifications -> Rep Notifications x
Prelude.Generic)
newNotifications ::
Notifications
newNotifications :: Notifications
newNotifications =
Notifications' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Notifications
Notifications'
{ $sel:error:Notifications' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:warning:Notifications' :: Maybe Text
warning = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:progressing:Notifications' :: Maybe Text
progressing = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:completed:Notifications' :: Maybe Text
completed = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
notifications_error :: Lens.Lens' Notifications (Prelude.Maybe Prelude.Text)
notifications_error :: (Maybe Text -> f (Maybe Text)) -> Notifications -> f Notifications
notifications_error = (Notifications -> Maybe Text)
-> (Notifications -> Maybe Text -> Notifications)
-> Lens Notifications Notifications (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notifications' {Maybe Text
error :: Maybe Text
$sel:error:Notifications' :: Notifications -> Maybe Text
error} -> Maybe Text
error) (\s :: Notifications
s@Notifications' {} Maybe Text
a -> Notifications
s {$sel:error:Notifications' :: Maybe Text
error = Maybe Text
a} :: Notifications)
notifications_warning :: Lens.Lens' Notifications (Prelude.Maybe Prelude.Text)
notifications_warning :: (Maybe Text -> f (Maybe Text)) -> Notifications -> f Notifications
notifications_warning = (Notifications -> Maybe Text)
-> (Notifications -> Maybe Text -> Notifications)
-> Lens Notifications Notifications (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notifications' {Maybe Text
warning :: Maybe Text
$sel:warning:Notifications' :: Notifications -> Maybe Text
warning} -> Maybe Text
warning) (\s :: Notifications
s@Notifications' {} Maybe Text
a -> Notifications
s {$sel:warning:Notifications' :: Maybe Text
warning = Maybe Text
a} :: Notifications)
notifications_progressing :: Lens.Lens' Notifications (Prelude.Maybe Prelude.Text)
notifications_progressing :: (Maybe Text -> f (Maybe Text)) -> Notifications -> f Notifications
notifications_progressing = (Notifications -> Maybe Text)
-> (Notifications -> Maybe Text -> Notifications)
-> Lens Notifications Notifications (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notifications' {Maybe Text
progressing :: Maybe Text
$sel:progressing:Notifications' :: Notifications -> Maybe Text
progressing} -> Maybe Text
progressing) (\s :: Notifications
s@Notifications' {} Maybe Text
a -> Notifications
s {$sel:progressing:Notifications' :: Maybe Text
progressing = Maybe Text
a} :: Notifications)
notifications_completed :: Lens.Lens' Notifications (Prelude.Maybe Prelude.Text)
notifications_completed :: (Maybe Text -> f (Maybe Text)) -> Notifications -> f Notifications
notifications_completed = (Notifications -> Maybe Text)
-> (Notifications -> Maybe Text -> Notifications)
-> Lens Notifications Notifications (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notifications' {Maybe Text
completed :: Maybe Text
$sel:completed:Notifications' :: Notifications -> Maybe Text
completed} -> Maybe Text
completed) (\s :: Notifications
s@Notifications' {} Maybe Text
a -> Notifications
s {$sel:completed:Notifications' :: Maybe Text
completed = Maybe Text
a} :: Notifications)
instance Core.FromJSON Notifications where
parseJSON :: Value -> Parser Notifications
parseJSON =
String
-> (Object -> Parser Notifications)
-> Value
-> Parser Notifications
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Notifications"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Notifications
Notifications'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Notifications)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Notifications)
forall (f :: * -> *) a b. Functor 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
"Error")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Notifications)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Notifications)
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
"Warning")
Parser (Maybe Text -> Maybe Text -> Notifications)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Notifications)
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
"Progressing")
Parser (Maybe Text -> Notifications)
-> Parser (Maybe Text) -> Parser Notifications
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
"Completed")
)
instance Prelude.Hashable Notifications
instance Prelude.NFData Notifications
instance Core.ToJSON Notifications where
toJSON :: Notifications -> Value
toJSON Notifications' {Maybe Text
completed :: Maybe Text
progressing :: Maybe Text
warning :: Maybe Text
error :: Maybe Text
$sel:completed:Notifications' :: Notifications -> Maybe Text
$sel:progressing:Notifications' :: Notifications -> Maybe Text
$sel:warning:Notifications' :: Notifications -> Maybe Text
$sel:error:Notifications' :: Notifications -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Error" 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
error,
(Text
"Warning" 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
warning,
(Text
"Progressing" 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
progressing,
(Text
"Completed" 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
completed
]
)