{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SnowDeviceManagement.DescribeTask
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Checks the metadata for a given task on a device.
module Amazonka.SnowDeviceManagement.DescribeTask
  ( -- * Creating a Request
    DescribeTask (..),
    newDescribeTask,

    -- * Request Lenses
    describeTask_taskId,

    -- * Destructuring the Response
    DescribeTaskResponse (..),
    newDescribeTaskResponse,

    -- * Response Lenses
    describeTaskResponse_state,
    describeTaskResponse_lastUpdatedAt,
    describeTaskResponse_createdAt,
    describeTaskResponse_taskId,
    describeTaskResponse_taskArn,
    describeTaskResponse_targets,
    describeTaskResponse_completedAt,
    describeTaskResponse_description,
    describeTaskResponse_tags,
    describeTaskResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SnowDeviceManagement.Types

-- | /See:/ 'newDescribeTask' smart constructor.
data DescribeTask = DescribeTask'
  { -- | The ID of the task to be described.
    DescribeTask -> Text
taskId :: Prelude.Text
  }
  deriving (DescribeTask -> DescribeTask -> Bool
(DescribeTask -> DescribeTask -> Bool)
-> (DescribeTask -> DescribeTask -> Bool) -> Eq DescribeTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTask -> DescribeTask -> Bool
$c/= :: DescribeTask -> DescribeTask -> Bool
== :: DescribeTask -> DescribeTask -> Bool
$c== :: DescribeTask -> DescribeTask -> Bool
Prelude.Eq, ReadPrec [DescribeTask]
ReadPrec DescribeTask
Int -> ReadS DescribeTask
ReadS [DescribeTask]
(Int -> ReadS DescribeTask)
-> ReadS [DescribeTask]
-> ReadPrec DescribeTask
-> ReadPrec [DescribeTask]
-> Read DescribeTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTask]
$creadListPrec :: ReadPrec [DescribeTask]
readPrec :: ReadPrec DescribeTask
$creadPrec :: ReadPrec DescribeTask
readList :: ReadS [DescribeTask]
$creadList :: ReadS [DescribeTask]
readsPrec :: Int -> ReadS DescribeTask
$creadsPrec :: Int -> ReadS DescribeTask
Prelude.Read, Int -> DescribeTask -> ShowS
[DescribeTask] -> ShowS
DescribeTask -> String
(Int -> DescribeTask -> ShowS)
-> (DescribeTask -> String)
-> ([DescribeTask] -> ShowS)
-> Show DescribeTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTask] -> ShowS
$cshowList :: [DescribeTask] -> ShowS
show :: DescribeTask -> String
$cshow :: DescribeTask -> String
showsPrec :: Int -> DescribeTask -> ShowS
$cshowsPrec :: Int -> DescribeTask -> ShowS
Prelude.Show, (forall x. DescribeTask -> Rep DescribeTask x)
-> (forall x. Rep DescribeTask x -> DescribeTask)
-> Generic DescribeTask
forall x. Rep DescribeTask x -> DescribeTask
forall x. DescribeTask -> Rep DescribeTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTask x -> DescribeTask
$cfrom :: forall x. DescribeTask -> Rep DescribeTask x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTask' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'taskId', 'describeTask_taskId' - The ID of the task to be described.
newDescribeTask ::
  -- | 'taskId'
  Prelude.Text ->
  DescribeTask
newDescribeTask :: Text -> DescribeTask
newDescribeTask Text
pTaskId_ =
  DescribeTask' :: Text -> DescribeTask
DescribeTask' {$sel:taskId:DescribeTask' :: Text
taskId = Text
pTaskId_}

-- | The ID of the task to be described.
describeTask_taskId :: Lens.Lens' DescribeTask Prelude.Text
describeTask_taskId :: (Text -> f Text) -> DescribeTask -> f DescribeTask
describeTask_taskId = (DescribeTask -> Text)
-> (DescribeTask -> Text -> DescribeTask)
-> Lens DescribeTask DescribeTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTask' {Text
taskId :: Text
$sel:taskId:DescribeTask' :: DescribeTask -> Text
taskId} -> Text
taskId) (\s :: DescribeTask
s@DescribeTask' {} Text
a -> DescribeTask
s {$sel:taskId:DescribeTask' :: Text
taskId = Text
a} :: DescribeTask)

instance Core.AWSRequest DescribeTask where
  type AWSResponse DescribeTask = DescribeTaskResponse
  request :: DescribeTask -> Request DescribeTask
