{-# 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.CreateQuantumTask
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a quantum task.
module Amazonka.Braket.CreateQuantumTask
  ( -- * Creating a Request
    CreateQuantumTask (..),
    newCreateQuantumTask,

    -- * Request Lenses
    createQuantumTask_deviceParameters,
    createQuantumTask_jobToken,
    createQuantumTask_tags,
    createQuantumTask_action,
    createQuantumTask_clientToken,
    createQuantumTask_deviceArn,
    createQuantumTask_outputS3Bucket,
    createQuantumTask_outputS3KeyPrefix,
    createQuantumTask_shots,

    -- * Destructuring the Response
    CreateQuantumTaskResponse (..),
    newCreateQuantumTaskResponse,

    -- * Response Lenses
    createQuantumTaskResponse_httpStatus,
    createQuantumTaskResponse_quantumTaskArn,
  )
where

import Amazonka.Braket.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateQuantumTask' smart constructor.
data CreateQuantumTask = CreateQuantumTask'
  { -- | The parameters for the device to run the task on.
    CreateQuantumTask -> Maybe Text
deviceParameters :: Prelude.Maybe Prelude.Text,
    -- | The token for an Amazon Braket job that associates it with the quantum
    -- task.
    CreateQuantumTask -> Maybe Text
jobToken :: Prelude.Maybe Prelude.Text,
    -- | Tags to be added to the quantum task you\'re creating.
    CreateQuantumTask -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The action associated with the task.
    CreateQuantumTask -> Text
action :: Prelude.Text,
    -- | The client token associated with the request.
    CreateQuantumTask -> Text
clientToken :: Prelude.Text,
    -- | The ARN of the device to run the task on.
    CreateQuantumTask -> Text
deviceArn :: Prelude.Text,
    -- | The S3 bucket to store task result files in.
    CreateQuantumTask -> Text
outputS3Bucket :: Prelude.Text,
    -- | The key prefix for the location in the S3 bucket to store task results
    -- in.
    CreateQuantumTask -> Text
outputS3KeyPrefix :: Prelude.Text,
    -- | The number of shots to use for the task.
    CreateQuantumTask -> Natural
shots :: Prelude.Natural
  }
  deriving (CreateQuantumTask -> CreateQuantumTask -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQuantumTask -> CreateQuantumTask -> Bool
$c/= :: CreateQuantumTask -> CreateQuantumTask -> Bool
== :: CreateQuantumTask -> CreateQuantumTask -> Bool
$c== :: CreateQuantumTask -> CreateQuantumTask -> Bool
Prelude.Eq, ReadPrec [CreateQuantumTask]
ReadPrec CreateQuantumTask
Int -> ReadS CreateQuantumTask
ReadS [CreateQuantumTask]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQuantumTask]
$creadListPrec :: ReadPrec [CreateQuantumTask]
readPrec :: ReadPrec CreateQuantumTask
$creadPrec :: ReadPrec CreateQuantumTask
readList :: ReadS [CreateQuantumTask]
$creadList :: ReadS [CreateQuantumTask]
readsPrec :: Int -> ReadS CreateQuantumTask
$creadsPrec :: Int -> ReadS CreateQuantumTask
Prelude.Read, Int -> CreateQuantumTask -> ShowS
[CreateQuantumTask] -> ShowS
CreateQuantumTask -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQuantumTask] -> ShowS
$cshowList :: [CreateQuantumTask] -> ShowS
show :: CreateQuantumTask -> String
$cshow :: CreateQuantumTask -> String
showsPrec :: Int -> CreateQuantumTask -> ShowS
$cshowsPrec :: Int -> CreateQuantumTask -> ShowS
Prelude.Show, forall x. Rep CreateQuantumTask x -> CreateQuantumTask
forall x. CreateQuantumTask -> Rep CreateQuantumTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateQuantumTask x -> CreateQuantumTask
$cfrom :: forall x. CreateQuantumTask -> Rep CreateQuantumTask x
Prelude.Generic)

