{-# 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.SearchQuantumTasks
-- 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)
--
-- Searches for tasks that match the specified filter values.
--
-- This operation returns paginated results.
module Amazonka.Braket.SearchQuantumTasks
  ( -- * Creating a Request
    SearchQuantumTasks (..),
    newSearchQuantumTasks,

    -- * Request Lenses
    searchQuantumTasks_nextToken,
    searchQuantumTasks_maxResults,
    searchQuantumTasks_filters,

    -- * Destructuring the Response
    SearchQuantumTasksResponse (..),
    newSearchQuantumTasksResponse,

    -- * Response Lenses
    searchQuantumTasksResponse_nextToken,
    searchQuantumTasksResponse_httpStatus,
    searchQuantumTasksResponse_quantumTasks,
  )
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:/ 'newSearchQuantumTasks' smart constructor.
data SearchQuantumTasks = SearchQuantumTasks'
  { -- | A token used for pagination of results returned in the response. Use the
    -- token returned from the previous request continue results where the
    -- previous request ended.
    SearchQuantumTasks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of results to return in the response.
    SearchQuantumTasks -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Array of @SearchQuantumTasksFilter@ objects.
    SearchQuantumTasks -> [SearchQuantumTasksFilter]
filters :: [SearchQuantumTasksFilter]
  }
  deriving (SearchQuantumTasks -> SearchQuantumTasks -> Bool
(SearchQuantumTasks -> SearchQuantumTasks -> Bool)
-> (SearchQuantumTasks -> SearchQuantumTasks -> Bool)
-> Eq SearchQuantumTasks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchQuantumTasks -> SearchQuantumTasks -> Bool
$c/= :: SearchQuantumTasks -> SearchQuantumTasks -> Bool
== :: SearchQuantumTasks -> SearchQuantumTasks -> Bool
$c== :: SearchQuantumTasks -> SearchQuantumTasks -> Bool
Prelude.Eq, ReadPrec [SearchQuantumTasks]
ReadPrec SearchQuantumTasks
Int -> ReadS SearchQuantumTasks
ReadS [SearchQuantumTasks]
(Int -> ReadS SearchQuantumTasks)
-> ReadS [SearchQuantumTasks]
-> ReadPrec SearchQuantumTasks
-> ReadPrec [SearchQuantumTasks]
-> Read SearchQuantumTasks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchQuantumTasks]
$creadListPrec :: ReadPrec [SearchQuantumTasks]
readPrec :: ReadPrec SearchQuantumTasks
$creadPrec :: ReadPrec SearchQuantumTasks
readList :: ReadS [SearchQuantumTasks]
$creadList :: ReadS [SearchQuantumTasks]
readsPrec :: Int -> ReadS SearchQuantumTasks
$creadsPrec :: Int -> ReadS SearchQuantumTasks
Prelude.Read, Int -> SearchQuantumTasks -> ShowS
[SearchQuantumTasks] -> ShowS
SearchQuantumTasks -> String
(Int -> SearchQuantumTasks -> ShowS)
-> (SearchQuantumTasks -> String)
-> ([SearchQuantumTasks] -> ShowS)
-> Show SearchQuantumTasks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchQuantumTasks] -> ShowS
$cshowList :: [SearchQuantumTasks] -> ShowS
show :: SearchQuantumTasks -> String
$cshow :: SearchQuantumTasks -> String
showsPrec :: Int -> SearchQuantumTasks -> ShowS
$cshowsPrec :: Int -> SearchQuantumTasks -> ShowS
Prelude.Show, (forall x. SearchQuantumTasks -> Rep SearchQuantumTasks x)
-> (forall x. Rep SearchQuantumTasks x -> SearchQuantumTasks)
-> Generic SearchQuantumTasks
forall x. Rep SearchQuantumTasks x -> SearchQuantumTasks
forall x. SearchQuantumTasks -> Rep SearchQuantumTasks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchQuantumTasks x -> SearchQuantumTasks
$cfrom :: forall x. SearchQuantumTasks -> Rep SearchQuantumTasks x
Prelude.Generic)

-- |
-- Create a value of 'SearchQuantumTasks' 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:
--
-- 'nextToken', 'searchQuantumTasks_nextToken' - A token used for pagination of results returned in the response. Use the
-- token returned from the previous request continue results where the
-- previous request ended.
--
-- 'maxResults', 'searchQuantumTasks_maxResults' - Maximum number of results to return in the response.
--
-- 'filters', 'searchQuantumTasks_filters' - Array of @SearchQuantumTasksFilter@ objects.
newSearchQuantumTasks ::
  SearchQuantumTasks