request = Service -> DescribeTask -> Request DescribeTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeTask))
-> Logger
-> Service
-> Proxy DescribeTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTask)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe TaskState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> DescribeTaskResponse
DescribeTaskResponse'
            (Maybe TaskState
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> DescribeTaskResponse)
-> Either String (Maybe TaskState)
-> Either
     String
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> DescribeTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TaskState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"state")
            Either
  String
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> DescribeTaskResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastUpdatedAt")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> DescribeTaskResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createdAt")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> DescribeTaskResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskId")
            Either
  String
  (Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> DescribeTaskResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskArn")
            Either
  String
  (Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> DescribeTaskResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"targets")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> DescribeTaskResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text) -> Int -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"completedAt")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text) -> Int -> DescribeTaskResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"description")
            Either
  String (Maybe (HashMap Text Text) -> Int -> DescribeTaskResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> DescribeTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DescribeTaskResponse)
-> Either String Int -> Either String DescribeTaskResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeTask

instance Prelude.NFData DescribeTask

instance Core.ToHeaders DescribeTask where
  toHeaders :: DescribeTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeTask -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeTask where
  toJSON :: DescribeTask -> Value
toJSON = Value -> DescribeTask -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

instance Core.ToPath DescribeTask where
  toPath :: DescribeTask -> ByteString
toPath DescribeTask' {Text
taskId :: Text
$sel:taskId:DescribeTask' :: DescribeTask -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/task/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
taskId]

instance Core.ToQuery DescribeTask where
  toQuery :: DescribeTask -> QueryString
toQuery = QueryString -> DescribeTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeTaskResponse' smart constructor.
data DescribeTaskResponse = DescribeTaskResponse'
  { -- | The current state of the task.
    DescribeTaskResponse -> Maybe TaskState
state :: Prelude.Maybe TaskState,
    -- | When the state of the task was last updated.
    DescribeTaskResponse -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | When the @CreateTask@ operation was called.
    DescribeTaskResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The ID of the task.
    DescribeTaskResponse -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the task.
    DescribeTaskResponse -> Maybe Text
taskArn :: Prelude.Maybe Prelude.Text,
    -- | The managed devices that the task was sent to.
    DescribeTaskResponse -> Maybe (NonEmpty Text)
targets :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | When the task was completed.
    DescribeTaskResponse -> Maybe POSIX
completedAt :: Prelude.Maybe Core.POSIX,
    -- | The description provided of the task and managed devices.
    DescribeTaskResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Optional metadata that you assign to a resource. You can use tags to
    -- categorize a resource in different ways, such as by purpose, owner, or
    -- environment.
    DescribeTaskResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    DescribeTaskResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTaskResponse -> DescribeTaskResponse -> Bool
(DescribeTaskResponse -> DescribeTaskResponse -> Bool)
-> (DescribeTaskResponse -> DescribeTaskResponse -> Bool)
-> Eq DescribeTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTaskResponse -> DescribeTaskResponse -> Bool
$c/= :: DescribeTaskResponse -> DescribeTaskResponse -> Bool
== :: DescribeTaskResponse -> DescribeTaskResponse -> Bool
$c== :: DescribeTaskResponse -> DescribeTaskResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTaskResponse]
ReadPrec DescribeTaskResponse
Int -> ReadS DescribeTaskResponse
ReadS [DescribeTaskResponse]
(Int -> ReadS DescribeTaskResponse)
-> ReadS [DescribeTaskResponse]
-> ReadPrec DescribeTaskResponse
-> ReadPrec [DescribeTaskResponse]
-> Read DescribeTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTaskResponse]
$creadListPrec :: ReadPrec [DescribeTaskResponse]
readPrec :: ReadPrec DescribeTaskResponse
$creadPrec :: ReadPrec DescribeTaskResponse
readList :: ReadS [DescribeTaskResponse]
$creadList :: ReadS [DescribeTaskResponse]
readsPrec :: Int -> ReadS DescribeTaskResponse
$creadsPrec :: Int -> ReadS DescribeTaskResponse
Prelude.Read, Int -> DescribeTaskResponse -> ShowS
[DescribeTaskResponse] -> ShowS
DescribeTaskResponse -> String
(Int -> DescribeTaskResponse -> ShowS)
-> (DescribeTaskResponse -> String)
-> ([DescribeTaskResponse] -> ShowS)
-> Show DescribeTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTaskResponse] -> ShowS
$cshowList :: [DescribeTaskResponse] -> ShowS
show :: DescribeTaskResponse -> String
$cshow :: DescribeTaskResponse -> String
showsPrec :: Int -> DescribeTaskResponse -> ShowS
$cshowsPrec :: Int -> DescribeTaskResponse -> ShowS
Prelude.Show, (forall x. DescribeTaskResponse -> Rep DescribeTaskResponse x)
-> (forall x. Rep DescribeTaskResponse x -> DescribeTaskResponse)
-> Generic DescribeTaskResponse
forall x. Rep DescribeTaskResponse x -> DescribeTaskResponse
forall x. DescribeTaskResponse -> Rep DescribeTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTaskResponse x -> DescribeTaskResponse
$cfrom :: forall x. DescribeTaskResponse -> Rep DescribeTaskResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTaskResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'state', 'describeTaskResponse_state' - The current state of the task.
--
-- 'lastUpdatedAt', 'describeTaskResponse_lastUpdatedAt' - When the state of the task was last updated.
--
-- 'createdAt', 'describeTaskResponse_createdAt' - When the @CreateTask@ operation was called.
--
-- 'taskId', 'describeTaskResponse_taskId' - The ID of the task.
--
-- 'taskArn', 'describeTaskResponse_taskArn' - The Amazon Resource Name (ARN) of the task.
--
-- 'targets', 'describeTaskResponse_targets' - The managed devices that the task was sent to.
--
-- 'completedAt', 'describeTaskResponse_completedAt' - When the task was completed.
--
-- 'description', 'describeTaskResponse_description' - The description provided of the task and managed devices.
--
-- 'tags', 'describeTaskResponse_tags' - Optional metadata that you assign to a resource. You can use tags to
-- categorize a resource in different ways, such as by purpose, owner, or
-- environment.
--
-- 'httpStatus', 'describeTaskResponse_httpStatus' - The response's http status code.
newDescribeTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTaskResponse
newDescribeTaskResponse :: Int -> DescribeTaskResponse
newDescribeTaskResponse Int
pHttpStatus_ =
  DescribeTaskResponse' :: Maybe TaskState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> DescribeTaskResponse
