{-# 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.OpsWorks.Types.ServiceError where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ServiceError = ServiceError'
{
ServiceError -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
ServiceError -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
ServiceError -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
ServiceError -> Maybe Text
serviceErrorId :: Prelude.Maybe Prelude.Text,
ServiceError -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
ServiceError -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (ServiceError -> ServiceError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceError -> ServiceError -> Bool
$c/= :: ServiceError -> ServiceError -> Bool
== :: ServiceError -> ServiceError -> Bool
$c== :: ServiceError -> ServiceError -> Bool
Prelude.Eq, ReadPrec [ServiceError]
ReadPrec ServiceError
Int -> ReadS ServiceError
ReadS [ServiceError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceError]
$creadListPrec :: ReadPrec [ServiceError]
readPrec :: ReadPrec ServiceError
$creadPrec :: ReadPrec ServiceError
readList :: ReadS [ServiceError]
$creadList :: ReadS [ServiceError]
readsPrec :: Int -> ReadS ServiceError
$creadsPrec :: Int -> ReadS ServiceError
Prelude.Read, Int -> ServiceError -> ShowS
[ServiceError] -> ShowS
ServiceError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceError] -> ShowS
$cshowList :: [ServiceError] -> ShowS
show :: ServiceError -> String
$cshow :: ServiceError -> String
showsPrec :: Int -> ServiceError -> ShowS
$cshowsPrec :: Int -> ServiceError -> ShowS
Prelude.Show, forall x. Rep ServiceError x -> ServiceError
forall x. ServiceError -> Rep ServiceError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceError x -> ServiceError
$cfrom :: forall x. ServiceError -> Rep ServiceError x
Prelude.Generic)
newServiceError ::
ServiceError
newServiceError :: ServiceError
newServiceError =
ServiceError'
{ $sel:createdAt:ServiceError' :: Maybe Text
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:ServiceError' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:message:ServiceError' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
$sel:serviceErrorId:ServiceError' :: Maybe Text
serviceErrorId = forall a. Maybe a
Prelude.Nothing,
$sel:stackId:ServiceError' :: Maybe Text
stackId = forall a. Maybe a
Prelude.Nothing,
$sel:type':ServiceError' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
}
serviceError_createdAt :: Lens.Lens' ServiceError (Prelude.Maybe Prelude.Text)
serviceError_createdAt :: Lens' ServiceError (Maybe Text)
serviceError_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceError' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:ServiceError' :: ServiceError -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: ServiceError
s@ServiceError' {} Maybe Text
a -> ServiceError
s {$sel:createdAt:ServiceError' :: Maybe Text
createdAt = Maybe Text
a} :: ServiceError)
serviceError_instanceId :: Lens.Lens' ServiceError (Prelude.Maybe Prelude.Text)
serviceError_instanceId :: Lens' ServiceError (Maybe Text)
serviceError_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceError' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:ServiceError' :: ServiceError -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: ServiceError
s@ServiceError' {} Maybe Text
a -> ServiceError
s {$sel:instanceId:ServiceError' :: Maybe Text
instanceId = Maybe Text
a} :: ServiceError)
serviceError_message :: Lens.Lens' ServiceError (Prelude.Maybe Prelude.Text)
serviceError_message :: Lens' ServiceError (Maybe Text)
serviceError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceError' {Maybe Text
message :: Maybe Text
$sel:message:ServiceError' :: ServiceError -> Maybe Text
message} -> Maybe Text
message) (\s :: ServiceError
s@ServiceError' {} Maybe Text
a -> ServiceError
s {$sel:message:ServiceError' :: Maybe Text
message = Maybe Text
a} :: ServiceError)
serviceError_serviceErrorId :: Lens.Lens' ServiceError (Prelude.Maybe Prelude.Text)
serviceError_serviceErrorId :: Lens' ServiceError (Maybe Text)
serviceError_serviceErrorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceError' {Maybe Text
serviceErrorId :: Maybe Text
$sel:serviceErrorId:ServiceError' :: ServiceError -> Maybe Text
serviceErrorId} -> Maybe Text
serviceErrorId) (\s :: ServiceError
s@ServiceError' {} Maybe Text
a -> ServiceError
s {$sel:serviceErrorId:ServiceError' :: Maybe Text
serviceErrorId = Maybe Text
a} :: ServiceError)
serviceError_stackId :: Lens.Lens' ServiceError (Prelude.Maybe Prelude.Text)
serviceError_stackId :: Lens' ServiceError (Maybe Text)
serviceError_stackId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceError' {Maybe Text
stackId :: Maybe Text
$sel:stackId:ServiceError' :: ServiceError -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: ServiceError
s@ServiceError' {} Maybe Text
a -> ServiceError
s {$sel:stackId:ServiceError' :: Maybe Text
stackId = Maybe Text
a} :: ServiceError)
serviceError_type :: Lens.Lens' ServiceError (Prelude.Maybe Prelude.Text)
serviceError_type :: Lens' ServiceError (Maybe Text)
serviceError_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceError' {Maybe Text
type' :: Maybe Text
$sel:type':ServiceError' :: ServiceError -> Maybe Text
type'} -> Maybe Text
type') (\s :: ServiceError
s@ServiceError' {} Maybe Text
a -> ServiceError
s {$sel:type':ServiceError' :: Maybe Text
type' = Maybe Text
a} :: ServiceError)
instance Data.FromJSON ServiceError where
parseJSON :: Value -> Parser ServiceError
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServiceError"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ServiceError
ServiceError'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatedAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InstanceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Message")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ServiceErrorId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StackId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
)
instance Prelude.Hashable ServiceError where
hashWithSalt :: Int -> ServiceError -> Int
hashWithSalt Int
_salt ServiceError' {Maybe Text
type' :: Maybe Text
stackId :: Maybe Text
serviceErrorId :: Maybe Text
message :: Maybe Text
instanceId :: Maybe Text
createdAt :: Maybe Text
$sel:type':ServiceError' :: ServiceError -> Maybe Text
$sel:stackId:ServiceError' :: ServiceError -> Maybe Text
$sel:serviceErrorId:ServiceError' :: ServiceError -> Maybe Text
$sel:message:ServiceError' :: ServiceError -> Maybe Text
$sel:instanceId:ServiceError' :: ServiceError -> Maybe Text
$sel:createdAt:ServiceError' :: ServiceError -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceErrorId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
instance Prelude.NFData ServiceError where
rnf :: ServiceError -> ()
rnf ServiceError' {Maybe Text
type' :: Maybe Text
stackId :: Maybe Text
serviceErrorId :: Maybe Text
message :: Maybe Text
instanceId :: Maybe Text
createdAt :: Maybe Text
$sel:type':ServiceError' :: ServiceError -> Maybe Text
$sel:stackId:ServiceError' :: ServiceError -> Maybe Text
$sel:serviceErrorId:ServiceError' :: ServiceError -> Maybe Text
$sel:message:ServiceError' :: ServiceError -> Maybe Text
$sel:instanceId:ServiceError' :: ServiceError -> Maybe Text
$sel:createdAt:ServiceError' :: ServiceError -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceErrorId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'