newSearchQuantumTasks :: SearchQuantumTasks
newSearchQuantumTasks =
  SearchQuantumTasks' :: Maybe Text
-> Maybe Natural
-> [SearchQuantumTasksFilter]
-> SearchQuantumTasks
SearchQuantumTasks'
    { $sel:nextToken:SearchQuantumTasks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchQuantumTasks' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:SearchQuantumTasks' :: [SearchQuantumTasksFilter]
filters = [SearchQuantumTasksFilter]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token used for pagination of results returned in the response. Use the
-- token returned from the previous request continue results where the
-- previous request ended.
searchQuantumTasks_nextToken :: Lens.Lens' SearchQuantumTasks (Prelude.Maybe Prelude.Text)
searchQuantumTasks_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchQuantumTasks -> f SearchQuantumTasks
searchQuantumTasks_nextToken = (SearchQuantumTasks -> Maybe Text)
-> (SearchQuantumTasks -> Maybe Text -> SearchQuantumTasks)
-> Lens
     SearchQuantumTasks SearchQuantumTasks (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchQuantumTasks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchQuantumTasks' :: SearchQuantumTasks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchQuantumTasks
s@SearchQuantumTasks' {} Maybe Text
a -> SearchQuantumTasks
s {$sel:nextToken:SearchQuantumTasks' :: Maybe Text
nextToken = Maybe Text
a} :: SearchQuantumTasks)

-- | Maximum number of results to return in the response.
searchQuantumTasks_maxResults :: Lens.Lens' SearchQuantumTasks (Prelude.Maybe Prelude.Natural)
searchQuantumTasks_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> SearchQuantumTasks -> f SearchQuantumTasks
searchQuantumTasks_maxResults = (SearchQuantumTasks -> Maybe Natural)
-> (SearchQuantumTasks -> Maybe Natural -> SearchQuantumTasks)
-> Lens
     SearchQuantumTasks
     SearchQuantumTasks
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchQuantumTasks' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchQuantumTasks' :: SearchQuantumTasks -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchQuantumTasks
s@SearchQuantumTasks' {} Maybe Natural
a -> SearchQuantumTasks
s {$sel:maxResults:SearchQuantumTasks' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchQuantumTasks)

-- | Array of @SearchQuantumTasksFilter@ objects.
searchQuantumTasks_filters :: Lens.Lens' SearchQuantumTasks [SearchQuantumTasksFilter]
searchQuantumTasks_filters :: ([SearchQuantumTasksFilter] -> f [SearchQuantumTasksFilter])
-> SearchQuantumTasks -> f SearchQuantumTasks
searchQuantumTasks_filters = (SearchQuantumTasks -> [SearchQuantumTasksFilter])
-> (SearchQuantumTasks
    -> [SearchQuantumTasksFilter] -> SearchQuantumTasks)
-> Lens
     SearchQuantumTasks
     SearchQuantumTasks
     [SearchQuantumTasksFilter]
     [SearchQuantumTasksFilter]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchQuantumTasks' {[SearchQuantumTasksFilter]
filters :: [SearchQuantumTasksFilter]
$sel:filters:SearchQuantumTasks' :: SearchQuantumTasks -> [SearchQuantumTasksFilter]
filters} -> [SearchQuantumTasksFilter]
filters) (\s :: SearchQuantumTasks
s@SearchQuantumTasks' {} [SearchQuantumTasksFilter]
a -> SearchQuantumTasks
s {$sel:filters:SearchQuantumTasks' :: [SearchQuantumTasksFilter]
filters = [SearchQuantumTasksFilter]
a} :: SearchQuantumTasks) (([SearchQuantumTasksFilter] -> f [SearchQuantumTasksFilter])
 -> SearchQuantumTasks -> f SearchQuantumTasks)
-> (([SearchQuantumTasksFilter] -> f [SearchQuantumTasksFilter])
    -> [SearchQuantumTasksFilter] -> f [SearchQuantumTasksFilter])
