{-# 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.Athena.ListQueryExecutions
-- 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)
--
-- Provides a list of available query execution IDs for the queries in the
-- specified workgroup. If a workgroup is not specified, returns a list of
-- query execution IDs for the primary workgroup. Requires you to have
-- access to the workgroup in which the queries ran.
--
-- For code samples using the Amazon Web Services SDK for Java, see
-- <http://docs.aws.amazon.com/athena/latest/ug/code-samples.html Examples and Code Samples>
-- in the /Amazon Athena User Guide/.
--
-- This operation returns paginated results.
module Amazonka.Athena.ListQueryExecutions
  ( -- * Creating a Request
    ListQueryExecutions (..),
    newListQueryExecutions,

    -- * Request Lenses
    listQueryExecutions_nextToken,
    listQueryExecutions_workGroup,
    listQueryExecutions_maxResults,

    -- * Destructuring the Response
    ListQueryExecutionsResponse (..),
    newListQueryExecutionsResponse,

    -- * Response Lenses
    listQueryExecutionsResponse_queryExecutionIds,
    listQueryExecutionsResponse_nextToken,
    listQueryExecutionsResponse_httpStatus,
  )
where

import Amazonka.Athena.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:/ 'newListQueryExecutions' smart constructor.
data ListQueryExecutions = ListQueryExecutions'
  { -- | A token generated by the Athena service that specifies where to continue
    -- pagination if a previous request was truncated. To obtain the next set
    -- of pages, pass in the @NextToken@ from the response object of the
    -- previous page call.
    ListQueryExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the workgroup from which queries are being returned. If a
    -- workgroup is not specified, a list of available query execution IDs for
    -- the queries in the primary workgroup is returned.
    ListQueryExecutions -> Maybe Text
workGroup :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of query executions to return in this request.
    ListQueryExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListQueryExecutions -> ListQueryExecutions -> Bool
(ListQueryExecutions -> ListQueryExecutions -> Bool)
-> (ListQueryExecutions -> ListQueryExecutions -> Bool)
-> Eq ListQueryExecutions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueryExecutions -> ListQueryExecutions -> Bool
$c/= :: ListQueryExecutions -> ListQueryExecutions -> Bool
== :: ListQueryExecutions -> ListQueryExecutions -> Bool
$c== :: ListQueryExecutions -> ListQueryExecutions -> Bool
Prelude.Eq, ReadPrec [ListQueryExecutions]
ReadPrec ListQueryExecutions
Int -> ReadS ListQueryExecutions
ReadS [ListQueryExecutions]
(Int -> ReadS ListQueryExecutions)
-> ReadS [ListQueryExecutions]
-> ReadPrec ListQueryExecutions
-> ReadPrec [ListQueryExecutions]
-> Read ListQueryExecutions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueryExecutions]
$creadListPrec :: ReadPrec [ListQueryExecutions]
readPrec :: ReadPrec ListQueryExecutions
$creadPrec :: ReadPrec ListQueryExecutions
readList :: ReadS [ListQueryExecutions]
$creadList :: ReadS [ListQueryExecutions]
readsPrec :: Int -> ReadS ListQueryExecutions
$creadsPrec :: Int -> ReadS ListQueryExecutions
Prelude.Read, Int -> ListQueryExecutions -> ShowS
[ListQueryExecutions] -> ShowS
ListQueryExecutions -> String
(Int -> ListQueryExecutions -> ShowS)
-> (ListQueryExecutions -> String)
-> ([ListQueryExecutions] -> ShowS)
-> Show ListQueryExecutions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueryExecutions] -> ShowS
$cshowList :: [ListQueryExecutions] -> ShowS
show :: ListQueryExecutions -> String
$cshow :: ListQueryExecutions -> String
showsPrec :: Int -> ListQueryExecutions -> ShowS
$cshowsPrec :: Int -> ListQueryExecutions -> ShowS
Prelude.Show, (forall x. ListQueryExecutions -> Rep ListQueryExecutions x)
-> (forall x. Rep ListQueryExecutions x -> ListQueryExecutions)
-> Generic ListQueryExecutions
forall x. Rep ListQueryExecutions x -> ListQueryExecutions
forall x. ListQueryExecutions -> Rep ListQueryExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListQueryExecutions x -> ListQueryExecutions
$cfrom :: forall x. ListQueryExecutions -> Rep ListQueryExecutions x
Prelude.Generic)

