{-# 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.DescribeQueries
-- 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 a list of CloudWatch Logs Insights queries that are scheduled,
-- executing, or have been executed recently in this account. You can
-- request all queries or limit it to queries of a specific log group or
-- queries with a certain status.
--
-- This operation returns paginated results.
module Amazonka.CloudWatchLogs.DescribeQueries
  ( -- * Creating a Request
    DescribeQueries (..),
    newDescribeQueries,

    -- * Request Lenses
    describeQueries_status,
    describeQueries_logGroupName,
    describeQueries_nextToken,
    describeQueries_maxResults,

    -- * Destructuring the Response
    DescribeQueriesResponse (..),
    newDescribeQueriesResponse,

    -- * Response Lenses
    describeQueriesResponse_queries,
    describeQueriesResponse_nextToken,
    describeQueriesResponse_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:/ 'newDescribeQueries' smart constructor.
data DescribeQueries = DescribeQueries'
  { -- | Limits the returned queries to only those that have the specified
    -- status. Valid values are @Cancelled@, @Complete@, @Failed@, @Running@,
    -- and @Scheduled@.
    DescribeQueries -> Maybe QueryStatus
status :: Prelude.Maybe QueryStatus,
    -- | Limits the returned queries to only those for the specified log group.
    DescribeQueries -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text,
    DescribeQueries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Limits the number of returned queries to the specified number.
    DescribeQueries -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeQueries -> DescribeQueries -> Bool
(DescribeQueries -> DescribeQueries -> Bool)
-> (DescribeQueries -> DescribeQueries -> Bool)
-> Eq DescribeQueries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeQueries -> DescribeQueries -> Bool
$c/= :: DescribeQueries -> DescribeQueries -> Bool
== :: DescribeQueries -> DescribeQueries -> Bool
$c== :: DescribeQueries -> DescribeQueries -> Bool
Prelude.Eq, ReadPrec [DescribeQueries]
ReadPrec DescribeQueries
Int -> ReadS DescribeQueries
ReadS [DescribeQueries]
(Int -> ReadS DescribeQueries)
-> ReadS [DescribeQueries]
-> ReadPrec DescribeQueries
-> ReadPrec [DescribeQueries]
-> Read DescribeQueries
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeQueries]
$creadListPrec :: ReadPrec [DescribeQueries]
readPrec :: ReadPrec DescribeQueries
$creadPrec :: ReadPrec DescribeQueries
readList :: ReadS [DescribeQueries]
$creadList :: ReadS [DescribeQueries]
readsPrec :: Int -> ReadS DescribeQueries
$creadsPrec :: Int -> ReadS DescribeQueries
Prelude.Read, Int -> DescribeQueries -> ShowS
[DescribeQueries] -> ShowS
DescribeQueries -> String
(Int -> DescribeQueries -> ShowS)
-> (DescribeQueries -> String)
-> ([DescribeQueries] -> ShowS)
-> Show DescribeQueries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeQueries] -> ShowS
$cshowList :: [DescribeQueries] -> ShowS
show :: DescribeQueries -> String
$cshow :: DescribeQueries -> String
showsPrec :: Int -> DescribeQueries -> ShowS
$cshowsPrec :: Int -> DescribeQueries -> ShowS
Prelude.Show, (forall x. DescribeQueries -> Rep DescribeQueries x)
-> (forall x. Rep DescribeQueries x -> DescribeQueries)
-> Generic DescribeQueries
forall x. Rep DescribeQueries x -> DescribeQueries
forall x. DescribeQueries -> Rep DescribeQueries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeQueries x -> DescribeQueries
$cfrom :: forall x. DescribeQueries -> Rep DescribeQueries x
Prelude.Generic)

