{-# 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.CloudWatchLogs.GetQueryResults
-- 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)
--
-- Returns the results from the specified query.
--
-- Only the fields requested in the query are returned, along with a
-- @\@ptr@ field, which is the identifier for the log record. You can use
-- the value of @\@ptr@ in a
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogRecord.html GetLogRecord>
-- operation to get the full log record.
--
-- @GetQueryResults@ does not start a query execution. To run a query, use
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html StartQuery>.
--
-- If the value of the @Status@ field in the output is @Running@, this
-- operation returns only partial results. If you see a value of
-- @Scheduled@ or @Running@ for the status, you can retry the operation
-- later to see the final results.
module Amazonka.CloudWatchLogs.GetQueryResults
  ( -- * Creating a Request
    GetQueryResults (..),
    newGetQueryResults,

    -- * Request Lenses
    getQueryResults_queryId,

    -- * Destructuring the Response
    GetQueryResultsResponse (..),
    newGetQueryResultsResponse,

    -- * Response Lenses
    getQueryResultsResponse_status,
    getQueryResultsResponse_results,
    getQueryResultsResponse_statistics,
    getQueryResultsResponse_httpStatus,
  )
where

import Amazonka.CloudWatchLogs.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:/ 'newGetQueryResults' smart constructor.
data GetQueryResults = GetQueryResults'
  { -- | The ID number of the query.
    GetQueryResults -> Text
queryId :: Prelude.Text
  }
  deriving (GetQueryResults -> GetQueryResults -> Bool
(GetQueryResults -> GetQueryResults -> Bool)
-> (GetQueryResults -> GetQueryResults -> Bool)
-> Eq GetQueryResults
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetQueryResults -> GetQueryResults -> Bool
$c/= :: GetQueryResults -> GetQueryResults -> Bool
== :: GetQueryResults -> GetQueryResults -> Bool
$c== :: GetQueryResults -> GetQueryResults -> Bool
Prelude.Eq, ReadPrec [GetQueryResults]
ReadPrec GetQueryResults
Int -> ReadS GetQueryResults
ReadS [GetQueryResults]
(Int -> ReadS GetQueryResults)
-> ReadS [GetQueryResults]
-> ReadPrec GetQueryResults
-> ReadPrec [GetQueryResults]
-> Read GetQueryResults
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetQueryResults]
$creadListPrec :: ReadPrec [GetQueryResults]
readPrec :: ReadPrec GetQueryResults
$creadPrec :: ReadPrec GetQueryResults
readList :: ReadS [GetQueryResults]
$creadList :: ReadS [GetQueryResults]
readsPrec :: Int -> ReadS GetQueryResults
$creadsPrec :: Int -> ReadS GetQueryResults
Prelude.Read, Int -> GetQueryResults -> ShowS
[GetQueryResults] -> ShowS
GetQueryResults -> String
(Int -> GetQueryResults -> ShowS)
-> (GetQueryResults -> String)
-> ([GetQueryResults] -> ShowS)
-> Show GetQueryResults
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetQueryResults] -> ShowS
$cshowList :: [GetQueryResults] -> ShowS
show :: GetQueryResults -> String
$cshow :: GetQueryResults -> String
showsPrec :: Int -> GetQueryResults -> ShowS
$cshowsPrec :: Int -> GetQueryResults -> ShowS
Prelude.Show, (forall x. GetQueryResults -> Rep GetQueryResults x)
-> (forall x. Rep GetQueryResults x -> GetQueryResults)
-> Generic GetQueryResults
forall x. Rep GetQueryResults x -> GetQueryResults
forall x. GetQueryResults -> Rep GetQueryResults x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetQueryResults x -> GetQueryResults
$cfrom :: forall x. GetQueryResults -> Rep GetQueryResults x
Prelude.Generic)

-- |
-- Create a value of 'GetQueryResults' 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:
--
-- 'queryId', 'getQueryResults_queryId' - The ID number of the query.
newGetQueryResults ::
  -- | 'queryId'
  Prelude.Text ->
  GetQueryResults
newGetQueryResults :: Text -> GetQueryResults
newGetQueryResults Text
pQueryId_ =
  GetQueryResults' :: Text -> GetQueryResults