-- |
-- Create a value of 'CreateQuantumTask' 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:
--
-- 'deviceParameters', 'createQuantumTask_deviceParameters' - The parameters for the device to run the task on.
--
-- 'jobToken', 'createQuantumTask_jobToken' - The token for an Amazon Braket job that associates it with the quantum
-- task.
--
-- 'tags', 'createQuantumTask_tags' - Tags to be added to the quantum task you\'re creating.
--
-- 'action', 'createQuantumTask_action' - The action associated with the task.
--
-- 'clientToken', 'createQuantumTask_clientToken' - The client token associated with the request.
--
-- 'deviceArn', 'createQuantumTask_deviceArn' - The ARN of the device to run the task on.
--
-- 'outputS3Bucket', 'createQuantumTask_outputS3Bucket' - The S3 bucket to store task result files in.
--
-- 'outputS3KeyPrefix', 'createQuantumTask_outputS3KeyPrefix' - The key prefix for the location in the S3 bucket to store task results
-- in.
--
-- 'shots', 'createQuantumTask_shots' - The number of shots to use for the task.
newCreateQuantumTask ::
  -- | 'action'
  Prelude.Text ->
  -- | 'clientToken'
  Prelude.Text ->
  -- | 'deviceArn'
  Prelude.Text ->
  -- | 'outputS3Bucket'
  Prelude.Text ->
  -- | 'outputS3KeyPrefix'
  Prelude.Text ->
  -- | 'shots'
  Prelude.Natural ->
  CreateQuantumTask
newCreateQuantumTask :: Text
-> Text -> Text -> Text -> Text -> Natural -> CreateQuantumTask
newCreateQuantumTask
  Text
pAction_
  Text
pClientToken_
  Text
pDeviceArn_
  Text
pOutputS3Bucket_
  Text
pOutputS3KeyPrefix_
  Natural
pShots_ =
    CreateQuantumTask'
      { $sel:deviceParameters:CreateQuantumTask' :: Maybe Text
deviceParameters =
          forall a. Maybe a
Prelude.Nothing,
        $sel:jobToken:CreateQuantumTask' :: Maybe Text
jobToken = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateQuantumTask' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:action:CreateQuantumTask' :: Text
action = Text
pAction_,
        $sel:clientToken:CreateQuantumTask' :: Text
clientToken = Text
pClientToken_,
        $sel:deviceArn:CreateQuantumTask' :: Text
deviceArn = Text
pDeviceArn_,
        $sel:outputS3Bucket:CreateQuantumTask' :: Text
outputS3Bucket = Text
pOutputS3Bucket_,
        $sel:outputS3KeyPrefix:CreateQuantumTask' :: Text
outputS3KeyPrefix = Text
pOutputS3KeyPrefix_,
        $sel:shots:CreateQuantumTask' :: Natural
shots = Natural
pShots_
      }

-- | The parameters for the device to run the task on.
createQuantumTask_deviceParameters :: Lens.Lens' CreateQuantumTask (Prelude.Maybe Prelude.Text)
createQuantumTask_deviceParameters :: Lens' CreateQuantumTask (Maybe Text)
createQuantumTask_deviceParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Maybe Text
deviceParameters :: Maybe Text
$sel:deviceParameters:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
deviceParameters} -> Maybe Text
deviceParameters) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Maybe Text
a -> CreateQuantumTask
s {$sel:deviceParameters:CreateQuantumTask' :: Maybe Text
deviceParameters = Maybe Text
a} :: CreateQuantumTask)

-- | The token for an Amazon Braket job that associates it with the quantum
-- task.
createQuantumTask_jobToken :: Lens.Lens' CreateQuantumTask (Prelude.Maybe Prelude.Text)
createQuantumTask_jobToken :: Lens' CreateQuantumTask (Maybe Text)
createQuantumTask_jobToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Maybe Text
jobToken :: Maybe Text
$sel:jobToken:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
jobToken} -> Maybe Text
jobToken) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Maybe Text
a -> CreateQuantumTask
s {$sel:jobToken:CreateQuantumTask' :: Maybe Text
jobToken = Maybe Text
a} :: CreateQuantumTask)