-- |
-- Create a value of 'DescribeQueries' 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', 'describeQueries_status' - Limits the returned queries to only those that have the specified
-- status. Valid values are @Cancelled@, @Complete@, @Failed@, @Running@,
-- and @Scheduled@.
--
-- 'logGroupName', 'describeQueries_logGroupName' - Limits the returned queries to only those for the specified log group.
--
-- 'nextToken', 'describeQueries_nextToken' - Undocumented member.
--
-- 'maxResults', 'describeQueries_maxResults' - Limits the number of returned queries to the specified number.
newDescribeQueries ::
  DescribeQueries
newDescribeQueries :: DescribeQueries
newDescribeQueries =
  DescribeQueries' :: Maybe QueryStatus
-> Maybe Text -> Maybe Text -> Maybe Natural -> DescribeQueries
DescribeQueries'
    { $sel:status:DescribeQueries' :: Maybe QueryStatus
status = Maybe QueryStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:logGroupName:DescribeQueries' :: Maybe Text
logGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeQueries' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeQueries' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Limits the returned queries to only those that have the specified
-- status. Valid values are @Cancelled@, @Complete@, @Failed@, @Running@,
-- and @Scheduled@.
describeQueries_status :: Lens.Lens' DescribeQueries (Prelude.Maybe QueryStatus)
describeQueries_status :: (Maybe QueryStatus -> f (Maybe QueryStatus))
-> DescribeQueries -> f DescribeQueries
describeQueries_status = (DescribeQueries -> Maybe QueryStatus)
-> (DescribeQueries -> Maybe QueryStatus -> DescribeQueries)
-> Lens
     DescribeQueries
     DescribeQueries
     (Maybe QueryStatus)
     (Maybe QueryStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQueries' {Maybe QueryStatus
status :: Maybe QueryStatus
$sel:status:DescribeQueries' :: DescribeQueries -> Maybe QueryStatus
status} -> Maybe QueryStatus
status) (\s :: DescribeQueries
s@DescribeQueries' {} Maybe QueryStatus
a -> DescribeQueries
s {$sel:status:DescribeQueries' :: Maybe QueryStatus
status = Maybe QueryStatus
a} :: DescribeQueries)

-- | Limits the returned queries to only those for the specified log group.
describeQueries_logGroupName :: Lens.Lens' DescribeQueries (Prelude.Maybe Prelude.Text)
describeQueries_logGroupName :: (Maybe Text -> f (Maybe Text))
-> DescribeQueries -> f DescribeQueries
describeQueries_logGroupName = (DescribeQueries -> Maybe Text)
-> (DescribeQueries -> Maybe Text -> DescribeQueries)
-> Lens DescribeQueries DescribeQueries (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQueries' {Maybe Text
logGroupName :: Maybe Text
$sel:logGroupName:DescribeQueries' :: DescribeQueries -> Maybe Text
logGroupName} -> Maybe Text
logGroupName) (\s :: DescribeQueries
s@DescribeQueries' {} Maybe Text
a -> DescribeQueries
s {$sel:logGroupName:DescribeQueries' :: Maybe Text
logGroupName = Maybe Text
a} :: DescribeQueries)