GetQueryResults' {$sel:queryId:GetQueryResults' :: Text
queryId = Text
pQueryId_}

-- | The ID number of the query.
getQueryResults_queryId :: Lens.Lens' GetQueryResults Prelude.Text
getQueryResults_queryId :: (Text -> f Text) -> GetQueryResults -> f GetQueryResults
getQueryResults_queryId = (GetQueryResults -> Text)
-> (GetQueryResults -> Text -> GetQueryResults)
-> Lens GetQueryResults GetQueryResults Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueryResults' {Text
queryId :: Text
$sel:queryId:GetQueryResults' :: GetQueryResults -> Text
queryId} -> Text
queryId) (\s :: GetQueryResults
s@GetQueryResults' {} Text
a -> GetQueryResults
s {$sel:queryId:GetQueryResults' :: Text
queryId = Text
a} :: GetQueryResults)

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

instance Prelude.NFData GetQueryResults

instance Core.ToHeaders GetQueryResults where
  toHeaders :: GetQueryResults -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetQueryResults -> 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
"Logs_20140328.GetQueryResults" ::
                          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 GetQueryResults where
  toJSON :: GetQueryResults -> Value
toJSON GetQueryResults' {Text
queryId :: Text
$sel:queryId:GetQueryResults' :: GetQueryResults -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"queryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
queryId)]
      )

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

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

-- | /See:/ 'newGetQueryResultsResponse' smart constructor.
data GetQueryResultsResponse = GetQueryResultsResponse'
  { -- | The status of the most recent running of the query. Possible values are
    -- @Cancelled@, @Complete@, @Failed@, @Running@, @Scheduled@, @Timeout@,
    -- and @Unknown@.
    --
    -- Queries time out after 15 minutes of execution. To avoid having your
    -- queries time out, reduce the time range being searched or partition your
    -- query into a number of queries.
    GetQueryResultsResponse -> Maybe QueryStatus
status :: Prelude.Maybe QueryStatus,
    -- | The log events that matched the query criteria during the most recent
    -- time it ran.
    --
    -- The @results@ value is an array of arrays. Each log event is one object
    -- in the top-level array. Each of these log event objects is an array of
    -- @field@\/@value@ pairs.
    GetQueryResultsResponse -> Maybe [[ResultField]]
results :: Prelude.Maybe [[ResultField]],
    -- | Includes the number of log events scanned by the query, the number of
    -- log events that matched the query criteria, and the total number of
    -- bytes in the log events that were scanned. These values reflect the full
    -- raw results of the query.
    GetQueryResultsResponse -> Maybe QueryStatistics
statistics :: Prelude.Maybe QueryStatistics,
    -- | The response's http status code.
    GetQueryResultsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetQueryResultsResponse -> GetQueryResultsResponse -> Bool
(GetQueryResultsResponse -> GetQueryResultsResponse -> Bool)
-> (GetQueryResultsResponse -> GetQueryResultsResponse -> Bool)
-> Eq GetQueryResultsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetQueryResultsResponse -> GetQueryResultsResponse -> Bool
$c/= :: GetQueryResultsResponse -> GetQueryResultsResponse -> Bool
== :: GetQueryResultsResponse -> GetQueryResultsResponse -> Bool
$c== :: GetQueryResultsResponse -> GetQueryResultsResponse -> Bool
Prelude.Eq, ReadPrec [GetQueryResultsResponse]
ReadPrec GetQueryResultsResponse
Int -> ReadS GetQueryResultsResponse
ReadS [GetQueryResultsResponse]
(Int -> ReadS GetQueryResultsResponse)
-> ReadS [GetQueryResultsResponse]
-> ReadPrec GetQueryResultsResponse
-> ReadPrec [GetQueryResultsResponse]
-> Read GetQueryResultsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetQueryResultsResponse]
$creadListPrec :: ReadPrec [GetQueryResultsResponse]
readPrec :: ReadPrec GetQueryResultsResponse
$creadPrec :: ReadPrec GetQueryResultsResponse
readList :: ReadS [GetQueryResultsResponse]
$creadList :: ReadS [GetQueryResultsResponse]
readsPrec :: Int -> ReadS GetQueryResultsResponse
$creadsPrec :: Int -> ReadS GetQueryResultsResponse
Prelude.Read, Int -> GetQueryResultsResponse -> ShowS
[GetQueryResultsResponse] -> ShowS
GetQueryResultsResponse -> String
(Int -> GetQueryResultsResponse -> ShowS)
-> (GetQueryResultsResponse -> String)
-> ([GetQueryResultsResponse] -> ShowS)
-> Show GetQueryResultsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetQueryResultsResponse] -> ShowS
$cshowList :: [GetQueryResultsResponse] -> ShowS
show :: GetQueryResultsResponse -> String
$cshow :: GetQueryResultsResponse -> String
showsPrec :: Int -> GetQueryResultsResponse -> ShowS
$cshowsPrec :: Int -> GetQueryResultsResponse -> ShowS
Prelude.Show, (forall x.
 GetQueryResultsResponse -> Rep GetQueryResultsResponse x)