-> ([SearchQuantumTasksFilter] -> f [SearchQuantumTasksFilter])
-> SearchQuantumTasks
-> f SearchQuantumTasks
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SearchQuantumTasksFilter] -> f [SearchQuantumTasksFilter])
-> [SearchQuantumTasksFilter] -> f [SearchQuantumTasksFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager SearchQuantumTasks where
  page :: SearchQuantumTasks
-> AWSResponse SearchQuantumTasks -> Maybe SearchQuantumTasks
page SearchQuantumTasks
rq AWSResponse SearchQuantumTasks
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse SearchQuantumTasks
SearchQuantumTasksResponse
rs
            SearchQuantumTasksResponse
-> Getting (First Text) SearchQuantumTasksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchQuantumTasksResponse
-> Const (First Text) SearchQuantumTasksResponse
Lens' SearchQuantumTasksResponse (Maybe Text)
searchQuantumTasksResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> SearchQuantumTasksResponse
 -> Const (First Text) SearchQuantumTasksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchQuantumTasksResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe SearchQuantumTasks
forall a. Maybe a
Prelude.Nothing
    | [QuantumTaskSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse SearchQuantumTasks
SearchQuantumTasksResponse
rs SearchQuantumTasksResponse
-> Getting
     [QuantumTaskSummary]
     SearchQuantumTasksResponse
     [QuantumTaskSummary]
-> [QuantumTaskSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [QuantumTaskSummary]
  SearchQuantumTasksResponse
  [QuantumTaskSummary]
Lens' SearchQuantumTasksResponse [QuantumTaskSummary]
searchQuantumTasksResponse_quantumTasks) =
      Maybe SearchQuantumTasks
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      SearchQuantumTasks -> Maybe SearchQuantumTasks
forall a. a -> Maybe a
Prelude.Just (SearchQuantumTasks -> Maybe SearchQuantumTasks)
-> SearchQuantumTasks -> Maybe SearchQuantumTasks
forall a b. (a -> b) -> a -> b
Prelude.$
        SearchQuantumTasks
rq
          SearchQuantumTasks
-> (SearchQuantumTasks -> SearchQuantumTasks) -> SearchQuantumTasks
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> SearchQuantumTasks -> Identity SearchQuantumTasks
Lens
  SearchQuantumTasks SearchQuantumTasks (Maybe Text) (Maybe Text)
searchQuantumTasks_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> SearchQuantumTasks -> Identity SearchQuantumTasks)
-> Maybe Text -> SearchQuantumTasks -> SearchQuantumTasks
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse SearchQuantumTasks
SearchQuantumTasksResponse
rs
          SearchQuantumTasksResponse
-> Getting (First Text) SearchQuantumTasksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchQuantumTasksResponse
-> Const (First Text) SearchQuantumTasksResponse
Lens' SearchQuantumTasksResponse (Maybe Text)
searchQuantumTasksResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> SearchQuantumTasksResponse
 -> Const (First Text) SearchQuantumTasksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchQuantumTasksResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest SearchQuantumTasks where
  type
    AWSResponse SearchQuantumTasks =
      SearchQuantumTasksResponse
  request :: SearchQuantumTasks -> Request SearchQuantumTasks
request = Service -> SearchQuantumTasks -> Request SearchQuantumTasks
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SearchQuantumTasks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchQuantumTasks)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SearchQuantumTasks))
-> Logger
-> Service
-> Proxy SearchQuantumTasks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchQuantumTasks)))
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
-> Int -> [QuantumTaskSummary] -> SearchQuantumTasksResponse
SearchQuantumTasksResponse'
            (Maybe Text
 -> Int -> [QuantumTaskSummary] -> SearchQuantumTasksResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [QuantumTaskSummary] -> SearchQuantumTasksResponse)
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
"nextToken")
            Either
  String (Int -> [QuantumTaskSummary] -> SearchQuantumTasksResponse)