-- |
-- Create a value of 'ListQueryExecutions' 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', 'listQueryExecutions_nextToken' - A token generated by the Athena service that specifies where to continue
-- pagination if a previous request was truncated. To obtain the next set
-- of pages, pass in the @NextToken@ from the response object of the
-- previous page call.
--
-- 'workGroup', 'listQueryExecutions_workGroup' - The name of the workgroup from which queries are being returned. If a
-- workgroup is not specified, a list of available query execution IDs for
-- the queries in the primary workgroup is returned.
--
-- 'maxResults', 'listQueryExecutions_maxResults' - The maximum number of query executions to return in this request.
newListQueryExecutions ::
  ListQueryExecutions
newListQueryExecutions :: ListQueryExecutions
newListQueryExecutions =
  ListQueryExecutions' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListQueryExecutions
ListQueryExecutions'
    { $sel:nextToken:ListQueryExecutions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workGroup:ListQueryExecutions' :: Maybe Text
workGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListQueryExecutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token generated by the Athena service that specifies where to continue
-- pagination if a previous request was truncated. To obtain the next set
-- of pages, pass in the @NextToken@ from the response object of the
-- previous page call.
listQueryExecutions_nextToken :: Lens.Lens' ListQueryExecutions (Prelude.Maybe Prelude.Text)
listQueryExecutions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListQueryExecutions -> f ListQueryExecutions
listQueryExecutions_nextToken = (ListQueryExecutions -> Maybe Text)
-> (ListQueryExecutions -> Maybe Text -> ListQueryExecutions)
-> Lens
     ListQueryExecutions ListQueryExecutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryExecutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListQueryExecutions' :: ListQueryExecutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListQueryExecutions
s@ListQueryExecutions' {} Maybe Text
a -> ListQueryExecutions
s {$sel:nextToken:ListQueryExecutions' :: Maybe Text
nextToken = Maybe Text
a} :: ListQueryExecutions)

-- | The name of the workgroup from which queries are being returned. If a
-- workgroup is not specified, a list of available query execution IDs for
-- the queries in the primary workgroup is returned.
listQueryExecutions_workGroup :: Lens.Lens' ListQueryExecutions (Prelude.Maybe Prelude.Text)
listQueryExecutions_workGroup :: (Maybe Text -> f (Maybe Text))
-> ListQueryExecutions -> f ListQueryExecutions
listQueryExecutions_workGroup = (ListQueryExecutions -> Maybe Text)
-> (ListQueryExecutions -> Maybe Text -> ListQueryExecutions)
-> Lens
     ListQueryExecutions ListQueryExecutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryExecutions' {Maybe Text
workGroup :: Maybe Text
$sel:workGroup:ListQueryExecutions' :: ListQueryExecutions -> Maybe Text
workGroup} -> Maybe Text
workGroup) (\s :: ListQueryExecutions
s@ListQueryExecutions' {} Maybe Text
a -> ListQueryExecutions
s {$sel:workGroup:ListQueryExecutions' :: Maybe Text
workGroup = Maybe Text
a} :: ListQueryExecutions)

-- | The maximum number of query executions to return in this request.
listQueryExecutions_maxResults :: Lens.Lens' ListQueryExecutions (Prelude.Maybe Prelude.Natural)
listQueryExecutions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListQueryExecutions -> f ListQueryExecutions
listQueryExecutions_maxResults = (ListQueryExecutions -> Maybe Natural)
-> (ListQueryExecutions -> Maybe Natural -> ListQueryExecutions)
-> Lens
     ListQueryExecutions
     ListQueryExecutions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListQueryExecutions' :: ListQueryExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListQueryExecutions
s@ListQueryExecutions' {} Maybe Natural
a -> ListQueryExecutions
s {$sel:maxResults:ListQueryExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListQueryExecutions)