DescribeTaskResponse'
    { $sel:state:DescribeTaskResponse' :: Maybe TaskState
state = Maybe TaskState
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:DescribeTaskResponse' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:DescribeTaskResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:taskId:DescribeTaskResponse' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskArn:DescribeTaskResponse' :: Maybe Text
taskArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:DescribeTaskResponse' :: Maybe (NonEmpty Text)
targets = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:completedAt:DescribeTaskResponse' :: Maybe POSIX
completedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:DescribeTaskResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DescribeTaskResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current state of the task.
describeTaskResponse_state :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe TaskState)
describeTaskResponse_state :: (Maybe TaskState -> f (Maybe TaskState))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_state = (DescribeTaskResponse -> Maybe TaskState)
-> (DescribeTaskResponse
    -> Maybe TaskState -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse
     DescribeTaskResponse
     (Maybe TaskState)
     (Maybe TaskState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe TaskState
state :: Maybe TaskState
$sel:state:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe TaskState
state} -> Maybe TaskState
state) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe TaskState
a -> DescribeTaskResponse
s {$sel:state:DescribeTaskResponse' :: Maybe TaskState
state = Maybe TaskState
a} :: DescribeTaskResponse)

-- | When the state of the task was last updated.
describeTaskResponse_lastUpdatedAt :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe Prelude.UTCTime)
describeTaskResponse_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_lastUpdatedAt = (DescribeTaskResponse -> Maybe POSIX)
-> (DescribeTaskResponse -> Maybe POSIX -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse
     DescribeTaskResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe POSIX
a -> DescribeTaskResponse
s {$sel:lastUpdatedAt:DescribeTaskResponse' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: DescribeTaskResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeTaskResponse -> f DescribeTaskResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeTaskResponse
-> f DescribeTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | When the @CreateTask@ operation was called.
describeTaskResponse_createdAt :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe Prelude.UTCTime)
describeTaskResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_createdAt = (DescribeTaskResponse -> Maybe POSIX)
-> (DescribeTaskResponse -> Maybe POSIX -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse
     DescribeTaskResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe POSIX
a -> DescribeTaskResponse
s {$sel:createdAt:DescribeTaskResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: DescribeTaskResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeTaskResponse -> f DescribeTaskResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeTaskResponse
-> f DescribeTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the task.
describeTaskResponse_taskId :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe Prelude.Text)
describeTaskResponse_taskId :: (Maybe Text -> f (Maybe Text))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_taskId = (DescribeTaskResponse -> Maybe Text)
-> (DescribeTaskResponse -> Maybe Text -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse DescribeTaskResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe Text
taskId :: Maybe Text
$sel:taskId:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe Text
a -> DescribeTaskResponse
s {$sel:taskId:DescribeTaskResponse' :: Maybe Text
taskId = Maybe Text
a} :: DescribeTaskResponse)

-- | The Amazon Resource Name (ARN) of the task.
describeTaskResponse_taskArn :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe Prelude.Text)
describeTaskResponse_taskArn :: (Maybe Text -> f (Maybe Text))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_taskArn = (DescribeTaskResponse -> Maybe Text)
-> (DescribeTaskResponse -> Maybe Text -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse DescribeTaskResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe Text
taskArn :: Maybe Text
$sel:taskArn:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe Text
taskArn} -> Maybe Text
taskArn) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe Text
a -> DescribeTaskResponse
s {$sel:taskArn:DescribeTaskResponse' :: Maybe Text
taskArn = Maybe Text
a} :: DescribeTaskResponse)