-- | Tags to be added to the quantum task you\'re creating.
createQuantumTask_tags :: Lens.Lens' CreateQuantumTask (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createQuantumTask_tags :: Lens' CreateQuantumTask (Maybe (HashMap Text Text))
createQuantumTask_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateQuantumTask' :: CreateQuantumTask -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Maybe (HashMap Text Text)
a -> CreateQuantumTask
s {$sel:tags:CreateQuantumTask' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateQuantumTask) 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

-- | The action associated with the task.
createQuantumTask_action :: Lens.Lens' CreateQuantumTask Prelude.Text
createQuantumTask_action :: Lens' CreateQuantumTask Text
createQuantumTask_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Text
action :: Text
$sel:action:CreateQuantumTask' :: CreateQuantumTask -> Text
action} -> Text
action) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Text
a -> CreateQuantumTask
s {$sel:action:CreateQuantumTask' :: Text
action = Text
a} :: CreateQuantumTask)

-- | The client token associated with the request.
createQuantumTask_clientToken :: Lens.Lens' CreateQuantumTask Prelude.Text
createQuantumTask_clientToken :: Lens' CreateQuantumTask Text
createQuantumTask_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Text
clientToken :: Text
$sel:clientToken:CreateQuantumTask' :: CreateQuantumTask -> Text
clientToken} -> Text
clientToken) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Text
a -> CreateQuantumTask
s {$sel:clientToken:CreateQuantumTask' :: Text
clientToken = Text
a} :: CreateQuantumTask)

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

-- | The S3 bucket to store task result files in.
createQuantumTask_outputS3Bucket :: Lens.Lens' CreateQuantumTask Prelude.Text
createQuantumTask_outputS3Bucket :: Lens' CreateQuantumTask Text
createQuantumTask_outputS3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Text
outputS3Bucket :: Text
$sel:outputS3Bucket:CreateQuantumTask' :: CreateQuantumTask -> Text
outputS3Bucket} -> Text
outputS3Bucket) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Text
a -> CreateQuantumTask
s {$sel:outputS3Bucket:CreateQuantumTask' :: Text
outputS3Bucket = Text
a} :: CreateQuantumTask)

-- | The key prefix for the location in the S3 bucket to store task results
-- in.
createQuantumTask_outputS3KeyPrefix :: Lens.Lens' CreateQuantumTask Prelude.Text
createQuantumTask_outputS3KeyPrefix :: Lens' CreateQuantumTask Text
createQuantumTask_outputS3KeyPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Text
outputS3KeyPrefix :: Text
$sel:outputS3KeyPrefix:CreateQuantumTask' :: CreateQuantumTask -> Text
outputS3KeyPrefix} -> Text
outputS3KeyPrefix) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Text
a -> CreateQuantumTask
s {$sel:outputS3KeyPrefix:CreateQuantumTask' :: Text
outputS3KeyPrefix = Text
a} :: CreateQuantumTask)

-- | The number of shots to use for the task.
createQuantumTask_shots :: Lens.Lens' CreateQuantumTask Prelude.Natural
createQuantumTask_shots :: Lens' CreateQuantumTask Natural
createQuantumTask_shots = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTask' {Natural
shots :: Natural
$sel:shots:CreateQuantumTask' :: CreateQuantumTask -> Natural
shots} -> Natural
shots) (\s :: CreateQuantumTask
s@CreateQuantumTask' {} Natural
a -> CreateQuantumTask
s {$sel:shots:CreateQuantumTask' :: Natural
shots = Natural
a} :: CreateQuantumTask)

instance Core.AWSRequest CreateQuantumTask where
  type
    AWSResponse CreateQuantumTask =
      CreateQuantumTaskResponse
  request :: (Service -> Service)
-> CreateQuantumTask -> Request CreateQuantumTask
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateQuantumTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateQuantumTask)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> CreateQuantumTaskResponse
CreateQuantumTaskResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"quantumTaskArn")
      )