-> Either String Int
-> Either
     String ([QuantumTaskSummary] -> SearchQuantumTasksResponse)
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 ([QuantumTaskSummary] -> SearchQuantumTasksResponse)
-> Either String [QuantumTaskSummary]
-> Either String SearchQuantumTasksResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [QuantumTaskSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"quantumTasks" Either String (Maybe [QuantumTaskSummary])
-> [QuantumTaskSummary] -> Either String [QuantumTaskSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [QuantumTaskSummary]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable SearchQuantumTasks

instance Prelude.NFData SearchQuantumTasks

instance Core.ToHeaders SearchQuantumTasks where
  toHeaders :: SearchQuantumTasks -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchQuantumTasks -> 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 SearchQuantumTasks where
  toJSON :: SearchQuantumTasks -> Value
toJSON SearchQuantumTasks' {[SearchQuantumTasksFilter]
Maybe Natural
Maybe Text
filters :: [SearchQuantumTasksFilter]
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:filters:SearchQuantumTasks' :: SearchQuantumTasks -> [SearchQuantumTasksFilter]
$sel:maxResults:SearchQuantumTasks' :: SearchQuantumTasks -> Maybe Natural
$sel:nextToken:SearchQuantumTasks' :: SearchQuantumTasks -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nextToken" 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
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filters" Text -> [SearchQuantumTasksFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [SearchQuantumTasksFilter]
filters)
          ]
      )

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

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

-- | /See:/ 'newSearchQuantumTasksResponse' smart constructor.
data SearchQuantumTasksResponse = SearchQuantumTasksResponse'
  { -- | A token used for pagination of results, or null if there are no
    -- additional results. Use the token value in a subsequent request to
    -- continue results where the previous request ended.
    SearchQuantumTasksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    SearchQuantumTasksResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of @QuantumTaskSummary@ objects for tasks that match the
    -- specified filters.
    SearchQuantumTasksResponse -> [QuantumTaskSummary]
quantumTasks :: [QuantumTaskSummary]
  }
  deriving (SearchQuantumTasksResponse -> SearchQuantumTasksResponse -> Bool
(SearchQuantumTasksResponse -> SearchQuantumTasksResponse -> Bool)
-> (SearchQuantumTasksResponse
    -> SearchQuantumTasksResponse -> Bool)
-> Eq SearchQuantumTasksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchQuantumTasksResponse -> SearchQuantumTasksResponse -> Bool
$c/= :: SearchQuantumTasksResponse -> SearchQuantumTasksResponse -> Bool
== :: SearchQuantumTasksResponse -> SearchQuantumTasksResponse -> Bool
$c== :: SearchQuantumTasksResponse -> SearchQuantumTasksResponse -> Bool
Prelude.Eq, ReadPrec [SearchQuantumTasksResponse]
ReadPrec SearchQuantumTasksResponse
Int -> ReadS SearchQuantumTasksResponse
ReadS [SearchQuantumTasksResponse]
(Int -> ReadS SearchQuantumTasksResponse)
-> ReadS [SearchQuantumTasksResponse]
-> ReadPrec SearchQuantumTasksResponse
-> ReadPrec [SearchQuantumTasksResponse]
-> Read SearchQuantumTasksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchQuantumTasksResponse]
$creadListPrec :: ReadPrec [SearchQuantumTasksResponse]
readPrec :: ReadPrec SearchQuantumTasksResponse
$creadPrec :: ReadPrec SearchQuantumTasksResponse
readList :: ReadS [SearchQuantumTasksResponse]
$creadList :: ReadS [SearchQuantumTasksResponse]
readsPrec :: Int -> ReadS SearchQuantumTasksResponse
$creadsPrec :: Int -> ReadS SearchQuantumTasksResponse
Prelude.Read, Int -> SearchQuantumTasksResponse -> ShowS
[SearchQuantumTasksResponse] -> ShowS
SearchQuantumTasksResponse -> String
(Int -> SearchQuantumTasksResponse -> ShowS)
-> (SearchQuantumTasksResponse -> String)
-> ([SearchQuantumTasksResponse] -> ShowS)
-> Show SearchQuantumTasksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchQuantumTasksResponse] -> ShowS
$cshowList :: [SearchQuantumTasksResponse] -> ShowS
show :: SearchQuantumTasksResponse -> String
$cshow :: SearchQuantumTasksResponse -> String
showsPrec :: Int -> SearchQuantumTasksResponse -> ShowS
$cshowsPrec :: Int -> SearchQuantumTasksResponse -> ShowS
Prelude.Show, (forall x.
 SearchQuantumTasksResponse -> Rep SearchQuantumTasksResponse x)
-> (forall x.
    Rep SearchQuantumTasksResponse x -> SearchQuantumTasksResponse)