-- | Undocumented member.
describeQueries_nextToken :: Lens.Lens' DescribeQueries (Prelude.Maybe Prelude.Text)
describeQueries_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeQueries -> f DescribeQueries
describeQueries_nextToken = (DescribeQueries -> Maybe Text)
-> (DescribeQueries -> Maybe Text -> DescribeQueries)
-> Lens DescribeQueries DescribeQueries (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQueries' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeQueries' :: DescribeQueries -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeQueries
s@DescribeQueries' {} Maybe Text
a -> DescribeQueries
s {$sel:nextToken:DescribeQueries' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeQueries)

-- | Limits the number of returned queries to the specified number.
describeQueries_maxResults :: Lens.Lens' DescribeQueries (Prelude.Maybe Prelude.Natural)
describeQueries_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeQueries -> f DescribeQueries
describeQueries_maxResults = (DescribeQueries -> Maybe Natural)
-> (DescribeQueries -> Maybe Natural -> DescribeQueries)
-> Lens
     DescribeQueries DescribeQueries (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQueries' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeQueries' :: DescribeQueries -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeQueries
s@DescribeQueries' {} Maybe Natural
a -> DescribeQueries
s {$sel:maxResults:DescribeQueries' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeQueries)

instance Core.AWSPager DescribeQueries where
  page :: DescribeQueries
-> AWSResponse DescribeQueries -> Maybe DescribeQueries
page DescribeQueries
rq AWSResponse DescribeQueries
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeQueries
DescribeQueriesResponse
rs
            DescribeQueriesResponse
-> Getting (First Text) DescribeQueriesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeQueriesResponse
-> Const (First Text) DescribeQueriesResponse
Lens' DescribeQueriesResponse (Maybe Text)
describeQueriesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeQueriesResponse
 -> Const (First Text) DescribeQueriesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeQueriesResponse 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 DescribeQueries
forall a. Maybe a
Prelude.Nothing
    | Maybe [QueryInfo] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeQueries
DescribeQueriesResponse
rs
            DescribeQueriesResponse
-> Getting (First [QueryInfo]) DescribeQueriesResponse [QueryInfo]
-> Maybe [QueryInfo]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [QueryInfo]
 -> Const (First [QueryInfo]) (Maybe [QueryInfo]))
-> DescribeQueriesResponse
-> Const (First [QueryInfo]) DescribeQueriesResponse
Lens' DescribeQueriesResponse (Maybe [QueryInfo])
describeQueriesResponse_queries ((Maybe [QueryInfo]
  -> Const (First [QueryInfo]) (Maybe [QueryInfo]))
 -> DescribeQueriesResponse
 -> Const (First [QueryInfo]) DescribeQueriesResponse)
-> (([QueryInfo] -> Const (First [QueryInfo]) [QueryInfo])
    -> Maybe [QueryInfo]
    -> Const (First [QueryInfo]) (Maybe [QueryInfo]))
-> Getting (First [QueryInfo]) DescribeQueriesResponse [QueryInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([QueryInfo] -> Const (First [QueryInfo]) [QueryInfo])
-> Maybe [QueryInfo]
-> Const (First [QueryInfo]) (Maybe [QueryInfo])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeQueries
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeQueries -> Maybe DescribeQueries
forall a. a -> Maybe a
Prelude.Just (DescribeQueries -> Maybe DescribeQueries)
-> DescribeQueries -> Maybe DescribeQueries
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeQueries
rq
          DescribeQueries
-> (DescribeQueries -> DescribeQueries) -> DescribeQueries
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeQueries -> Identity DescribeQueries
Lens DescribeQueries DescribeQueries (Maybe Text) (Maybe Text)
describeQueries_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeQueries -> Identity DescribeQueries)
-> Maybe Text -> DescribeQueries -> DescribeQueries
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeQueries
DescribeQueriesResponse
rs
          DescribeQueriesResponse
-> Getting (First Text) DescribeQueriesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeQueriesResponse
-> Const (First Text) DescribeQueriesResponse
Lens' DescribeQueriesResponse (Maybe Text)
describeQueriesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeQueriesResponse
 -> Const (First Text) DescribeQueriesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeQueriesResponse 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 DescribeQueries where
  type
    AWSResponse DescribeQueries =
      DescribeQueriesResponse
  request :: DescribeQueries -> Request DescribeQueries
request = Service -> DescribeQueries -> Request DescribeQueries
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeQueries
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeQueries)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeQueries))
-> Logger
-> Service
-> Proxy DescribeQueries
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeQueries)))
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 [QueryInfo] -> Maybe Text -> Int -> DescribeQueriesResponse
DescribeQueriesResponse'
            (Maybe [QueryInfo] -> Maybe Text -> Int -> DescribeQueriesResponse)
