{-# 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.Braket.GetQuantumTask
-- 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)
--
-- Retrieves the specified quantum task.
module Amazonka.Braket.GetQuantumTask
  ( -- * Creating a Request
    GetQuantumTask (..),
    newGetQuantumTask,

    -- * Request Lenses
    getQuantumTask_quantumTaskArn,

    -- * Destructuring the Response
    GetQuantumTaskResponse (..),
    newGetQuantumTaskResponse,

    -- * Response Lenses
    getQuantumTaskResponse_failureReason,
    getQuantumTaskResponse_endedAt,
    getQuantumTaskResponse_tags,
    getQuantumTaskResponse_httpStatus,
    getQuantumTaskResponse_createdAt,
    getQuantumTaskResponse_deviceArn,
    getQuantumTaskResponse_deviceParameters,
    getQuantumTaskResponse_outputS3Bucket,
    getQuantumTaskResponse_outputS3Directory,
    getQuantumTaskResponse_quantumTaskArn,
    getQuantumTaskResponse_shots,
    getQuantumTaskResponse_status,
  )
where

import Amazonka.Braket.Types
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

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

-- |
-- Create a value of 'GetQuantumTask' 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:
--
-- 'quantumTaskArn', 'getQuantumTask_quantumTaskArn' - the ARN of the task to retrieve.
newGetQuantumTask ::
  -- | 'quantumTaskArn'
  Prelude.Text ->
  GetQuantumTask
newGetQuantumTask :: Text -> GetQuantumTask
newGetQuantumTask Text
pQuantumTaskArn_ =
  GetQuantumTask' :: Text -> GetQuantumTask
GetQuantumTask' {$sel:quantumTaskArn:GetQuantumTask' :: Text
quantumTaskArn = Text
pQuantumTaskArn_}

-- | the ARN of the task to retrieve.
getQuantumTask_quantumTaskArn :: Lens.Lens' GetQuantumTask Prelude.Text
getQuantumTask_quantumTaskArn :: (Text -> f Text) -> GetQuantumTask -> f GetQuantumTask
getQuantumTask_quantumTaskArn = (GetQuantumTask -> Text)
-> (GetQuantumTask -> Text -> GetQuantumTask)
-> Lens GetQuantumTask GetQuantumTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTask' {Text
quantumTaskArn :: Text
$sel:quantumTaskArn:GetQuantumTask' :: GetQuantumTask -> Text
quantumTaskArn} -> Text
quantumTaskArn) (\s :: GetQuantumTask
s@GetQuantumTask' {} Text
a -> GetQuantumTask
s {$sel:quantumTaskArn:GetQuantumTask' :: Text
quantumTaskArn = Text
a} :: GetQuantumTask)

instance Core.AWSRequest GetQuantumTask where
  type
    AWSResponse GetQuantumTask =
      GetQuantumTaskResponse
  request :: GetQuantumTask -> Request GetQuantumTask
request = Service -> GetQuantumTask -> Request GetQuantumTask
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetQuantumTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetQuantumTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetQuantumTask))
-> Logger
-> Service
-> Proxy GetQuantumTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetQuantumTask)))
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 Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Int
-> POSIX
-> Text
-> Text
-> Text
-> Text
-> Text
-> Integer
-> QuantumTaskStatus
-> GetQuantumTaskResponse
GetQuantumTaskResponse'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe (HashMap Text Text)
 -> Int
 -> POSIX
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> Integer
 -> QuantumTaskStatus
 -> GetQuantumTaskResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Int
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Integer
      -> QuantumTaskStatus
      -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Functor 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
"failureReason")
            Either
  String
  (Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Int
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Integer
   -> QuantumTaskStatus
   -> GetQuantumTaskResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Int
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Integer
      -> QuantumTaskStatus
      -> GetQuantumTaskResponse)
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
"endedAt")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Int
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Integer
   -> QuantumTaskStatus
   -> GetQuantumTaskResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Int
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Integer
      -> QuantumTaskStatus
      -> GetQuantumTaskResponse)
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
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Integer
   -> QuantumTaskStatus
   -> GetQuantumTaskResponse)
-> Either String Int
-> Either
     String
     (POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Integer
      -> QuantumTaskStatus
      -> GetQuantumTaskResponse)
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))
            Either
  String
  (POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Integer
   -> QuantumTaskStatus
   -> GetQuantumTaskResponse)