-> (forall x.
    Rep GetQueryResultsResponse x -> GetQueryResultsResponse)
-> Generic GetQueryResultsResponse
forall x. Rep GetQueryResultsResponse x -> GetQueryResultsResponse
forall x. GetQueryResultsResponse -> Rep GetQueryResultsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetQueryResultsResponse x -> GetQueryResultsResponse
$cfrom :: forall x. GetQueryResultsResponse -> Rep GetQueryResultsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetQueryResultsResponse' 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:
--
-- 'status', 'getQueryResultsResponse_status' - The status of the most recent running of the query. Possible values are
-- @Cancelled@, @Complete@, @Failed@, @Running@, @Scheduled@, @Timeout@,
-- and @Unknown@.
--
-- Queries time out after 15 minutes of execution. To avoid having your
-- queries time out, reduce the time range being searched or partition your
-- query into a number of queries.
--
-- 'results', 'getQueryResultsResponse_results' - The log events that matched the query criteria during the most recent
-- time it ran.
--
-- The @results@ value is an array of arrays. Each log event is one object
-- in the top-level array. Each of these log event objects is an array of
-- @field@\/@value@ pairs.
--
-- 'statistics', 'getQueryResultsResponse_statistics' - Includes the number of log events scanned by the query, the number of
-- log events that matched the query criteria, and the total number of
-- bytes in the log events that were scanned. These values reflect the full
-- raw results of the query.
--
-- 'httpStatus', 'getQueryResultsResponse_httpStatus' - The response's http status code.
newGetQueryResultsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetQueryResultsResponse
newGetQueryResultsResponse :: Int -> GetQueryResultsResponse
newGetQueryResultsResponse Int
pHttpStatus_ =
  GetQueryResultsResponse' :: Maybe QueryStatus
-> Maybe [[ResultField]]
-> Maybe QueryStatistics
-> Int
-> GetQueryResultsResponse
GetQueryResultsResponse'
    { $sel:status:GetQueryResultsResponse' :: Maybe QueryStatus
status = Maybe QueryStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:results:GetQueryResultsResponse' :: Maybe [[ResultField]]
results = Maybe [[ResultField]]
forall a. Maybe a
Prelude.Nothing,
      $sel:statistics:GetQueryResultsResponse' :: Maybe QueryStatistics
statistics = Maybe QueryStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetQueryResultsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the most recent running of the query. Possible values are
-- @Cancelled@, @Complete@, @Failed@, @Running@, @Scheduled@, @Timeout@,
-- and @Unknown@.
--
-- Queries time out after 15 minutes of execution. To avoid having your
-- queries time out, reduce the time range being searched or partition your
-- query into a number of queries.
getQueryResultsResponse_status :: Lens.Lens' GetQueryResultsResponse (Prelude.Maybe QueryStatus)
getQueryResultsResponse_status :: (Maybe QueryStatus -> f (Maybe QueryStatus))
-> GetQueryResultsResponse -> f GetQueryResultsResponse
getQueryResultsResponse_status = (GetQueryResultsResponse -> Maybe QueryStatus)
-> (GetQueryResultsResponse
    -> Maybe QueryStatus -> GetQueryResultsResponse)
-> Lens
     GetQueryResultsResponse
     GetQueryResultsResponse
     (Maybe QueryStatus)
     (Maybe QueryStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueryResultsResponse' {Maybe QueryStatus
status :: Maybe QueryStatus
$sel:status:GetQueryResultsResponse' :: GetQueryResultsResponse -> Maybe QueryStatus
status} -> Maybe QueryStatus
status) (\s :: GetQueryResultsResponse
s@GetQueryResultsResponse' {} Maybe QueryStatus
a -> GetQueryResultsResponse
s {$sel:status:GetQueryResultsResponse' :: Maybe QueryStatus
status = Maybe QueryStatus
a} :: GetQueryResultsResponse)

