{-# 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.SnowDeviceManagement.Types.TaskSummary 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
import Amazonka.SnowDeviceManagement.Types.TaskState
data TaskSummary = TaskSummary'
{
TaskSummary -> Maybe TaskState
state :: Prelude.Maybe TaskState,
TaskSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
TaskSummary -> Maybe Text
taskArn :: Prelude.Maybe Prelude.Text,
TaskSummary -> Text
taskId :: Prelude.Text
}
deriving (TaskSummary -> TaskSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskSummary -> TaskSummary -> Bool
$c/= :: TaskSummary -> TaskSummary -> Bool
== :: TaskSummary -> TaskSummary -> Bool
$c== :: TaskSummary -> TaskSummary -> Bool
Prelude.Eq, ReadPrec [TaskSummary]
ReadPrec TaskSummary
Int -> ReadS TaskSummary
ReadS [TaskSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaskSummary]
$creadListPrec :: ReadPrec [TaskSummary]
readPrec :: ReadPrec TaskSummary
$creadPrec :: ReadPrec TaskSummary
readList :: ReadS [TaskSummary]
$creadList :: ReadS [TaskSummary]
readsPrec :: Int -> ReadS TaskSummary
$creadsPrec :: Int -> ReadS TaskSummary
Prelude.Read, Int -> TaskSummary -> ShowS
[TaskSummary] -> ShowS
TaskSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskSummary] -> ShowS
$cshowList :: [TaskSummary] -> ShowS
show :: TaskSummary -> String
$cshow :: TaskSummary -> String
showsPrec :: Int -> TaskSummary -> ShowS
$cshowsPrec :: Int -> TaskSummary -> ShowS
Prelude.Show, forall x. Rep TaskSummary x -> TaskSummary
forall x. TaskSummary -> Rep TaskSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TaskSummary x -> TaskSummary
$cfrom :: forall x. TaskSummary -> Rep TaskSummary x
Prelude.Generic)
newTaskSummary ::
Prelude.Text ->
TaskSummary
newTaskSummary :: Text -> TaskSummary
newTaskSummary Text
pTaskId_ =
TaskSummary'
{ $sel:state:TaskSummary' :: Maybe TaskState
state = forall a. Maybe a
Prelude.Nothing,
$sel:tags:TaskSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:taskArn:TaskSummary' :: Maybe Text
taskArn = forall a. Maybe a
Prelude.Nothing,
$sel:taskId:TaskSummary' :: Text
taskId = Text
pTaskId_
}
taskSummary_state :: Lens.Lens' TaskSummary (Prelude.Maybe TaskState)
taskSummary_state :: Lens' TaskSummary (Maybe TaskState)
taskSummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSummary' {Maybe TaskState
state :: Maybe TaskState
$sel:state:TaskSummary' :: TaskSummary -> Maybe TaskState
state} -> Maybe TaskState
state) (\s :: TaskSummary
s@TaskSummary' {} Maybe TaskState
a -> TaskSummary
s {$sel:state:TaskSummary' :: Maybe TaskState
state = Maybe TaskState
a} :: TaskSummary)
taskSummary_tags :: Lens.Lens' TaskSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
taskSummary_tags :: Lens' TaskSummary (Maybe (HashMap Text Text))
taskSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:TaskSummary' :: TaskSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: TaskSummary
s@TaskSummary' {} Maybe (HashMap Text Text)
a -> TaskSummary
s {$sel:tags:TaskSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: TaskSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
taskSummary_taskArn :: Lens.Lens' TaskSummary (Prelude.Maybe Prelude.Text)
taskSummary_taskArn :: Lens' TaskSummary (Maybe Text)
taskSummary_taskArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSummary' {Maybe Text
taskArn :: Maybe Text
$sel:taskArn:TaskSummary' :: TaskSummary -> Maybe Text
taskArn} -> Maybe Text
taskArn) (\s :: TaskSummary
s@TaskSummary' {} Maybe Text
a -> TaskSummary
s {$sel:taskArn:TaskSummary' :: Maybe Text
taskArn = Maybe Text
a} :: TaskSummary)
taskSummary_taskId :: Lens.Lens' TaskSummary Prelude.Text
taskSummary_taskId :: Lens' TaskSummary Text
taskSummary_taskId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSummary' {Text
taskId :: Text
$sel:taskId:TaskSummary' :: TaskSummary -> Text
taskId} -> Text
taskId) (\s :: TaskSummary
s@TaskSummary' {} Text
a -> TaskSummary
s {$sel:taskId:TaskSummary' :: Text
taskId = Text
a} :: TaskSummary)
instance Data.FromJSON TaskSummary where
parseJSON :: Value -> Parser TaskSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TaskSummary"
( \Object
x ->
Maybe TaskState
-> Maybe (HashMap Text Text) -> Maybe Text -> Text -> TaskSummary
TaskSummary'
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
"state")
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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"taskArn")
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
"taskId")
)
instance Prelude.Hashable TaskSummary where
hashWithSalt :: Int -> TaskSummary -> Int
hashWithSalt Int
_salt TaskSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe TaskState
Text
taskId :: Text
taskArn :: Maybe Text
tags :: Maybe (HashMap Text Text)
state :: Maybe TaskState
$sel:taskId:TaskSummary' :: TaskSummary -> Text
$sel:taskArn:TaskSummary' :: TaskSummary -> Maybe Text
$sel:tags:TaskSummary' :: TaskSummary -> Maybe (HashMap Text Text)
$sel:state:TaskSummary' :: TaskSummary -> Maybe TaskState
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TaskState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
taskArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
taskId
instance Prelude.NFData TaskSummary where
rnf :: TaskSummary -> ()
rnf TaskSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe TaskState
Text
taskId :: Text
taskArn :: Maybe Text
tags :: Maybe (HashMap Text Text)
state :: Maybe TaskState
$sel:taskId:TaskSummary' :: TaskSummary -> Text
$sel:taskArn:TaskSummary' :: TaskSummary -> Maybe Text
$sel:tags:TaskSummary' :: TaskSummary -> Maybe (HashMap Text Text)
$sel:state:TaskSummary' :: TaskSummary -> Maybe TaskState
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TaskState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
taskArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
taskId