-> Either String POSIX
-> Either
     String
     (Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Integer
      -> QuantumTaskStatus
      -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"createdAt")
            Either
  String
  (Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Integer
   -> QuantumTaskStatus
   -> GetQuantumTaskResponse)
-> Either String Text
-> Either
     String
     (Text
      -> Text
      -> Text
      -> Text
      -> Integer
      -> QuantumTaskStatus
      -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"deviceArn")
            Either
  String
  (Text
   -> Text
   -> Text
   -> Text
   -> Integer
   -> QuantumTaskStatus
   -> GetQuantumTaskResponse)
-> Either String Text
-> Either
     String
     (Text
      -> Text
      -> Text
      -> Integer
      -> QuantumTaskStatus
      -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"deviceParameters")
            Either
  String
  (Text
   -> Text
   -> Text
   -> Integer
   -> QuantumTaskStatus
   -> GetQuantumTaskResponse)
-> Either String Text
-> Either
     String
     (Text
      -> Text -> Integer -> QuantumTaskStatus -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"outputS3Bucket")
            Either
  String
  (Text
   -> Text -> Integer -> QuantumTaskStatus -> GetQuantumTaskResponse)
-> Either String Text
-> Either
     String
     (Text -> Integer -> QuantumTaskStatus -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"outputS3Directory")
            Either
  String
  (Text -> Integer -> QuantumTaskStatus -> GetQuantumTaskResponse)
-> Either String Text
-> Either
     String (Integer -> QuantumTaskStatus -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"quantumTaskArn")
            Either
  String (Integer -> QuantumTaskStatus -> GetQuantumTaskResponse)
-> Either String Integer
-> Either String (QuantumTaskStatus -> GetQuantumTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Integer
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"shots")
            Either String (QuantumTaskStatus -> GetQuantumTaskResponse)
-> Either String QuantumTaskStatus
-> Either String GetQuantumTaskResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String QuantumTaskStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"status")
      )

instance Prelude.Hashable GetQuantumTask

instance Prelude.NFData GetQuantumTask

instance Core.ToHeaders GetQuantumTask where
  toHeaders :: GetQuantumTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetQuantumTask -> 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.ToPath GetQuantumTask where
  toPath :: GetQuantumTask -> ByteString
toPath GetQuantumTask' {Text
quantumTaskArn :: Text
$sel:quantumTaskArn:GetQuantumTask' :: GetQuantumTask -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/quantum-task/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
quantumTaskArn]

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

