{-# 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-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)
--
-- Creates a quantum task.
module Amazonka.Braket.CreateQuantumTask
  ( -- * Creating a Request
    CreateQuantumTask (..),
    newCreateQuantumTask,

    -- * Request Lenses
    createQuantumTask_deviceParameters,
    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.Lens as Lens
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,
    -- | 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
(CreateQuantumTask -> CreateQuantumTask -> Bool)
-> (CreateQuantumTask -> CreateQuantumTask -> Bool)
-> Eq CreateQuantumTask
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]
(Int -> ReadS CreateQuantumTask)
-> ReadS [CreateQuantumTask]
-> ReadPrec CreateQuantumTask
-> ReadPrec [CreateQuantumTask]
-> Read 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
(Int -> CreateQuantumTask -> ShowS)
-> (CreateQuantumTask -> String)
-> ([CreateQuantumTask] -> ShowS)
-> Show CreateQuantumTask
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. CreateQuantumTask -> Rep CreateQuantumTask x)
-> (forall x. Rep CreateQuantumTask x -> CreateQuantumTask)
-> Generic CreateQuantumTask
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.
--
-- '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' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> Text
-> Text
-> Natural
-> CreateQuantumTask
CreateQuantumTask'
      { $sel:deviceParameters:CreateQuantumTask' :: Maybe Text
deviceParameters =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateQuantumTask' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
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 :: (Maybe Text -> f (Maybe Text))
-> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_deviceParameters = (CreateQuantumTask -> Maybe Text)
-> (CreateQuantumTask -> Maybe Text -> CreateQuantumTask)
-> Lens
     CreateQuantumTask CreateQuantumTask (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_tags = (CreateQuantumTask -> Maybe (HashMap Text Text))
-> (CreateQuantumTask
    -> Maybe (HashMap Text Text) -> CreateQuantumTask)
-> Lens
     CreateQuantumTask
     CreateQuantumTask
     (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 (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateQuantumTask -> f CreateQuantumTask)
-> ((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)))
-> CreateQuantumTask
-> f CreateQuantumTask
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 action associated with the task.
createQuantumTask_action :: Lens.Lens' CreateQuantumTask Prelude.Text
createQuantumTask_action :: (Text -> f Text) -> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_action = (CreateQuantumTask -> Text)
-> (CreateQuantumTask -> Text -> CreateQuantumTask)
-> Lens CreateQuantumTask CreateQuantumTask Text Text
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 :: (Text -> f Text) -> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_clientToken = (CreateQuantumTask -> Text)
-> (CreateQuantumTask -> Text -> CreateQuantumTask)
-> Lens CreateQuantumTask CreateQuantumTask Text Text
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 :: (Text -> f Text) -> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_deviceArn = (CreateQuantumTask -> Text)
-> (CreateQuantumTask -> Text -> CreateQuantumTask)
-> Lens CreateQuantumTask CreateQuantumTask Text Text
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 :: (Text -> f Text) -> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_outputS3Bucket = (CreateQuantumTask -> Text)
-> (CreateQuantumTask -> Text -> CreateQuantumTask)
-> Lens CreateQuantumTask CreateQuantumTask Text Text
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 :: (Text -> f Text) -> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_outputS3KeyPrefix = (CreateQuantumTask -> Text)
-> (CreateQuantumTask -> Text -> CreateQuantumTask)
-> Lens CreateQuantumTask CreateQuantumTask Text Text
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 :: (Natural -> f Natural) -> CreateQuantumTask -> f CreateQuantumTask
createQuantumTask_shots = (CreateQuantumTask -> Natural)
-> (CreateQuantumTask -> Natural -> CreateQuantumTask)
-> Lens CreateQuantumTask CreateQuantumTask Natural Natural
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 :: CreateQuantumTask -> Request CreateQuantumTask
request = Service -> CreateQuantumTask -> Request CreateQuantumTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateQuantumTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateQuantumTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateQuantumTask))
-> Logger
-> Service
-> Proxy CreateQuantumTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateQuantumTask)))
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 ->
          Int -> Text -> CreateQuantumTaskResponse
CreateQuantumTaskResponse'
            (Int -> Text -> CreateQuantumTaskResponse)
-> Either String Int
-> Either String (Text -> CreateQuantumTaskResponse)
forall (f :: * -> *) a b. Functor 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 (Text -> CreateQuantumTaskResponse)
-> Either String Text -> Either String CreateQuantumTaskResponse
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")
      )

instance Prelude.Hashable CreateQuantumTask

instance Prelude.NFData CreateQuantumTask

instance Core.ToHeaders CreateQuantumTask where
  toHeaders :: CreateQuantumTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateQuantumTask -> 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 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)
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:deviceParameters:CreateQuantumTask' :: CreateQuantumTask -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"deviceParameters" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceParameters,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"action" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
action),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"deviceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"outputS3Bucket" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outputS3Bucket),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"outputS3KeyPrefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outputS3KeyPrefix),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"shots" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
shots)
          ]
      )

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

instance Core.ToQuery CreateQuantumTask where
  toQuery :: CreateQuantumTask -> QueryString
toQuery = QueryString -> CreateQuantumTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateQuantumTaskResponse -> CreateQuantumTaskResponse -> Bool)
-> (CreateQuantumTaskResponse -> CreateQuantumTaskResponse -> Bool)
-> Eq CreateQuantumTaskResponse
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]
(Int -> ReadS CreateQuantumTaskResponse)
-> ReadS [CreateQuantumTaskResponse]
-> ReadPrec CreateQuantumTaskResponse
-> ReadPrec [CreateQuantumTaskResponse]
-> Read 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
(Int -> CreateQuantumTaskResponse -> ShowS)
-> (CreateQuantumTaskResponse -> String)
-> ([CreateQuantumTaskResponse] -> ShowS)
-> Show CreateQuantumTaskResponse
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.
 CreateQuantumTaskResponse -> Rep CreateQuantumTaskResponse x)
-> (forall x.
    Rep CreateQuantumTaskResponse x -> CreateQuantumTaskResponse)
-> Generic CreateQuantumTaskResponse
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' :: Int -> Text -> CreateQuantumTaskResponse
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 :: (Int -> f Int)
-> CreateQuantumTaskResponse -> f CreateQuantumTaskResponse
createQuantumTaskResponse_httpStatus = (CreateQuantumTaskResponse -> Int)
-> (CreateQuantumTaskResponse -> Int -> CreateQuantumTaskResponse)
-> Lens CreateQuantumTaskResponse CreateQuantumTaskResponse Int Int
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 :: (Text -> f Text)
-> CreateQuantumTaskResponse -> f CreateQuantumTaskResponse
createQuantumTaskResponse_quantumTaskArn = (CreateQuantumTaskResponse -> Text)
-> (CreateQuantumTaskResponse -> Text -> CreateQuantumTaskResponse)
-> Lens
     CreateQuantumTaskResponse CreateQuantumTaskResponse Text Text
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