instance Prelude.Hashable CreateQuantumTask where
  hashWithSalt :: Int -> CreateQuantumTask -> Int
hashWithSalt Int
_salt CreateQuantumTask' {Natural
Maybe Text
Maybe (HashMap Text Text)
Text
shots :: Natural
outputS3KeyPrefix :: Text
outputS3Bucket :: Text
deviceArn :: Text
clientToken :: Text
action :: Text
tags :: Maybe (HashMap Text Text)
jobToken :: Maybe Text
deviceParameters :: Maybe Text
$sel:shots:CreateQuantumTask' :: CreateQuantumTask -> Natural
$sel:outputS3KeyPrefix:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:outputS3Bucket:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:deviceArn:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:clientToken:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:action:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:tags:CreateQuantumTask' :: CreateQuantumTask -> Maybe (HashMap Text Text)
$sel:jobToken:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
$sel:deviceParameters:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
action
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
outputS3Bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
outputS3KeyPrefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
shots

instance Prelude.NFData CreateQuantumTask where
  rnf :: CreateQuantumTask -> ()
rnf CreateQuantumTask' {Natural
Maybe Text
Maybe (HashMap Text Text)
Text
shots :: Natural
outputS3KeyPrefix :: Text
outputS3Bucket :: Text
deviceArn :: Text
clientToken :: Text
action :: Text
tags :: Maybe (HashMap Text Text)
jobToken :: Maybe Text
deviceParameters :: Maybe Text
$sel:shots:CreateQuantumTask' :: CreateQuantumTask -> Natural
$sel:outputS3KeyPrefix:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:outputS3Bucket:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:deviceArn:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:clientToken:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:action:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:tags:CreateQuantumTask' :: CreateQuantumTask -> Maybe (HashMap Text Text)
$sel:jobToken:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
$sel:deviceParameters:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobToken
      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 Text
action
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
deviceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
outputS3Bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
outputS3KeyPrefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
shots

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

instance Data.ToJSON CreateQuantumTask where
  toJSON :: CreateQuantumTask -> Value
toJSON CreateQuantumTask' {Natural
Maybe Text
Maybe (HashMap Text Text)
Text
shots :: Natural
outputS3KeyPrefix :: Text
outputS3Bucket :: Text
deviceArn :: Text
clientToken :: Text
action :: Text
tags :: Maybe (HashMap Text Text)
jobToken :: Maybe Text
deviceParameters :: Maybe Text
$sel:shots:CreateQuantumTask' :: CreateQuantumTask -> Natural
$sel:outputS3KeyPrefix:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:outputS3Bucket:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:deviceArn:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:clientToken:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:action:CreateQuantumTask' :: CreateQuantumTask -> Text
$sel:tags:CreateQuantumTask' :: CreateQuantumTask -> Maybe (HashMap Text Text)
$sel:jobToken:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
$sel:deviceParameters:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"deviceParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceParameters,
            (Key
"jobToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobToken,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
action),
            forall a. a -> Maybe a
Prelude.Just (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientToken),
            forall a. a -> Maybe a
Prelude.Just (Key
"deviceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deviceArn),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"outputS3Bucket" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
outputS3Bucket),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"outputS3KeyPrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
outputS3KeyPrefix),
            forall a. a -> Maybe a
Prelude.Just (Key
"shots" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
shots)
          ]
      )

instance Data.ToPath CreateQuantumTask where
  toPath :: CreateQuantumTask -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/quantum-task"

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