-- | /See:/ 'newGetQuantumTaskResponse' smart constructor.
data GetQuantumTaskResponse = GetQuantumTaskResponse'
  { -- | The reason that a task failed.
    GetQuantumTaskResponse -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The time at which the task ended.
    GetQuantumTaskResponse -> Maybe POSIX
endedAt :: Prelude.Maybe Core.POSIX,
    -- | The tags that belong to this task.
    GetQuantumTaskResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    GetQuantumTaskResponse -> Int
httpStatus :: Prelude.Int,
    -- | The time at which the task was created.
    GetQuantumTaskResponse -> POSIX
createdAt :: Core.POSIX,
    -- | The ARN of the device the task was run on.
    GetQuantumTaskResponse -> Text
deviceArn :: Prelude.Text,
    -- | The parameters for the device on which the task ran.
    GetQuantumTaskResponse -> Text
deviceParameters :: Prelude.Text,
    -- | The S3 bucket where task results are stored.
    GetQuantumTaskResponse -> Text
outputS3Bucket :: Prelude.Text,
    -- | The folder in the S3 bucket where task results are stored.
    GetQuantumTaskResponse -> Text
outputS3Directory :: Prelude.Text,
    -- | The ARN of the task.
    GetQuantumTaskResponse -> Text
quantumTaskArn :: Prelude.Text,
    -- | The number of shots used in the task.
    GetQuantumTaskResponse -> Integer
shots :: Prelude.Integer,
    -- | The status of the task.
    GetQuantumTaskResponse -> QuantumTaskStatus
status :: QuantumTaskStatus
  }
  deriving (GetQuantumTaskResponse -> GetQuantumTaskResponse -> Bool
(GetQuantumTaskResponse -> GetQuantumTaskResponse -> Bool)
-> (GetQuantumTaskResponse -> GetQuantumTaskResponse -> Bool)
-> Eq GetQuantumTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetQuantumTaskResponse -> GetQuantumTaskResponse -> Bool
$c/= :: GetQuantumTaskResponse -> GetQuantumTaskResponse -> Bool
== :: GetQuantumTaskResponse -> GetQuantumTaskResponse -> Bool
$c== :: GetQuantumTaskResponse -> GetQuantumTaskResponse -> Bool
Prelude.Eq, ReadPrec [GetQuantumTaskResponse]
ReadPrec GetQuantumTaskResponse
Int -> ReadS GetQuantumTaskResponse
ReadS [GetQuantumTaskResponse]
(Int -> ReadS GetQuantumTaskResponse)
-> ReadS [GetQuantumTaskResponse]
-> ReadPrec GetQuantumTaskResponse
-> ReadPrec [GetQuantumTaskResponse]
-> Read GetQuantumTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetQuantumTaskResponse]
$creadListPrec :: ReadPrec [GetQuantumTaskResponse]
readPrec :: ReadPrec GetQuantumTaskResponse
$creadPrec :: ReadPrec GetQuantumTaskResponse
readList :: ReadS [GetQuantumTaskResponse]
$creadList :: ReadS [GetQuantumTaskResponse]
readsPrec :: Int -> ReadS GetQuantumTaskResponse
$creadsPrec :: Int -> ReadS GetQuantumTaskResponse
Prelude.Read, Int -> GetQuantumTaskResponse -> ShowS
[GetQuantumTaskResponse] -> ShowS
GetQuantumTaskResponse -> String
(Int -> GetQuantumTaskResponse -> ShowS)
-> (GetQuantumTaskResponse -> String)
-> ([GetQuantumTaskResponse] -> ShowS)
-> Show GetQuantumTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetQuantumTaskResponse] -> ShowS
$cshowList :: [GetQuantumTaskResponse] -> ShowS
show :: GetQuantumTaskResponse -> String
$cshow :: GetQuantumTaskResponse -> String
showsPrec :: Int -> GetQuantumTaskResponse -> ShowS
$cshowsPrec :: Int -> GetQuantumTaskResponse -> ShowS
Prelude.Show, (forall x. GetQuantumTaskResponse -> Rep GetQuantumTaskResponse x)
-> (forall x.
    Rep GetQuantumTaskResponse x -> GetQuantumTaskResponse)
-> Generic GetQuantumTaskResponse
forall x. Rep GetQuantumTaskResponse x -> GetQuantumTaskResponse
forall x. GetQuantumTaskResponse -> Rep GetQuantumTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetQuantumTaskResponse x -> GetQuantumTaskResponse
$cfrom :: forall x. GetQuantumTaskResponse -> Rep GetQuantumTaskResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetQuantumTaskResponse' 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:
--
-- 'failureReason', 'getQuantumTaskResponse_failureReason' - The reason that a task failed.
--
-- 'endedAt', 'getQuantumTaskResponse_endedAt' - The time at which the task ended.
--
-- 'tags', 'getQuantumTaskResponse_tags' - The tags that belong to this task.
--
-- 'httpStatus', 'getQuantumTaskResponse_httpStatus' - The response's http status code.
--
-- 'createdAt', 'getQuantumTaskResponse_createdAt' - The time at which the task was created.
--
-- 'deviceArn', 'getQuantumTaskResponse_deviceArn' - The ARN of the device the task was run on.
--
-- 'deviceParameters', 'getQuantumTaskResponse_deviceParameters' - The parameters for the device on which the task ran.
--
-- 'outputS3Bucket', 'getQuantumTaskResponse_outputS3Bucket' - The S3 bucket where task results are stored.
--
-- 'outputS3Directory', 'getQuantumTaskResponse_outputS3Directory' - The folder in the S3 bucket where task results are stored.
--
-- 'quantumTaskArn', 'getQuantumTaskResponse_quantumTaskArn' - The ARN of the task.
--
-- 'shots', 'getQuantumTaskResponse_shots' - The number of shots used in the task.
--
-- 'status', 'getQuantumTaskResponse_status' - The status of the task.
newGetQuantumTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'deviceArn'
  Prelude.Text ->
  -- | 'deviceParameters'
  Prelude.Text ->
  -- | 'outputS3Bucket'
  Prelude.Text ->
  -- | 'outputS3Directory'
  Prelude.Text ->
  -- | 'quantumTaskArn'
  Prelude.Text ->
  -- | 'shots'
  Prelude.Integer ->
  -- | 'status'
  QuantumTaskStatus ->
  GetQuantumTaskResponse