instance Core.AWSPager ListQueryExecutions where
  page :: ListQueryExecutions
-> AWSResponse ListQueryExecutions -> Maybe ListQueryExecutions
page ListQueryExecutions
rq AWSResponse ListQueryExecutions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListQueryExecutions
ListQueryExecutionsResponse
rs
            ListQueryExecutionsResponse
-> Getting (First Text) ListQueryExecutionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListQueryExecutionsResponse
-> Const (First Text) ListQueryExecutionsResponse
Lens' ListQueryExecutionsResponse (Maybe Text)
listQueryExecutionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListQueryExecutionsResponse
 -> Const (First Text) ListQueryExecutionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListQueryExecutionsResponse 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 ListQueryExecutions
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListQueryExecutions
ListQueryExecutionsResponse
rs
            ListQueryExecutionsResponse
-> Getting (First [Text]) ListQueryExecutionsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe (NonEmpty Text)
 -> Const (First [Text]) (Maybe (NonEmpty Text)))
-> ListQueryExecutionsResponse
-> Const (First [Text]) ListQueryExecutionsResponse
Lens' ListQueryExecutionsResponse (Maybe (NonEmpty Text))
listQueryExecutionsResponse_queryExecutionIds
              ((Maybe (NonEmpty Text)
  -> Const (First [Text]) (Maybe (NonEmpty Text)))
 -> ListQueryExecutionsResponse
 -> Const (First [Text]) ListQueryExecutionsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe (NonEmpty Text)
    -> Const (First [Text]) (Maybe (NonEmpty Text)))
-> Getting (First [Text]) ListQueryExecutionsResponse [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> Const (First [Text]) (NonEmpty Text))
-> Maybe (NonEmpty Text)
-> Const (First [Text]) (Maybe (NonEmpty Text))
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
              ((NonEmpty Text -> Const (First [Text]) (NonEmpty Text))
 -> Maybe (NonEmpty Text)
 -> Const (First [Text]) (Maybe (NonEmpty Text)))
-> (([Text] -> Const (First [Text]) [Text])
    -> NonEmpty Text -> Const (First [Text]) (NonEmpty Text))
-> ([Text] -> Const (First [Text]) [Text])
-> Maybe (NonEmpty Text)
-> Const (First [Text]) (Maybe (NonEmpty Text))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> [Text])
-> ([Text] -> Const (First [Text]) [Text])
-> NonEmpty Text
-> Const (First [Text]) (NonEmpty Text)
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NonEmpty Text -> [Text]
forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
      Maybe ListQueryExecutions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListQueryExecutions -> Maybe ListQueryExecutions
forall a. a -> Maybe a
Prelude.Just (ListQueryExecutions -> Maybe ListQueryExecutions)
-> ListQueryExecutions -> Maybe ListQueryExecutions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListQueryExecutions
rq
          ListQueryExecutions
-> (ListQueryExecutions -> ListQueryExecutions)
-> ListQueryExecutions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListQueryExecutions -> Identity ListQueryExecutions
Lens
  ListQueryExecutions ListQueryExecutions (Maybe Text) (Maybe Text)
listQueryExecutions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListQueryExecutions -> Identity ListQueryExecutions)
-> Maybe Text -> ListQueryExecutions -> ListQueryExecutions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListQueryExecutions
ListQueryExecutionsResponse
rs
          ListQueryExecutionsResponse
-> Getting (First Text) ListQueryExecutionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListQueryExecutionsResponse
-> Const (First Text) ListQueryExecutionsResponse
Lens' ListQueryExecutionsResponse (Maybe Text)
listQueryExecutionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListQueryExecutionsResponse
 -> Const (First Text) ListQueryExecutionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListQueryExecutionsResponse 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 ListQueryExecutions where
  type
    AWSResponse ListQueryExecutions =
      ListQueryExecutionsResponse
  request :: ListQueryExecutions -> Request ListQueryExecutions
