{-# 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.CodeDeploy.Types.Diagnostics where
import Amazonka.CodeDeploy.Types.LifecycleErrorCode
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Diagnostics = Diagnostics'
{
Diagnostics -> Maybe Text
logTail :: Prelude.Maybe Prelude.Text,
Diagnostics -> Maybe LifecycleErrorCode
errorCode :: Prelude.Maybe LifecycleErrorCode,
Diagnostics -> Maybe Text
scriptName :: Prelude.Maybe Prelude.Text,
Diagnostics -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (Diagnostics -> Diagnostics -> Bool
(Diagnostics -> Diagnostics -> Bool)
-> (Diagnostics -> Diagnostics -> Bool) -> Eq Diagnostics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Diagnostics -> Diagnostics -> Bool
$c/= :: Diagnostics -> Diagnostics -> Bool
== :: Diagnostics -> Diagnostics -> Bool
$c== :: Diagnostics -> Diagnostics -> Bool
Prelude.Eq, ReadPrec [Diagnostics]
ReadPrec Diagnostics
Int -> ReadS Diagnostics
ReadS [Diagnostics]
(Int -> ReadS Diagnostics)
-> ReadS [Diagnostics]
-> ReadPrec Diagnostics
-> ReadPrec [Diagnostics]
-> Read Diagnostics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Diagnostics]
$creadListPrec :: ReadPrec [Diagnostics]
readPrec :: ReadPrec Diagnostics
$creadPrec :: ReadPrec Diagnostics
readList :: ReadS [Diagnostics]
$creadList :: ReadS [Diagnostics]
readsPrec :: Int -> ReadS Diagnostics
$creadsPrec :: Int -> ReadS Diagnostics
Prelude.Read, Int -> Diagnostics -> ShowS
[Diagnostics] -> ShowS
Diagnostics -> String
(Int -> Diagnostics -> ShowS)
-> (Diagnostics -> String)
-> ([Diagnostics] -> ShowS)
-> Show Diagnostics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Diagnostics] -> ShowS
$cshowList :: [Diagnostics] -> ShowS
show :: Diagnostics -> String
$cshow :: Diagnostics -> String
showsPrec :: Int -> Diagnostics -> ShowS
$cshowsPrec :: Int -> Diagnostics -> ShowS
Prelude.Show, (forall x. Diagnostics -> Rep Diagnostics x)
-> (forall x. Rep Diagnostics x -> Diagnostics)
-> Generic Diagnostics
forall x. Rep Diagnostics x -> Diagnostics
forall x. Diagnostics -> Rep Diagnostics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Diagnostics x -> Diagnostics
$cfrom :: forall x. Diagnostics -> Rep Diagnostics x
Prelude.Generic)
newDiagnostics ::
Diagnostics
newDiagnostics :: Diagnostics
newDiagnostics =
Diagnostics' :: Maybe Text
-> Maybe LifecycleErrorCode
-> Maybe Text
-> Maybe Text
-> Diagnostics
Diagnostics'
{ $sel:logTail:Diagnostics' :: Maybe Text
logTail = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorCode:Diagnostics' :: Maybe LifecycleErrorCode
errorCode = Maybe LifecycleErrorCode
forall a. Maybe a
Prelude.Nothing,
$sel:scriptName:Diagnostics' :: Maybe Text
scriptName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:message:Diagnostics' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
diagnostics_logTail :: Lens.Lens' Diagnostics (Prelude.Maybe Prelude.Text)
diagnostics_logTail :: (Maybe Text -> f (Maybe Text)) -> Diagnostics -> f Diagnostics
diagnostics_logTail = (Diagnostics -> Maybe Text)
-> (Diagnostics -> Maybe Text -> Diagnostics)
-> Lens Diagnostics Diagnostics (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Diagnostics' {Maybe Text
logTail :: Maybe Text
$sel:logTail:Diagnostics' :: Diagnostics -> Maybe Text
logTail} -> Maybe Text
logTail) (\s :: Diagnostics
s@Diagnostics' {} Maybe Text
a -> Diagnostics
s {$sel:logTail:Diagnostics' :: Maybe Text
logTail = Maybe Text
a} :: Diagnostics)
diagnostics_errorCode :: Lens.Lens' Diagnostics (Prelude.Maybe LifecycleErrorCode)
diagnostics_errorCode :: (Maybe LifecycleErrorCode -> f (Maybe LifecycleErrorCode))
-> Diagnostics -> f Diagnostics
diagnostics_errorCode = (Diagnostics -> Maybe LifecycleErrorCode)
-> (Diagnostics -> Maybe LifecycleErrorCode -> Diagnostics)
-> Lens
Diagnostics
Diagnostics
(Maybe LifecycleErrorCode)
(Maybe LifecycleErrorCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Diagnostics' {Maybe LifecycleErrorCode
errorCode :: Maybe LifecycleErrorCode
$sel:errorCode:Diagnostics' :: Diagnostics -> Maybe LifecycleErrorCode
errorCode} -> Maybe LifecycleErrorCode
errorCode) (\s :: Diagnostics
s@Diagnostics' {} Maybe LifecycleErrorCode
a -> Diagnostics
s {$sel:errorCode:Diagnostics' :: Maybe LifecycleErrorCode
errorCode = Maybe LifecycleErrorCode
a} :: Diagnostics)
diagnostics_scriptName :: Lens.Lens' Diagnostics (Prelude.Maybe Prelude.Text)
diagnostics_scriptName :: (Maybe Text -> f (Maybe Text)) -> Diagnostics -> f Diagnostics
diagnostics_scriptName = (Diagnostics -> Maybe Text)
-> (Diagnostics -> Maybe Text -> Diagnostics)
-> Lens Diagnostics Diagnostics (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Diagnostics' {Maybe Text
scriptName :: Maybe Text
$sel:scriptName:Diagnostics' :: Diagnostics -> Maybe Text
scriptName} -> Maybe Text
scriptName) (\s :: Diagnostics
s@Diagnostics' {} Maybe Text
a -> Diagnostics
s {$sel:scriptName:Diagnostics' :: Maybe Text
scriptName = Maybe Text
a} :: Diagnostics)
diagnostics_message :: Lens.Lens' Diagnostics (Prelude.Maybe Prelude.Text)
diagnostics_message :: (Maybe Text -> f (Maybe Text)) -> Diagnostics -> f Diagnostics
diagnostics_message = (Diagnostics -> Maybe Text)
-> (Diagnostics -> Maybe Text -> Diagnostics)
-> Lens Diagnostics Diagnostics (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Diagnostics' {Maybe Text
message :: Maybe Text
$sel:message:Diagnostics' :: Diagnostics -> Maybe Text
message} -> Maybe Text
message) (\s :: Diagnostics
s@Diagnostics' {} Maybe Text
a -> Diagnostics
s {$sel:message:Diagnostics' :: Maybe Text
message = Maybe Text
a} :: Diagnostics)
instance Core.FromJSON Diagnostics where
parseJSON :: Value -> Parser Diagnostics
parseJSON =
String
-> (Object -> Parser Diagnostics) -> Value -> Parser Diagnostics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Diagnostics"
( \Object
x ->
Maybe Text
-> Maybe LifecycleErrorCode
-> Maybe Text
-> Maybe Text
-> Diagnostics
Diagnostics'
(Maybe Text
-> Maybe LifecycleErrorCode
-> Maybe Text
-> Maybe Text
-> Diagnostics)
-> Parser (Maybe Text)
-> Parser
(Maybe LifecycleErrorCode
-> Maybe Text -> Maybe Text -> Diagnostics)
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
"logTail")
Parser
(Maybe LifecycleErrorCode
-> Maybe Text -> Maybe Text -> Diagnostics)
-> Parser (Maybe LifecycleErrorCode)
-> Parser (Maybe Text -> Maybe Text -> Diagnostics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LifecycleErrorCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorCode")
Parser (Maybe Text -> Maybe Text -> Diagnostics)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Diagnostics)
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
"scriptName")
Parser (Maybe Text -> Diagnostics)
-> Parser (Maybe Text) -> Parser Diagnostics
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 Diagnostics
instance Prelude.NFData Diagnostics