-- | /See:/ 'newCreateQuantumTaskResponse' smart constructor.
data CreateQuantumTaskResponse = CreateQuantumTaskResponse'
  { -- | The response's http status code.
    CreateQuantumTaskResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ARN of the task created by the request.
    CreateQuantumTaskResponse -> Text
quantumTaskArn :: Prelude.Text
  }
  deriving (CreateQuantumTaskResponse -> CreateQuantumTaskResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQuantumTaskResponse -> CreateQuantumTaskResponse -> Bool
$c/= :: CreateQuantumTaskResponse -> CreateQuantumTaskResponse -> Bool
== :: CreateQuantumTaskResponse -> CreateQuantumTaskResponse -> Bool
$c== :: CreateQuantumTaskResponse -> CreateQuantumTaskResponse -> Bool
Prelude.Eq, ReadPrec [CreateQuantumTaskResponse]
ReadPrec CreateQuantumTaskResponse
Int -> ReadS CreateQuantumTaskResponse
ReadS [CreateQuantumTaskResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQuantumTaskResponse]
$creadListPrec :: ReadPrec [CreateQuantumTaskResponse]
readPrec :: ReadPrec CreateQuantumTaskResponse
$creadPrec :: ReadPrec CreateQuantumTaskResponse
readList :: ReadS [CreateQuantumTaskResponse]
$creadList :: ReadS [CreateQuantumTaskResponse]
readsPrec :: Int -> ReadS CreateQuantumTaskResponse
$creadsPrec :: Int -> ReadS CreateQuantumTaskResponse
Prelude.Read, Int -> CreateQuantumTaskResponse -> ShowS
[CreateQuantumTaskResponse] -> ShowS
CreateQuantumTaskResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQuantumTaskResponse] -> ShowS
$cshowList :: [CreateQuantumTaskResponse] -> ShowS
show :: CreateQuantumTaskResponse -> String
$cshow :: CreateQuantumTaskResponse -> String
showsPrec :: Int -> CreateQuantumTaskResponse -> ShowS
$cshowsPrec :: Int -> CreateQuantumTaskResponse -> ShowS
Prelude.Show, forall x.
Rep CreateQuantumTaskResponse x -> CreateQuantumTaskResponse
forall x.
CreateQuantumTaskResponse -> Rep CreateQuantumTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateQuantumTaskResponse x -> CreateQuantumTaskResponse
$cfrom :: forall x.
CreateQuantumTaskResponse -> Rep CreateQuantumTaskResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateQuantumTaskResponse' 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:
--
-- 'httpStatus', 'createQuantumTaskResponse_httpStatus' - The response's http status code.
--
-- 'quantumTaskArn', 'createQuantumTaskResponse_quantumTaskArn' - The ARN of the task created by the request.
newCreateQuantumTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'quantumTaskArn'
  Prelude.Text ->
  CreateQuantumTaskResponse
newCreateQuantumTaskResponse :: Int -> Text -> CreateQuantumTaskResponse
newCreateQuantumTaskResponse
  Int
pHttpStatus_
  Text
pQuantumTaskArn_ =
    CreateQuantumTaskResponse'
      { $sel:httpStatus:CreateQuantumTaskResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:quantumTaskArn:CreateQuantumTaskResponse' :: Text
quantumTaskArn = Text
pQuantumTaskArn_
      }

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

-- | The ARN of the task created by the request.
createQuantumTaskResponse_quantumTaskArn :: Lens.Lens' CreateQuantumTaskResponse Prelude.Text
createQuantumTaskResponse_quantumTaskArn :: Lens' CreateQuantumTaskResponse Text
createQuantumTaskResponse_quantumTaskArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuantumTaskResponse' {Text
quantumTaskArn :: Text
$sel:quantumTaskArn:CreateQuantumTaskResponse' :: CreateQuantumTaskResponse -> Text
quantumTaskArn} -> Text
quantumTaskArn) (\s :: CreateQuantumTaskResponse
s@CreateQuantumTaskResponse' {} Text
a -> CreateQuantumTaskResponse
s {$sel:quantumTaskArn:CreateQuantumTaskResponse' :: Text
quantumTaskArn = Text
a} :: CreateQuantumTaskResponse)

instance Prelude.NFData CreateQuantumTaskResponse where
  rnf :: CreateQuantumTaskResponse -> ()
rnf CreateQuantumTaskResponse' {Int
Text
quantumTaskArn :: Text
httpStatus :: Int
$sel:quantumTaskArn:CreateQuantumTaskResponse' :: CreateQuantumTaskResponse -> Text
$sel:httpStatus:CreateQuantumTaskResponse' :: CreateQuantumTaskResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
quantumTaskArn