request = Service -> ListQueryExecutions -> Request ListQueryExecutions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListQueryExecutions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListQueryExecutions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListQueryExecutions))
-> Logger
-> Service
-> Proxy ListQueryExecutions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListQueryExecutions)))
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 (NonEmpty Text)
-> Maybe Text -> Int -> ListQueryExecutionsResponse
ListQueryExecutionsResponse'
            (Maybe (NonEmpty Text)
 -> Maybe Text -> Int -> ListQueryExecutionsResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either String (Maybe Text -> Int -> ListQueryExecutionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"QueryExecutionIds")
            Either String (Maybe Text -> Int -> ListQueryExecutionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListQueryExecutionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> ListQueryExecutionsResponse)
-> Either String Int -> Either String ListQueryExecutionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListQueryExecutions

instance Prelude.NFData ListQueryExecutions

instance Core.ToHeaders ListQueryExecutions where
  toHeaders :: ListQueryExecutions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListQueryExecutions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonAthena.ListQueryExecutions" ::
                          Prelude.ByteString
                      ),
            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 ListQueryExecutions where
  toJSON :: ListQueryExecutions -> Value
toJSON ListQueryExecutions' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
workGroup :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListQueryExecutions' :: ListQueryExecutions -> Maybe Natural
$sel:workGroup:ListQueryExecutions' :: ListQueryExecutions -> Maybe Text
$sel:nextToken:ListQueryExecutions' :: ListQueryExecutions -> 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
"WorkGroup" 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
workGroup,
            (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
          ]
      )

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

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

-- | /See:/ 'newListQueryExecutionsResponse' smart constructor.
data ListQueryExecutionsResponse = ListQueryExecutionsResponse'
  { -- | The unique IDs of each query execution as an array of strings.
    ListQueryExecutionsResponse -> Maybe (NonEmpty Text)
queryExecutionIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A token to be used by the next request if this request is truncated.
    ListQueryExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListQueryExecutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListQueryExecutionsResponse -> ListQueryExecutionsResponse -> Bool
(ListQueryExecutionsResponse
 -> ListQueryExecutionsResponse -> Bool)
-> (ListQueryExecutionsResponse
    -> ListQueryExecutionsResponse -> Bool)
-> Eq ListQueryExecutionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueryExecutionsResponse -> ListQueryExecutionsResponse -> Bool
$c/= :: ListQueryExecutionsResponse -> ListQueryExecutionsResponse -> Bool
== :: ListQueryExecutionsResponse -> ListQueryExecutionsResponse -> Bool
$c== :: ListQueryExecutionsResponse -> ListQueryExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListQueryExecutionsResponse]
ReadPrec ListQueryExecutionsResponse
Int -> ReadS ListQueryExecutionsResponse
ReadS [ListQueryExecutionsResponse]
(Int -> ReadS ListQueryExecutionsResponse)
-> ReadS [ListQueryExecutionsResponse]
-> ReadPrec ListQueryExecutionsResponse
-> ReadPrec [ListQueryExecutionsResponse]
-> Read ListQueryExecutionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueryExecutionsResponse]
$creadListPrec :: ReadPrec [ListQueryExecutionsResponse]
readPrec :: ReadPrec ListQueryExecutionsResponse
$creadPrec :: ReadPrec ListQueryExecutionsResponse
readList :: ReadS [ListQueryExecutionsResponse]
$creadList :: ReadS [ListQueryExecutionsResponse]
readsPrec :: Int -> ReadS ListQueryExecutionsResponse
$creadsPrec :: Int -> ReadS ListQueryExecutionsResponse
Prelude.Read, Int -> ListQueryExecutionsResponse -> ShowS
[ListQueryExecutionsResponse] -> ShowS
ListQueryExecutionsResponse -> String
(Int -> ListQueryExecutionsResponse -> ShowS)
-> (ListQueryExecutionsResponse -> String)
-> ([ListQueryExecutionsResponse] -> ShowS)
-> Show ListQueryExecutionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueryExecutionsResponse] -> ShowS
$cshowList :: [ListQueryExecutionsResponse] -> ShowS
show :: ListQueryExecutionsResponse -> String
$cshow :: ListQueryExecutionsResponse -> String
showsPrec :: Int -> ListQueryExecutionsResponse -> ShowS
$cshowsPrec :: Int -> ListQueryExecutionsResponse -> ShowS
Prelude.Show, (forall x.
 ListQueryExecutionsResponse -> Rep ListQueryExecutionsResponse x)
