{-# 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.IoTSiteWise.Types.JobSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types.JobStatus
import qualified Amazonka.Prelude as Prelude
data JobSummary = JobSummary'
{
JobSummary -> Text
id :: Prelude.Text,
JobSummary -> Text
name :: Prelude.Text,
JobSummary -> JobStatus
status :: JobStatus
}
deriving (JobSummary -> JobSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobSummary -> JobSummary -> Bool
$c/= :: JobSummary -> JobSummary -> Bool
== :: JobSummary -> JobSummary -> Bool
$c== :: JobSummary -> JobSummary -> Bool
Prelude.Eq, ReadPrec [JobSummary]
ReadPrec JobSummary
Int -> ReadS JobSummary
ReadS [JobSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobSummary]
$creadListPrec :: ReadPrec [JobSummary]
readPrec :: ReadPrec JobSummary
$creadPrec :: ReadPrec JobSummary
readList :: ReadS [JobSummary]
$creadList :: ReadS [JobSummary]
readsPrec :: Int -> ReadS JobSummary
$creadsPrec :: Int -> ReadS JobSummary
Prelude.Read, Int -> JobSummary -> ShowS
[JobSummary] -> ShowS
JobSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobSummary] -> ShowS
$cshowList :: [JobSummary] -> ShowS
show :: JobSummary -> String
$cshow :: JobSummary -> String
showsPrec :: Int -> JobSummary -> ShowS
$cshowsPrec :: Int -> JobSummary -> ShowS
Prelude.Show, forall x. Rep JobSummary x -> JobSummary
forall x. JobSummary -> Rep JobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobSummary x -> JobSummary
$cfrom :: forall x. JobSummary -> Rep JobSummary x
Prelude.Generic)
newJobSummary ::
Prelude.Text ->
Prelude.Text ->
JobStatus ->
JobSummary
newJobSummary :: Text -> Text -> JobStatus -> JobSummary
newJobSummary Text
pId_ Text
pName_ JobStatus
pStatus_ =
JobSummary'
{ $sel:id:JobSummary' :: Text
id = Text
pId_,
$sel:name:JobSummary' :: Text
name = Text
pName_,
$sel:status:JobSummary' :: JobStatus
status = JobStatus
pStatus_
}
jobSummary_id :: Lens.Lens' JobSummary Prelude.Text
jobSummary_id :: Lens' JobSummary Text
jobSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
id :: Text
$sel:id:JobSummary' :: JobSummary -> Text
id} -> Text
id) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:id:JobSummary' :: Text
id = Text
a} :: JobSummary)
jobSummary_name :: Lens.Lens' JobSummary Prelude.Text
jobSummary_name :: Lens' JobSummary Text
jobSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
name :: Text
$sel:name:JobSummary' :: JobSummary -> Text
name} -> Text
name) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:name:JobSummary' :: Text
name = Text
a} :: JobSummary)
jobSummary_status :: Lens.Lens' JobSummary JobStatus
jobSummary_status :: Lens' JobSummary JobStatus
jobSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {JobStatus
status :: JobStatus
$sel:status:JobSummary' :: JobSummary -> JobStatus
status} -> JobStatus
status) (\s :: JobSummary
s@JobSummary' {} JobStatus
a -> JobSummary
s {$sel:status:JobSummary' :: JobStatus
status = JobStatus
a} :: JobSummary)
instance Data.FromJSON JobSummary where
parseJSON :: Value -> Parser JobSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JobSummary"
( \Object
x ->
Text -> Text -> JobStatus -> JobSummary
JobSummary'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
)
instance Prelude.Hashable JobSummary where
hashWithSalt :: Int -> JobSummary -> Int
hashWithSalt Int
_salt JobSummary' {Text
JobStatus
status :: JobStatus
name :: Text
id :: Text
$sel:status:JobSummary' :: JobSummary -> JobStatus
$sel:name:JobSummary' :: JobSummary -> Text
$sel:id:JobSummary' :: JobSummary -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` JobStatus
status
instance Prelude.NFData JobSummary where
rnf :: JobSummary -> ()
rnf JobSummary' {Text
JobStatus
status :: JobStatus
name :: Text
id :: Text
$sel:status:JobSummary' :: JobSummary -> JobStatus
$sel:name:JobSummary' :: JobSummary -> Text
$sel:id:JobSummary' :: JobSummary -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf JobStatus
status