-- | The log events that matched the query criteria during the most recent
-- time it ran.
--
-- The @results@ value is an array of arrays. Each log event is one object
-- in the top-level array. Each of these log event objects is an array of
-- @field@\/@value@ pairs.
getQueryResultsResponse_results :: Lens.Lens' GetQueryResultsResponse (Prelude.Maybe [[ResultField]])
getQueryResultsResponse_results :: (Maybe [[ResultField]] -> f (Maybe [[ResultField]]))
-> GetQueryResultsResponse -> f GetQueryResultsResponse
getQueryResultsResponse_results = (GetQueryResultsResponse -> Maybe [[ResultField]])
-> (GetQueryResultsResponse
    -> Maybe [[ResultField]] -> GetQueryResultsResponse)
-> Lens
     GetQueryResultsResponse
     GetQueryResultsResponse
     (Maybe [[ResultField]])
     (Maybe [[ResultField]])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueryResultsResponse' {Maybe [[ResultField]]
results :: Maybe [[ResultField]]
$sel:results:GetQueryResultsResponse' :: GetQueryResultsResponse -> Maybe [[ResultField]]
results} -> Maybe [[ResultField]]
results) (\s :: GetQueryResultsResponse
s@GetQueryResultsResponse' {} Maybe [[ResultField]]
a -> GetQueryResultsResponse
s {$sel:results:GetQueryResultsResponse' :: Maybe [[ResultField]]
results = Maybe [[ResultField]]
a} :: GetQueryResultsResponse) ((Maybe [[ResultField]] -> f (Maybe [[ResultField]]))
 -> GetQueryResultsResponse -> f GetQueryResultsResponse)
-> ((Maybe [[ResultField]] -> f (Maybe [[ResultField]]))
    -> Maybe [[ResultField]] -> f (Maybe [[ResultField]]))
-> (Maybe [[ResultField]] -> f (Maybe [[ResultField]]))
-> GetQueryResultsResponse
-> f GetQueryResultsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [[ResultField]] [[ResultField]] [[ResultField]] [[ResultField]]
-> Iso
     (Maybe [[ResultField]])
     (Maybe [[ResultField]])
     (Maybe [[ResultField]])
     (Maybe [[ResultField]])
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
  [[ResultField]] [[ResultField]] [[ResultField]] [[ResultField]]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Includes the number of log events scanned by the query, the number of
-- log events that matched the query criteria, and the total number of
-- bytes in the log events that were scanned. These values reflect the full
-- raw results of the query.
getQueryResultsResponse_statistics :: Lens.Lens' GetQueryResultsResponse (Prelude.Maybe QueryStatistics)
getQueryResultsResponse_statistics :: (Maybe QueryStatistics -> f (Maybe QueryStatistics))
-> GetQueryResultsResponse -> f GetQueryResultsResponse
getQueryResultsResponse_statistics = (GetQueryResultsResponse -> Maybe QueryStatistics)
-> (GetQueryResultsResponse
    -> Maybe QueryStatistics -> GetQueryResultsResponse)
-> Lens
     GetQueryResultsResponse
     GetQueryResultsResponse
     (Maybe QueryStatistics)
     (Maybe QueryStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueryResultsResponse' {Maybe QueryStatistics
statistics :: Maybe QueryStatistics
$sel:statistics:GetQueryResultsResponse' :: GetQueryResultsResponse -> Maybe QueryStatistics
statistics} -> Maybe QueryStatistics
statistics) (\s :: GetQueryResultsResponse
s@GetQueryResultsResponse' {} Maybe QueryStatistics
a -> GetQueryResultsResponse
s {$sel:statistics:GetQueryResultsResponse' :: Maybe QueryStatistics
statistics = Maybe QueryStatistics
a} :: GetQueryResultsResponse)

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

instance Prelude.NFData GetQueryResultsResponse