newGetQuantumTaskResponse :: Int
-> UTCTime
-> Text
-> Text
-> Text
-> Text
-> Text
-> Integer
-> QuantumTaskStatus
-> GetQuantumTaskResponse
newGetQuantumTaskResponse
  Int
pHttpStatus_
  UTCTime
pCreatedAt_
  Text
pDeviceArn_
  Text
pDeviceParameters_
  Text
pOutputS3Bucket_
  Text
pOutputS3Directory_
  Text
pQuantumTaskArn_
  Integer
pShots_
  QuantumTaskStatus
pStatus_ =
    GetQuantumTaskResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Int
-> POSIX
-> Text
-> Text
-> Text
-> Text
-> Text
-> Integer
-> QuantumTaskStatus
-> GetQuantumTaskResponse
GetQuantumTaskResponse'
      { $sel:failureReason:GetQuantumTaskResponse' :: Maybe Text
failureReason =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:endedAt:GetQuantumTaskResponse' :: Maybe POSIX
endedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:GetQuantumTaskResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetQuantumTaskResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:createdAt:GetQuantumTaskResponse' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:deviceArn:GetQuantumTaskResponse' :: Text
deviceArn = Text
pDeviceArn_,
        $sel:deviceParameters:GetQuantumTaskResponse' :: Text
deviceParameters = Text
pDeviceParameters_,
        $sel:outputS3Bucket:GetQuantumTaskResponse' :: Text
outputS3Bucket = Text
pOutputS3Bucket_,
        $sel:outputS3Directory:GetQuantumTaskResponse' :: Text
outputS3Directory = Text
pOutputS3Directory_,
        $sel:quantumTaskArn:GetQuantumTaskResponse' :: Text
quantumTaskArn = Text
pQuantumTaskArn_,
        $sel:shots:GetQuantumTaskResponse' :: Integer
shots = Integer
pShots_,
        $sel:status:GetQuantumTaskResponse' :: QuantumTaskStatus
status = QuantumTaskStatus
pStatus_
      }

-- | The reason that a task failed.
getQuantumTaskResponse_failureReason :: Lens.Lens' GetQuantumTaskResponse (Prelude.Maybe Prelude.Text)
getQuantumTaskResponse_failureReason :: (Maybe Text -> f (Maybe Text))
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_failureReason = (GetQuantumTaskResponse -> Maybe Text)
-> (GetQuantumTaskResponse -> Maybe Text -> GetQuantumTaskResponse)
-> Lens
     GetQuantumTaskResponse
     GetQuantumTaskResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Maybe Text
a -> GetQuantumTaskResponse
s {$sel:failureReason:GetQuantumTaskResponse' :: Maybe Text
failureReason = Maybe Text
a} :: GetQuantumTaskResponse)

-- | The time at which the task ended.
getQuantumTaskResponse_endedAt :: Lens.Lens' GetQuantumTaskResponse (Prelude.Maybe Prelude.UTCTime)
getQuantumTaskResponse_endedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_endedAt = (GetQuantumTaskResponse -> Maybe POSIX)
-> (GetQuantumTaskResponse
    -> Maybe POSIX -> GetQuantumTaskResponse)
-> Lens
     GetQuantumTaskResponse
     GetQuantumTaskResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Maybe POSIX
endedAt :: Maybe POSIX
$sel:endedAt:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Maybe POSIX
endedAt} -> Maybe POSIX
endedAt) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Maybe POSIX
a -> GetQuantumTaskResponse
s {$sel:endedAt:GetQuantumTaskResponse' :: Maybe POSIX
endedAt = Maybe POSIX
a} :: GetQuantumTaskResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetQuantumTaskResponse -> f GetQuantumTaskResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetQuantumTaskResponse
-> f GetQuantumTaskResponse
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 tags that belong to this task.
getQuantumTaskResponse_tags :: Lens.Lens' GetQuantumTaskResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getQuantumTaskResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_tags = (GetQuantumTaskResponse -> Maybe (HashMap Text Text))
-> (GetQuantumTaskResponse
    -> Maybe (HashMap Text Text) -> GetQuantumTaskResponse)
