{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SnowDeviceManagement.Types.TaskState
data TaskSummary = TaskSummary'
{
TaskSummary -> Maybe TaskState
state :: Prelude.Maybe TaskState,
TaskSummary -> Maybe Text
taskArn :: Prelude.Maybe Prelude.Text,
TaskSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
TaskSummary -> Text
taskId :: Prelude.Text
}
deriving (TaskSummary -> TaskSummary -> Bool
(TaskSummary -> TaskSummary -> Bool)
-> (TaskSummary -> TaskSummary -> Bool) -> Eq TaskSummary
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]
(Int -> ReadS TaskSummary)
-> ReadS [TaskSummary]
-> ReadPrec TaskSummary
-> ReadPrec [TaskSummary]
-> Read 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
(Int -> TaskSummary -> ShowS)
-> (TaskSummary -> String)
-> ([TaskSummary] -> ShowS)
-> Show TaskSummary
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. TaskSummary -> Rep TaskSummary x)
-> (forall x. Rep TaskSummary x -> TaskSummary)
-> Generic TaskSummary
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' :: Maybe TaskState
-> Maybe Text -> Maybe (HashMap Text Text) -> Text -> TaskSummary
TaskSummary'
{ $sel:state:TaskSummary' :: Maybe TaskState
state = Maybe TaskState
forall a. Maybe a
Prelude.Nothing,
$sel:taskArn:TaskSummary' :: Maybe Text
taskArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:TaskSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:taskId:TaskSummary' :: Text
taskId = Text
pTaskId_
}
taskSummary_state :: Lens.Lens' TaskSummary (Prelude.Maybe TaskState)
taskSummary_state :: (Maybe TaskState -> f (Maybe TaskState))
-> TaskSummary -> f TaskSummary
taskSummary_state = (TaskSummary -> Maybe TaskState)
-> (TaskSummary -> Maybe TaskState -> TaskSummary)
-> Lens TaskSummary TaskSummary (Maybe TaskState) (Maybe TaskState)
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_taskArn :: Lens.Lens' TaskSummary (Prelude.Maybe Prelude.Text)
taskSummary_taskArn :: (Maybe Text -> f (Maybe Text)) -> TaskSummary -> f TaskSummary
taskSummary_taskArn = (TaskSummary -> Maybe Text)
-> (TaskSummary -> Maybe Text -> TaskSummary)
-> Lens TaskSummary TaskSummary (Maybe Text) (Maybe Text)
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_tags :: Lens.Lens' TaskSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
taskSummary_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TaskSummary -> f TaskSummary
taskSummary_tags = (TaskSummary -> Maybe (HashMap Text Text))
-> (TaskSummary -> Maybe (HashMap Text Text) -> TaskSummary)
-> Lens
TaskSummary
TaskSummary
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TaskSummary -> f TaskSummary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TaskSummary
-> f TaskSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
taskSummary_taskId :: Lens.Lens' TaskSummary Prelude.Text
taskSummary_taskId :: (Text -> f Text) -> TaskSummary -> f TaskSummary
taskSummary_taskId = (TaskSummary -> Text)
-> (TaskSummary -> Text -> TaskSummary)
-> Lens TaskSummary TaskSummary Text Text
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 Core.FromJSON TaskSummary where
parseJSON :: Value -> Parser TaskSummary
parseJSON =
String
-> (Object -> Parser TaskSummary) -> Value -> Parser TaskSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TaskSummary"
( \Object
x ->
Maybe TaskState
-> Maybe Text -> Maybe (HashMap Text Text) -> Text -> TaskSummary
TaskSummary'
(Maybe TaskState
-> Maybe Text -> Maybe (HashMap Text Text) -> Text -> TaskSummary)
-> Parser (Maybe TaskState)
-> Parser
(Maybe Text -> Maybe (HashMap Text Text) -> Text -> TaskSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TaskState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser
(Maybe Text -> Maybe (HashMap Text Text) -> Text -> TaskSummary)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> Text -> TaskSummary)
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
"taskArn")
Parser (Maybe (HashMap Text Text) -> Text -> TaskSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> TaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> TaskSummary) -> Parser Text -> Parser TaskSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"taskId")
)
instance Prelude.Hashable TaskSummary
instance Prelude.NFData TaskSummary