-> Either String (Maybe [QueryInfo])
-> Either String (Maybe Text -> Int -> DescribeQueriesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [QueryInfo]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"queries" Either String (Maybe (Maybe [QueryInfo]))
-> Maybe [QueryInfo] -> Either String (Maybe [QueryInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [QueryInfo]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeQueriesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeQueriesResponse)
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 -> DescribeQueriesResponse)
-> Either String Int -> Either String DescribeQueriesResponse
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 DescribeQueries

instance Prelude.NFData DescribeQueries

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

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

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

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

-- |
-- Create a value of 'DescribeQueriesResponse' 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:
--
-- 'queries', 'describeQueriesResponse_queries' - The list of queries that match the request.
--
-- 'nextToken', 'describeQueriesResponse_nextToken' - Undocumented member.
--
-- 'httpStatus', 'describeQueriesResponse_httpStatus' - The response's http status code.
newDescribeQueriesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeQueriesResponse
newDescribeQueriesResponse :: Int -> DescribeQueriesResponse
newDescribeQueriesResponse Int
pHttpStatus_ =
  DescribeQueriesResponse' :: Maybe [QueryInfo] -> Maybe Text -> Int -> DescribeQueriesResponse
DescribeQueriesResponse'
    { $sel:queries:DescribeQueriesResponse' :: Maybe [QueryInfo]
queries = Maybe [QueryInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeQueriesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeQueriesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of queries that match the request.
describeQueriesResponse_queries :: Lens.Lens' DescribeQueriesResponse (Prelude.Maybe [QueryInfo])
describeQueriesResponse_queries :: (Maybe [QueryInfo] -> f (Maybe [QueryInfo]))
-> DescribeQueriesResponse -> f DescribeQueriesResponse
describeQueriesResponse_queries = (DescribeQueriesResponse -> Maybe [QueryInfo])
-> (DescribeQueriesResponse
    -> Maybe [QueryInfo] -> DescribeQueriesResponse)
-> Lens' DescribeQueriesResponse (Maybe [QueryInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQueriesResponse' {Maybe [QueryInfo]
queries :: Maybe [QueryInfo]
$sel:queries:DescribeQueriesResponse' :: DescribeQueriesResponse -> Maybe [QueryInfo]
queries} -> Maybe [QueryInfo]
queries) (\s :: DescribeQueriesResponse
s@DescribeQueriesResponse' {} Maybe [QueryInfo]
a -> DescribeQueriesResponse
s {$sel:queries:DescribeQueriesResponse' :: Maybe [QueryInfo]
queries = Maybe [QueryInfo]
a} :: DescribeQueriesResponse) ((Maybe [QueryInfo] -> f (Maybe [QueryInfo]))
 -> DescribeQueriesResponse -> f DescribeQueriesResponse)
-> ((Maybe [QueryInfo] -> f (Maybe [QueryInfo]))
    -> Maybe [QueryInfo] -> f (Maybe [QueryInfo]))
-> (Maybe [QueryInfo] -> f (Maybe [QueryInfo]))
-> DescribeQueriesResponse
-> f DescribeQueriesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [QueryInfo] [QueryInfo] [QueryInfo] [QueryInfo]
-> Iso
     (Maybe [QueryInfo])
     (Maybe [QueryInfo])
     (Maybe [QueryInfo])
     (Maybe [QueryInfo])
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 [QueryInfo] [QueryInfo] [QueryInfo] [QueryInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
describeQueriesResponse_nextToken :: Lens.Lens' DescribeQueriesResponse (Prelude.Maybe Prelude.Text)
describeQueriesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeQueriesResponse -> f DescribeQueriesResponse
describeQueriesResponse_nextToken = (DescribeQueriesResponse -> Maybe Text)
-> (DescribeQueriesResponse
    -> Maybe Text -> DescribeQueriesResponse)
-> Lens' DescribeQueriesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQueriesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeQueriesResponse' :: DescribeQueriesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeQueriesResponse
s@DescribeQueriesResponse' {} Maybe Text
a -> DescribeQueriesResponse
s {$sel:nextToken:DescribeQueriesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeQueriesResponse)

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

instance Prelude.NFData DescribeQueriesResponse