{-# 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.Warning where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Warning = Warning'
{
Warning -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
Warning -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (Warning -> Warning -> Bool
(Warning -> Warning -> Bool)
-> (Warning -> Warning -> Bool) -> Eq Warning
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Warning -> Warning -> Bool
$c/= :: Warning -> Warning -> Bool
== :: Warning -> Warning -> Bool
$c== :: Warning -> Warning -> Bool
Prelude.Eq, ReadPrec [Warning]
ReadPrec Warning
Int -> ReadS Warning
ReadS [Warning]
(Int -> ReadS Warning)
-> ReadS [Warning]
-> ReadPrec Warning
-> ReadPrec [Warning]
-> Read Warning
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Warning]
$creadListPrec :: ReadPrec [Warning]
readPrec :: ReadPrec Warning
$creadPrec :: ReadPrec Warning
readList :: ReadS [Warning]
$creadList :: ReadS [Warning]
readsPrec :: Int -> ReadS Warning
$creadsPrec :: Int -> ReadS Warning
Prelude.Read, Int -> Warning -> ShowS
[Warning] -> ShowS
Warning -> String
(Int -> Warning -> ShowS)
-> (Warning -> String) -> ([Warning] -> ShowS) -> Show Warning
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Warning] -> ShowS
$cshowList :: [Warning] -> ShowS
show :: Warning -> String
$cshow :: Warning -> String
showsPrec :: Int -> Warning -> ShowS
$cshowsPrec :: Int -> Warning -> ShowS
Prelude.Show, (forall x. Warning -> Rep Warning x)
-> (forall x. Rep Warning x -> Warning) -> Generic Warning
forall x. Rep Warning x -> Warning
forall x. Warning -> Rep Warning x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Warning x -> Warning
$cfrom :: forall x. Warning -> Rep Warning x
Prelude.Generic)
newWarning ::
Warning
newWarning :: Warning
newWarning =
Warning' :: Maybe Text -> Maybe Text -> Warning
Warning'
{ $sel:code:Warning' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:message:Warning' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
warning_code :: Lens.Lens' Warning (Prelude.Maybe Prelude.Text)
warning_code :: (Maybe Text -> f (Maybe Text)) -> Warning -> f Warning
warning_code = (Warning -> Maybe Text)
-> (Warning -> Maybe Text -> Warning)
-> Lens Warning Warning (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Warning' {Maybe Text
code :: Maybe Text
$sel:code:Warning' :: Warning -> Maybe Text
code} -> Maybe Text
code) (\s :: Warning
s@Warning' {} Maybe Text
a -> Warning
s {$sel:code:Warning' :: Maybe Text
code = Maybe Text
a} :: Warning)
warning_message :: Lens.Lens' Warning (Prelude.Maybe Prelude.Text)
warning_message :: (Maybe Text -> f (Maybe Text)) -> Warning -> f Warning
warning_message = (Warning -> Maybe Text)
-> (Warning -> Maybe Text -> Warning)
-> Lens Warning Warning (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Warning' {Maybe Text
message :: Maybe Text
$sel:message:Warning' :: Warning -> Maybe Text
message} -> Maybe Text
message) (\s :: Warning
s@Warning' {} Maybe Text
a -> Warning
s {$sel:message:Warning' :: Maybe Text
message = Maybe Text
a} :: Warning)
instance Core.FromJSON Warning where
parseJSON :: Value -> Parser Warning
parseJSON =
String -> (Object -> Parser Warning) -> Value -> Parser Warning
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Warning"
( \Object
x ->
Maybe Text -> Maybe Text -> Warning
Warning'
(Maybe Text -> Maybe Text -> Warning)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Warning)
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
"Code")
Parser (Maybe Text -> Warning)
-> Parser (Maybe Text) -> Parser Warning
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
"Message")
)
instance Prelude.Hashable Warning
instance Prelude.NFData Warning