-> Lens
     GetQuantumTaskResponse
     GetQuantumTaskResponse
     (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 (\GetQuantumTaskResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Maybe (HashMap Text Text)
a -> GetQuantumTaskResponse
s {$sel:tags:GetQuantumTaskResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetQuantumTaskResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetQuantumTaskResponse -> f GetQuantumTaskResponse)
-> ((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)))
-> GetQuantumTaskResponse
-> f GetQuantumTaskResponse
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.
getQuantumTaskResponse_httpStatus :: Lens.Lens' GetQuantumTaskResponse Prelude.Int
getQuantumTaskResponse_httpStatus :: (Int -> f Int)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_httpStatus = (GetQuantumTaskResponse -> Int)
-> (GetQuantumTaskResponse -> Int -> GetQuantumTaskResponse)
-> Lens GetQuantumTaskResponse GetQuantumTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Int
a -> GetQuantumTaskResponse
s {$sel:httpStatus:GetQuantumTaskResponse' :: Int
httpStatus = Int
a} :: GetQuantumTaskResponse)

-- | The time at which the task was created.
getQuantumTaskResponse_createdAt :: Lens.Lens' GetQuantumTaskResponse Prelude.UTCTime
getQuantumTaskResponse_createdAt :: (UTCTime -> f UTCTime)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_createdAt = (GetQuantumTaskResponse -> POSIX)
-> (GetQuantumTaskResponse -> POSIX -> GetQuantumTaskResponse)
-> Lens GetQuantumTaskResponse GetQuantumTaskResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {POSIX
createdAt :: POSIX
$sel:createdAt:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> POSIX
createdAt} -> POSIX
createdAt) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} POSIX
a -> GetQuantumTaskResponse
s {$sel:createdAt:GetQuantumTaskResponse' :: POSIX
createdAt = POSIX
a} :: GetQuantumTaskResponse) ((POSIX -> f POSIX)
 -> GetQuantumTaskResponse -> f GetQuantumTaskResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetQuantumTaskResponse
-> f GetQuantumTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ARN of the device the task was run on.
getQuantumTaskResponse_deviceArn :: Lens.Lens' GetQuantumTaskResponse Prelude.Text
getQuantumTaskResponse_deviceArn :: (Text -> f Text)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_deviceArn = (GetQuantumTaskResponse -> Text)
-> (GetQuantumTaskResponse -> Text -> GetQuantumTaskResponse)
-> Lens GetQuantumTaskResponse GetQuantumTaskResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Text
deviceArn :: Text
$sel:deviceArn:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Text
deviceArn} -> Text
deviceArn) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Text
a -> GetQuantumTaskResponse
s {$sel:deviceArn:GetQuantumTaskResponse' :: Text
deviceArn = Text
a} :: GetQuantumTaskResponse)

-- | The parameters for the device on which the task ran.
getQuantumTaskResponse_deviceParameters :: Lens.Lens' GetQuantumTaskResponse Prelude.Text
getQuantumTaskResponse_deviceParameters :: (Text -> f Text)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_deviceParameters = (GetQuantumTaskResponse -> Text)
-> (GetQuantumTaskResponse -> Text -> GetQuantumTaskResponse)
-> Lens GetQuantumTaskResponse GetQuantumTaskResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Text
deviceParameters :: Text
$sel:deviceParameters:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Text
deviceParameters} -> Text
deviceParameters) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Text
a -> GetQuantumTaskResponse
s {$sel:deviceParameters:GetQuantumTaskResponse' :: Text
deviceParameters = Text
a} :: GetQuantumTaskResponse)