-- | The managed devices that the task was sent to.
describeTaskResponse_targets :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeTaskResponse_targets :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_targets = (DescribeTaskResponse -> Maybe (NonEmpty Text))
-> (DescribeTaskResponse
    -> Maybe (NonEmpty Text) -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse
     DescribeTaskResponse
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe (NonEmpty Text)
targets :: Maybe (NonEmpty Text)
$sel:targets:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe (NonEmpty Text)
targets} -> Maybe (NonEmpty Text)
targets) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe (NonEmpty Text)
a -> DescribeTaskResponse
s {$sel:targets:DescribeTaskResponse' :: Maybe (NonEmpty Text)
targets = Maybe (NonEmpty Text)
a} :: DescribeTaskResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> DescribeTaskResponse -> f DescribeTaskResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeTaskResponse
-> f DescribeTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When the task was completed.
describeTaskResponse_completedAt :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe Prelude.UTCTime)
describeTaskResponse_completedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_completedAt = (DescribeTaskResponse -> Maybe POSIX)
-> (DescribeTaskResponse -> Maybe POSIX -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse
     DescribeTaskResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe POSIX
completedAt :: Maybe POSIX
$sel:completedAt:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe POSIX
completedAt} -> Maybe POSIX
completedAt) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe POSIX
a -> DescribeTaskResponse
s {$sel:completedAt:DescribeTaskResponse' :: Maybe POSIX
completedAt = Maybe POSIX
a} :: DescribeTaskResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeTaskResponse -> f DescribeTaskResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeTaskResponse
-> f DescribeTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description provided of the task and managed devices.
describeTaskResponse_description :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe Prelude.Text)
describeTaskResponse_description :: (Maybe Text -> f (Maybe Text))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_description = (DescribeTaskResponse -> Maybe Text)
-> (DescribeTaskResponse -> Maybe Text -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse DescribeTaskResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe Text
a -> DescribeTaskResponse
s {$sel:description:DescribeTaskResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeTaskResponse)

-- | Optional metadata that you assign to a resource. You can use tags to
-- categorize a resource in different ways, such as by purpose, owner, or
-- environment.
describeTaskResponse_tags :: Lens.Lens' DescribeTaskResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
describeTaskResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_tags = (DescribeTaskResponse -> Maybe (HashMap Text Text))
-> (DescribeTaskResponse
    -> Maybe (HashMap Text Text) -> DescribeTaskResponse)
-> Lens
     DescribeTaskResponse
     DescribeTaskResponse
     (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 (\DescribeTaskResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:DescribeTaskResponse' :: DescribeTaskResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Maybe (HashMap Text Text)
a -> DescribeTaskResponse
s {$sel:tags:DescribeTaskResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: DescribeTaskResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> DescribeTaskResponse -> f DescribeTaskResponse)
-> ((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)))
-> DescribeTaskResponse
-> f DescribeTaskResponse
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

-- | The response's http status code.
describeTaskResponse_httpStatus :: Lens.Lens' DescribeTaskResponse Prelude.Int
describeTaskResponse_httpStatus :: (Int -> f Int) -> DescribeTaskResponse -> f DescribeTaskResponse
describeTaskResponse_httpStatus = (DescribeTaskResponse -> Int)
-> (DescribeTaskResponse -> Int -> DescribeTaskResponse)
-> Lens DescribeTaskResponse DescribeTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTaskResponse' :: DescribeTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTaskResponse
s@DescribeTaskResponse' {} Int
a -> DescribeTaskResponse
s {$sel:httpStatus:DescribeTaskResponse' :: Int
httpStatus = Int
a} :: DescribeTaskResponse)

instance Prelude.NFData DescribeTaskResponse