-> (forall x.
    Rep ListQueryExecutionsResponse x -> ListQueryExecutionsResponse)
-> Generic ListQueryExecutionsResponse
forall x.
Rep ListQueryExecutionsResponse x -> ListQueryExecutionsResponse
forall x.
ListQueryExecutionsResponse -> Rep ListQueryExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListQueryExecutionsResponse x -> ListQueryExecutionsResponse
$cfrom :: forall x.
ListQueryExecutionsResponse -> Rep ListQueryExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListQueryExecutionsResponse' 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:
--
-- 'queryExecutionIds', 'listQueryExecutionsResponse_queryExecutionIds' - The unique IDs of each query execution as an array of strings.
--
-- 'nextToken', 'listQueryExecutionsResponse_nextToken' - A token to be used by the next request if this request is truncated.
--
-- 'httpStatus', 'listQueryExecutionsResponse_httpStatus' - The response's http status code.
newListQueryExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListQueryExecutionsResponse
newListQueryExecutionsResponse :: Int -> ListQueryExecutionsResponse
newListQueryExecutionsResponse Int
pHttpStatus_ =
  ListQueryExecutionsResponse' :: Maybe (NonEmpty Text)
-> Maybe Text -> Int -> ListQueryExecutionsResponse
ListQueryExecutionsResponse'
    { $sel:queryExecutionIds:ListQueryExecutionsResponse' :: Maybe (NonEmpty Text)
queryExecutionIds =
        Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListQueryExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListQueryExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique IDs of each query execution as an array of strings.
listQueryExecutionsResponse_queryExecutionIds :: Lens.Lens' ListQueryExecutionsResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listQueryExecutionsResponse_queryExecutionIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListQueryExecutionsResponse -> f ListQueryExecutionsResponse
listQueryExecutionsResponse_queryExecutionIds = (ListQueryExecutionsResponse -> Maybe (NonEmpty Text))
-> (ListQueryExecutionsResponse
    -> Maybe (NonEmpty Text) -> ListQueryExecutionsResponse)
-> Lens' ListQueryExecutionsResponse (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryExecutionsResponse' {Maybe (NonEmpty Text)
queryExecutionIds :: Maybe (NonEmpty Text)
$sel:queryExecutionIds:ListQueryExecutionsResponse' :: ListQueryExecutionsResponse -> Maybe (NonEmpty Text)
queryExecutionIds} -> Maybe (NonEmpty Text)
queryExecutionIds) (\s :: ListQueryExecutionsResponse
s@ListQueryExecutionsResponse' {} Maybe (NonEmpty Text)
a -> ListQueryExecutionsResponse
s {$sel:queryExecutionIds:ListQueryExecutionsResponse' :: Maybe (NonEmpty Text)
queryExecutionIds = Maybe (NonEmpty Text)
a} :: ListQueryExecutionsResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListQueryExecutionsResponse -> f ListQueryExecutionsResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListQueryExecutionsResponse
-> f ListQueryExecutionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token to be used by the next request if this request is truncated.
listQueryExecutionsResponse_nextToken :: Lens.Lens' ListQueryExecutionsResponse (Prelude.Maybe Prelude.Text)
listQueryExecutionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListQueryExecutionsResponse -> f ListQueryExecutionsResponse
listQueryExecutionsResponse_nextToken = (ListQueryExecutionsResponse -> Maybe Text)
-> (ListQueryExecutionsResponse
    -> Maybe Text -> ListQueryExecutionsResponse)
-> Lens' ListQueryExecutionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListQueryExecutionsResponse' :: ListQueryExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListQueryExecutionsResponse
s@ListQueryExecutionsResponse' {} Maybe Text
a -> ListQueryExecutionsResponse
s {$sel:nextToken:ListQueryExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListQueryExecutionsResponse)

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

instance Prelude.NFData ListQueryExecutionsResponse