-- | The S3 bucket where task results are stored.
getQuantumTaskResponse_outputS3Bucket :: Lens.Lens' GetQuantumTaskResponse Prelude.Text
getQuantumTaskResponse_outputS3Bucket :: (Text -> f Text)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_outputS3Bucket = (GetQuantumTaskResponse -> Text)
-> (GetQuantumTaskResponse -> Text -> GetQuantumTaskResponse)
-> Lens GetQuantumTaskResponse GetQuantumTaskResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Text
outputS3Bucket :: Text
$sel:outputS3Bucket:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Text
outputS3Bucket} -> Text
outputS3Bucket) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Text
a -> GetQuantumTaskResponse
s {$sel:outputS3Bucket:GetQuantumTaskResponse' :: Text
outputS3Bucket = Text
a} :: GetQuantumTaskResponse)

-- | The folder in the S3 bucket where task results are stored.
getQuantumTaskResponse_outputS3Directory :: Lens.Lens' GetQuantumTaskResponse Prelude.Text
getQuantumTaskResponse_outputS3Directory :: (Text -> f Text)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_outputS3Directory = (GetQuantumTaskResponse -> Text)
-> (GetQuantumTaskResponse -> Text -> GetQuantumTaskResponse)
-> Lens GetQuantumTaskResponse GetQuantumTaskResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Text
outputS3Directory :: Text
$sel:outputS3Directory:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Text
outputS3Directory} -> Text
outputS3Directory) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Text
a -> GetQuantumTaskResponse
s {$sel:outputS3Directory:GetQuantumTaskResponse' :: Text
outputS3Directory = Text
a} :: GetQuantumTaskResponse)

-- | The ARN of the task.
getQuantumTaskResponse_quantumTaskArn :: Lens.Lens' GetQuantumTaskResponse Prelude.Text
getQuantumTaskResponse_quantumTaskArn :: (Text -> f Text)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_quantumTaskArn = (GetQuantumTaskResponse -> Text)
-> (GetQuantumTaskResponse -> Text -> GetQuantumTaskResponse)
-> Lens GetQuantumTaskResponse GetQuantumTaskResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Text
quantumTaskArn :: Text
$sel:quantumTaskArn:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Text
quantumTaskArn} -> Text
quantumTaskArn) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Text
a -> GetQuantumTaskResponse
s {$sel:quantumTaskArn:GetQuantumTaskResponse' :: Text
quantumTaskArn = Text
a} :: GetQuantumTaskResponse)

-- | The number of shots used in the task.
getQuantumTaskResponse_shots :: Lens.Lens' GetQuantumTaskResponse Prelude.Integer
getQuantumTaskResponse_shots :: (Integer -> f Integer)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_shots = (GetQuantumTaskResponse -> Integer)
-> (GetQuantumTaskResponse -> Integer -> GetQuantumTaskResponse)
-> Lens
     GetQuantumTaskResponse GetQuantumTaskResponse Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {Integer
shots :: Integer
$sel:shots:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> Integer
shots} -> Integer
shots) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} Integer
a -> GetQuantumTaskResponse
s {$sel:shots:GetQuantumTaskResponse' :: Integer
shots = Integer
a} :: GetQuantumTaskResponse)

-- | The status of the task.
getQuantumTaskResponse_status :: Lens.Lens' GetQuantumTaskResponse QuantumTaskStatus
getQuantumTaskResponse_status :: (QuantumTaskStatus -> f QuantumTaskStatus)
-> GetQuantumTaskResponse -> f GetQuantumTaskResponse
getQuantumTaskResponse_status = (GetQuantumTaskResponse -> QuantumTaskStatus)
-> (GetQuantumTaskResponse
    -> QuantumTaskStatus -> GetQuantumTaskResponse)
-> Lens
     GetQuantumTaskResponse
     GetQuantumTaskResponse
     QuantumTaskStatus
     QuantumTaskStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQuantumTaskResponse' {QuantumTaskStatus
status :: QuantumTaskStatus
$sel:status:GetQuantumTaskResponse' :: GetQuantumTaskResponse -> QuantumTaskStatus
status} -> QuantumTaskStatus
status) (\s :: GetQuantumTaskResponse
s@GetQuantumTaskResponse' {} QuantumTaskStatus
a -> GetQuantumTaskResponse
s {$sel:status:GetQuantumTaskResponse' :: QuantumTaskStatus
status = QuantumTaskStatus
a} :: GetQuantumTaskResponse)

instance Prelude.NFData GetQuantumTaskResponse