{-# 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.IoT.Types.AuditTaskMetadata where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.AuditTaskStatus
import Amazonka.IoT.Types.AuditTaskType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AuditTaskMetadata = AuditTaskMetadata'
{
AuditTaskMetadata -> Maybe AuditTaskType
taskType :: Prelude.Maybe AuditTaskType,
AuditTaskMetadata -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
AuditTaskMetadata -> Maybe AuditTaskStatus
taskStatus :: Prelude.Maybe AuditTaskStatus
}
deriving (AuditTaskMetadata -> AuditTaskMetadata -> Bool
(AuditTaskMetadata -> AuditTaskMetadata -> Bool)
-> (AuditTaskMetadata -> AuditTaskMetadata -> Bool)
-> Eq AuditTaskMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuditTaskMetadata -> AuditTaskMetadata -> Bool
$c/= :: AuditTaskMetadata -> AuditTaskMetadata -> Bool
== :: AuditTaskMetadata -> AuditTaskMetadata -> Bool
$c== :: AuditTaskMetadata -> AuditTaskMetadata -> Bool
Prelude.Eq, ReadPrec [AuditTaskMetadata]
ReadPrec AuditTaskMetadata
Int -> ReadS AuditTaskMetadata
ReadS [AuditTaskMetadata]
(Int -> ReadS AuditTaskMetadata)
-> ReadS [AuditTaskMetadata]
-> ReadPrec AuditTaskMetadata
-> ReadPrec [AuditTaskMetadata]
-> Read AuditTaskMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuditTaskMetadata]
$creadListPrec :: ReadPrec [AuditTaskMetadata]
readPrec :: ReadPrec AuditTaskMetadata
$creadPrec :: ReadPrec AuditTaskMetadata
readList :: ReadS [AuditTaskMetadata]
$creadList :: ReadS [AuditTaskMetadata]
readsPrec :: Int -> ReadS AuditTaskMetadata
$creadsPrec :: Int -> ReadS AuditTaskMetadata
Prelude.Read, Int -> AuditTaskMetadata -> ShowS
[AuditTaskMetadata] -> ShowS
AuditTaskMetadata -> String
(Int -> AuditTaskMetadata -> ShowS)
-> (AuditTaskMetadata -> String)
-> ([AuditTaskMetadata] -> ShowS)
-> Show AuditTaskMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuditTaskMetadata] -> ShowS
$cshowList :: [AuditTaskMetadata] -> ShowS
show :: AuditTaskMetadata -> String
$cshow :: AuditTaskMetadata -> String
showsPrec :: Int -> AuditTaskMetadata -> ShowS
$cshowsPrec :: Int -> AuditTaskMetadata -> ShowS
Prelude.Show, (forall x. AuditTaskMetadata -> Rep AuditTaskMetadata x)
-> (forall x. Rep AuditTaskMetadata x -> AuditTaskMetadata)
-> Generic AuditTaskMetadata
forall x. Rep AuditTaskMetadata x -> AuditTaskMetadata
forall x. AuditTaskMetadata -> Rep AuditTaskMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuditTaskMetadata x -> AuditTaskMetadata
$cfrom :: forall x. AuditTaskMetadata -> Rep AuditTaskMetadata x
Prelude.Generic)
newAuditTaskMetadata ::
AuditTaskMetadata
newAuditTaskMetadata :: AuditTaskMetadata
newAuditTaskMetadata =
AuditTaskMetadata' :: Maybe AuditTaskType
-> Maybe Text -> Maybe AuditTaskStatus -> AuditTaskMetadata
AuditTaskMetadata'
{ $sel:taskType:AuditTaskMetadata' :: Maybe AuditTaskType
taskType = Maybe AuditTaskType
forall a. Maybe a
Prelude.Nothing,
$sel:taskId:AuditTaskMetadata' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskStatus:AuditTaskMetadata' :: Maybe AuditTaskStatus
taskStatus = Maybe AuditTaskStatus
forall a. Maybe a
Prelude.Nothing
}
auditTaskMetadata_taskType :: Lens.Lens' AuditTaskMetadata (Prelude.Maybe AuditTaskType)
auditTaskMetadata_taskType :: (Maybe AuditTaskType -> f (Maybe AuditTaskType))
-> AuditTaskMetadata -> f AuditTaskMetadata
auditTaskMetadata_taskType = (AuditTaskMetadata -> Maybe AuditTaskType)
-> (AuditTaskMetadata -> Maybe AuditTaskType -> AuditTaskMetadata)
-> Lens
AuditTaskMetadata
AuditTaskMetadata
(Maybe AuditTaskType)
(Maybe AuditTaskType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditTaskMetadata' {Maybe AuditTaskType
taskType :: Maybe AuditTaskType
$sel:taskType:AuditTaskMetadata' :: AuditTaskMetadata -> Maybe AuditTaskType
taskType} -> Maybe AuditTaskType
taskType) (\s :: AuditTaskMetadata
s@AuditTaskMetadata' {} Maybe AuditTaskType
a -> AuditTaskMetadata
s {$sel:taskType:AuditTaskMetadata' :: Maybe AuditTaskType
taskType = Maybe AuditTaskType
a} :: AuditTaskMetadata)
auditTaskMetadata_taskId :: Lens.Lens' AuditTaskMetadata (Prelude.Maybe Prelude.Text)
auditTaskMetadata_taskId :: (Maybe Text -> f (Maybe Text))
-> AuditTaskMetadata -> f AuditTaskMetadata
auditTaskMetadata_taskId = (AuditTaskMetadata -> Maybe Text)
-> (AuditTaskMetadata -> Maybe Text -> AuditTaskMetadata)
-> Lens
AuditTaskMetadata AuditTaskMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditTaskMetadata' {Maybe Text
taskId :: Maybe Text
$sel:taskId:AuditTaskMetadata' :: AuditTaskMetadata -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: AuditTaskMetadata
s@AuditTaskMetadata' {} Maybe Text
a -> AuditTaskMetadata
s {$sel:taskId:AuditTaskMetadata' :: Maybe Text
taskId = Maybe Text
a} :: AuditTaskMetadata)
auditTaskMetadata_taskStatus :: Lens.Lens' AuditTaskMetadata (Prelude.Maybe AuditTaskStatus)
auditTaskMetadata_taskStatus :: (Maybe AuditTaskStatus -> f (Maybe AuditTaskStatus))
-> AuditTaskMetadata -> f AuditTaskMetadata
auditTaskMetadata_taskStatus = (AuditTaskMetadata -> Maybe AuditTaskStatus)
-> (AuditTaskMetadata
-> Maybe AuditTaskStatus -> AuditTaskMetadata)
-> Lens
AuditTaskMetadata
AuditTaskMetadata
(Maybe AuditTaskStatus)
(Maybe AuditTaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditTaskMetadata' {Maybe AuditTaskStatus
taskStatus :: Maybe AuditTaskStatus
$sel:taskStatus:AuditTaskMetadata' :: AuditTaskMetadata -> Maybe AuditTaskStatus
taskStatus} -> Maybe AuditTaskStatus
taskStatus) (\s :: AuditTaskMetadata
s@AuditTaskMetadata' {} Maybe AuditTaskStatus
a -> AuditTaskMetadata
s {$sel:taskStatus:AuditTaskMetadata' :: Maybe AuditTaskStatus
taskStatus = Maybe AuditTaskStatus
a} :: AuditTaskMetadata)
instance Core.FromJSON AuditTaskMetadata where
parseJSON :: Value -> Parser AuditTaskMetadata
parseJSON =
String
-> (Object -> Parser AuditTaskMetadata)
-> Value
-> Parser AuditTaskMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AuditTaskMetadata"
( \Object
x ->
Maybe AuditTaskType
-> Maybe Text -> Maybe AuditTaskStatus -> AuditTaskMetadata
AuditTaskMetadata'
(Maybe AuditTaskType
-> Maybe Text -> Maybe AuditTaskStatus -> AuditTaskMetadata)
-> Parser (Maybe AuditTaskType)
-> Parser
(Maybe Text -> Maybe AuditTaskStatus -> AuditTaskMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AuditTaskType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskType")
Parser (Maybe Text -> Maybe AuditTaskStatus -> AuditTaskMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe AuditTaskStatus -> AuditTaskMetadata)
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
"taskId")
Parser (Maybe AuditTaskStatus -> AuditTaskMetadata)
-> Parser (Maybe AuditTaskStatus) -> Parser AuditTaskMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuditTaskStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskStatus")
)
instance Prelude.Hashable AuditTaskMetadata
instance Prelude.NFData AuditTaskMetadata