-> Generic SearchQuantumTasksResponse
forall x.
Rep SearchQuantumTasksResponse x -> SearchQuantumTasksResponse
forall x.
SearchQuantumTasksResponse -> Rep SearchQuantumTasksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchQuantumTasksResponse x -> SearchQuantumTasksResponse
$cfrom :: forall x.
SearchQuantumTasksResponse -> Rep SearchQuantumTasksResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchQuantumTasksResponse' 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:
--
-- 'nextToken', 'searchQuantumTasksResponse_nextToken' - A token used for pagination of results, or null if there are no
-- additional results. Use the token value in a subsequent request to
-- continue results where the previous request ended.
--
-- 'httpStatus', 'searchQuantumTasksResponse_httpStatus' - The response's http status code.
--
-- 'quantumTasks', 'searchQuantumTasksResponse_quantumTasks' - An array of @QuantumTaskSummary@ objects for tasks that match the
-- specified filters.
newSearchQuantumTasksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchQuantumTasksResponse
newSearchQuantumTasksResponse :: Int -> SearchQuantumTasksResponse
newSearchQuantumTasksResponse Int
pHttpStatus_ =
  SearchQuantumTasksResponse' :: Maybe Text
-> Int -> [QuantumTaskSummary] -> SearchQuantumTasksResponse
SearchQuantumTasksResponse'
    { $sel:nextToken:SearchQuantumTasksResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchQuantumTasksResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:quantumTasks:SearchQuantumTasksResponse' :: [QuantumTaskSummary]
quantumTasks = [QuantumTaskSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token used for pagination of results, or null if there are no
-- additional results. Use the token value in a subsequent request to
-- continue results where the previous request ended.
searchQuantumTasksResponse_nextToken :: Lens.Lens' SearchQuantumTasksResponse (Prelude.Maybe Prelude.Text)
searchQuantumTasksResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchQuantumTasksResponse -> f SearchQuantumTasksResponse
searchQuantumTasksResponse_nextToken = (SearchQuantumTasksResponse -> Maybe Text)
-> (SearchQuantumTasksResponse
    -> Maybe Text -> SearchQuantumTasksResponse)
-> Lens' SearchQuantumTasksResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchQuantumTasksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchQuantumTasksResponse' :: SearchQuantumTasksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchQuantumTasksResponse
s@SearchQuantumTasksResponse' {} Maybe Text
a -> SearchQuantumTasksResponse
s {$sel:nextToken:SearchQuantumTasksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchQuantumTasksResponse)

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

-- | An array of @QuantumTaskSummary@ objects for tasks that match the
-- specified filters.
searchQuantumTasksResponse_quantumTasks :: Lens.Lens' SearchQuantumTasksResponse [QuantumTaskSummary]
searchQuantumTasksResponse_quantumTasks :: ([QuantumTaskSummary] -> f [QuantumTaskSummary])
-> SearchQuantumTasksResponse -> f SearchQuantumTasksResponse
searchQuantumTasksResponse_quantumTasks = (SearchQuantumTasksResponse -> [QuantumTaskSummary])
-> (SearchQuantumTasksResponse
    -> [QuantumTaskSummary] -> SearchQuantumTasksResponse)
-> Lens' SearchQuantumTasksResponse [QuantumTaskSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchQuantumTasksResponse' {[QuantumTaskSummary]
quantumTasks :: [QuantumTaskSummary]
$sel:quantumTasks:SearchQuantumTasksResponse' :: SearchQuantumTasksResponse -> [QuantumTaskSummary]
quantumTasks} -> [QuantumTaskSummary]
quantumTasks) (\s :: SearchQuantumTasksResponse
s@SearchQuantumTasksResponse' {} [QuantumTaskSummary]
a -> SearchQuantumTasksResponse
s {$sel:quantumTasks:SearchQuantumTasksResponse' :: [QuantumTaskSummary]
quantumTasks = [QuantumTaskSummary]
a} :: SearchQuantumTasksResponse) (([QuantumTaskSummary] -> f [QuantumTaskSummary])
 -> SearchQuantumTasksResponse -> f SearchQuantumTasksResponse)
-> (([QuantumTaskSummary] -> f [QuantumTaskSummary])
    -> [QuantumTaskSummary] -> f [QuantumTaskSummary])
-> ([QuantumTaskSummary] -> f [QuantumTaskSummary])
-> SearchQuantumTasksResponse
-> f SearchQuantumTasksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([QuantumTaskSummary] -> f [QuantumTaskSummary])
-> [QuantumTaskSummary] -> f [QuantumTaskSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData SearchQuantumTasksResponse