{-# 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.Glue.GetCrawlerMetrics
-- 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)
--
-- Retrieves metrics about specified crawlers.
--
-- This operation returns paginated results.
module Amazonka.Glue.GetCrawlerMetrics
  ( -- * Creating a Request
    GetCrawlerMetrics (..),
    newGetCrawlerMetrics,

    -- * Request Lenses
    getCrawlerMetrics_nextToken,
    getCrawlerMetrics_maxResults,
    getCrawlerMetrics_crawlerNameList,

    -- * Destructuring the Response
    GetCrawlerMetricsResponse (..),
    newGetCrawlerMetricsResponse,

    -- * Response Lenses
    getCrawlerMetricsResponse_crawlerMetricsList,
    getCrawlerMetricsResponse_nextToken,
    getCrawlerMetricsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
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:/ 'newGetCrawlerMetrics' smart constructor.
data GetCrawlerMetrics = GetCrawlerMetrics'
  { -- | A continuation token, if this is a continuation call.
    GetCrawlerMetrics -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum size of a list to return.
    GetCrawlerMetrics -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A list of the names of crawlers about which to retrieve metrics.
    GetCrawlerMetrics -> Maybe [Text]
crawlerNameList :: Prelude.Maybe [Prelude.Text]
  }
  deriving (GetCrawlerMetrics -> GetCrawlerMetrics -> Bool
(GetCrawlerMetrics -> GetCrawlerMetrics -> Bool)
-> (GetCrawlerMetrics -> GetCrawlerMetrics -> Bool)
-> Eq GetCrawlerMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCrawlerMetrics -> GetCrawlerMetrics -> Bool
$c/= :: GetCrawlerMetrics -> GetCrawlerMetrics -> Bool
== :: GetCrawlerMetrics -> GetCrawlerMetrics -> Bool
$c== :: GetCrawlerMetrics -> GetCrawlerMetrics -> Bool
Prelude.Eq, ReadPrec [GetCrawlerMetrics]
ReadPrec GetCrawlerMetrics
Int -> ReadS GetCrawlerMetrics
ReadS [GetCrawlerMetrics]
(Int -> ReadS GetCrawlerMetrics)
-> ReadS [GetCrawlerMetrics]
-> ReadPrec GetCrawlerMetrics
-> ReadPrec [GetCrawlerMetrics]
-> Read GetCrawlerMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCrawlerMetrics]
$creadListPrec :: ReadPrec [GetCrawlerMetrics]
readPrec :: ReadPrec GetCrawlerMetrics
$creadPrec :: ReadPrec GetCrawlerMetrics
readList :: ReadS [GetCrawlerMetrics]
$creadList :: ReadS [GetCrawlerMetrics]
readsPrec :: Int -> ReadS GetCrawlerMetrics
$creadsPrec :: Int -> ReadS GetCrawlerMetrics
Prelude.Read, Int -> GetCrawlerMetrics -> ShowS
[GetCrawlerMetrics] -> ShowS
GetCrawlerMetrics -> String
(Int -> GetCrawlerMetrics -> ShowS)
-> (GetCrawlerMetrics -> String)
-> ([GetCrawlerMetrics] -> ShowS)
-> Show GetCrawlerMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCrawlerMetrics] -> ShowS
$cshowList :: [GetCrawlerMetrics] -> ShowS
show :: GetCrawlerMetrics -> String
$cshow :: GetCrawlerMetrics -> String
showsPrec :: Int -> GetCrawlerMetrics -> ShowS
$cshowsPrec :: Int -> GetCrawlerMetrics -> ShowS
Prelude.Show, (forall x. GetCrawlerMetrics -> Rep GetCrawlerMetrics x)
-> (forall x. Rep GetCrawlerMetrics x -> GetCrawlerMetrics)
-> Generic GetCrawlerMetrics
forall x. Rep GetCrawlerMetrics x -> GetCrawlerMetrics
forall x. GetCrawlerMetrics -> Rep GetCrawlerMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCrawlerMetrics x -> GetCrawlerMetrics
$cfrom :: forall x. GetCrawlerMetrics -> Rep GetCrawlerMetrics x
Prelude.Generic)

-- |
-- Create a value of 'GetCrawlerMetrics' 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', 'getCrawlerMetrics_nextToken' - A continuation token, if this is a continuation call.
--
-- 'maxResults', 'getCrawlerMetrics_maxResults' - The maximum size of a list to return.
--
-- 'crawlerNameList', 'getCrawlerMetrics_crawlerNameList' - A list of the names of crawlers about which to retrieve metrics.
newGetCrawlerMetrics ::
  GetCrawlerMetrics
newGetCrawlerMetrics :: GetCrawlerMetrics
newGetCrawlerMetrics =
  GetCrawlerMetrics' :: Maybe Text -> Maybe Natural -> Maybe [Text] -> GetCrawlerMetrics
GetCrawlerMetrics'
    { $sel:nextToken:GetCrawlerMetrics' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetCrawlerMetrics' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:crawlerNameList:GetCrawlerMetrics' :: Maybe [Text]
crawlerNameList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | A continuation token, if this is a continuation call.
getCrawlerMetrics_nextToken :: Lens.Lens' GetCrawlerMetrics (Prelude.Maybe Prelude.Text)
getCrawlerMetrics_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetCrawlerMetrics -> f GetCrawlerMetrics
getCrawlerMetrics_nextToken = (GetCrawlerMetrics -> Maybe Text)
-> (GetCrawlerMetrics -> Maybe Text -> GetCrawlerMetrics)
-> Lens
     GetCrawlerMetrics GetCrawlerMetrics (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCrawlerMetrics' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCrawlerMetrics' :: GetCrawlerMetrics -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCrawlerMetrics
s@GetCrawlerMetrics' {} Maybe Text
a -> GetCrawlerMetrics
s {$sel:nextToken:GetCrawlerMetrics' :: Maybe Text
nextToken = Maybe Text
a} :: GetCrawlerMetrics)

-- | The maximum size of a list to return.
getCrawlerMetrics_maxResults :: Lens.Lens' GetCrawlerMetrics (Prelude.Maybe Prelude.Natural)
getCrawlerMetrics_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetCrawlerMetrics -> f GetCrawlerMetrics
getCrawlerMetrics_maxResults = (GetCrawlerMetrics -> Maybe Natural)
-> (GetCrawlerMetrics -> Maybe Natural -> GetCrawlerMetrics)
-> Lens
     GetCrawlerMetrics GetCrawlerMetrics (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCrawlerMetrics' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetCrawlerMetrics' :: GetCrawlerMetrics -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetCrawlerMetrics
s@GetCrawlerMetrics' {} Maybe Natural
a -> GetCrawlerMetrics
s {$sel:maxResults:GetCrawlerMetrics' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetCrawlerMetrics)

-- | A list of the names of crawlers about which to retrieve metrics.
getCrawlerMetrics_crawlerNameList :: Lens.Lens' GetCrawlerMetrics (Prelude.Maybe [Prelude.Text])
getCrawlerMetrics_crawlerNameList :: (Maybe [Text] -> f (Maybe [Text]))
-> GetCrawlerMetrics -> f GetCrawlerMetrics
getCrawlerMetrics_crawlerNameList = (GetCrawlerMetrics -> Maybe [Text])
-> (GetCrawlerMetrics -> Maybe [Text] -> GetCrawlerMetrics)
-> Lens
     GetCrawlerMetrics GetCrawlerMetrics (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCrawlerMetrics' {Maybe [Text]
crawlerNameList :: Maybe [Text]
$sel:crawlerNameList:GetCrawlerMetrics' :: GetCrawlerMetrics -> Maybe [Text]
crawlerNameList} -> Maybe [Text]
crawlerNameList) (\s :: GetCrawlerMetrics
s@GetCrawlerMetrics' {} Maybe [Text]
a -> GetCrawlerMetrics
s {$sel:crawlerNameList:GetCrawlerMetrics' :: Maybe [Text]
crawlerNameList = Maybe [Text]
a} :: GetCrawlerMetrics) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetCrawlerMetrics -> f GetCrawlerMetrics)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetCrawlerMetrics
-> f GetCrawlerMetrics
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetCrawlerMetrics

instance Core.ToHeaders GetCrawlerMetrics where
  toHeaders :: GetCrawlerMetrics -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetCrawlerMetrics -> 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
"AWSGlue.GetCrawlerMetrics" :: 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 GetCrawlerMetrics where
  toJSON :: GetCrawlerMetrics -> Value
toJSON GetCrawlerMetrics' {Maybe Natural
Maybe [Text]
Maybe Text
crawlerNameList :: Maybe [Text]
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:crawlerNameList:GetCrawlerMetrics' :: GetCrawlerMetrics -> Maybe [Text]
$sel:maxResults:GetCrawlerMetrics' :: GetCrawlerMetrics -> Maybe Natural
$sel:nextToken:GetCrawlerMetrics' :: GetCrawlerMetrics -> 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,
            (Text
"CrawlerNameList" 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]
crawlerNameList
          ]
      )

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

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

-- | /See:/ 'newGetCrawlerMetricsResponse' smart constructor.
data GetCrawlerMetricsResponse = GetCrawlerMetricsResponse'
  { -- | A list of metrics for the specified crawler.
    GetCrawlerMetricsResponse -> Maybe [CrawlerMetrics]
crawlerMetricsList :: Prelude.Maybe [CrawlerMetrics],
    -- | A continuation token, if the returned list does not contain the last
    -- metric available.
    GetCrawlerMetricsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetCrawlerMetricsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCrawlerMetricsResponse -> GetCrawlerMetricsResponse -> Bool
(GetCrawlerMetricsResponse -> GetCrawlerMetricsResponse -> Bool)
-> (GetCrawlerMetricsResponse -> GetCrawlerMetricsResponse -> Bool)
-> Eq GetCrawlerMetricsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCrawlerMetricsResponse -> GetCrawlerMetricsResponse -> Bool
$c/= :: GetCrawlerMetricsResponse -> GetCrawlerMetricsResponse -> Bool
== :: GetCrawlerMetricsResponse -> GetCrawlerMetricsResponse -> Bool
$c== :: GetCrawlerMetricsResponse -> GetCrawlerMetricsResponse -> Bool
Prelude.Eq, ReadPrec [GetCrawlerMetricsResponse]
ReadPrec GetCrawlerMetricsResponse
Int -> ReadS GetCrawlerMetricsResponse
ReadS [GetCrawlerMetricsResponse]
(Int -> ReadS GetCrawlerMetricsResponse)
-> ReadS [GetCrawlerMetricsResponse]
-> ReadPrec GetCrawlerMetricsResponse
-> ReadPrec [GetCrawlerMetricsResponse]
-> Read GetCrawlerMetricsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCrawlerMetricsResponse]
$creadListPrec :: ReadPrec [GetCrawlerMetricsResponse]
readPrec :: ReadPrec GetCrawlerMetricsResponse
$creadPrec :: ReadPrec GetCrawlerMetricsResponse
readList :: ReadS [GetCrawlerMetricsResponse]
$creadList :: ReadS [GetCrawlerMetricsResponse]
readsPrec :: Int -> ReadS GetCrawlerMetricsResponse
$creadsPrec :: Int -> ReadS GetCrawlerMetricsResponse
Prelude.Read, Int -> GetCrawlerMetricsResponse -> ShowS
[GetCrawlerMetricsResponse] -> ShowS
GetCrawlerMetricsResponse -> String
(Int -> GetCrawlerMetricsResponse -> ShowS)
-> (GetCrawlerMetricsResponse -> String)
-> ([GetCrawlerMetricsResponse] -> ShowS)
-> Show GetCrawlerMetricsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCrawlerMetricsResponse] -> ShowS
$cshowList :: [GetCrawlerMetricsResponse] -> ShowS
show :: GetCrawlerMetricsResponse -> String
$cshow :: GetCrawlerMetricsResponse -> String
showsPrec :: Int -> GetCrawlerMetricsResponse -> ShowS
$cshowsPrec :: Int -> GetCrawlerMetricsResponse -> ShowS
Prelude.Show, (forall x.
 GetCrawlerMetricsResponse -> Rep GetCrawlerMetricsResponse x)
-> (forall x.
    Rep GetCrawlerMetricsResponse x -> GetCrawlerMetricsResponse)
-> Generic GetCrawlerMetricsResponse
forall x.
Rep GetCrawlerMetricsResponse x -> GetCrawlerMetricsResponse
forall x.
GetCrawlerMetricsResponse -> Rep GetCrawlerMetricsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCrawlerMetricsResponse x -> GetCrawlerMetricsResponse
$cfrom :: forall x.
GetCrawlerMetricsResponse -> Rep GetCrawlerMetricsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCrawlerMetricsResponse' 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:
--
-- 'crawlerMetricsList', 'getCrawlerMetricsResponse_crawlerMetricsList' - A list of metrics for the specified crawler.
--
-- 'nextToken', 'getCrawlerMetricsResponse_nextToken' - A continuation token, if the returned list does not contain the last
-- metric available.
--
-- 'httpStatus', 'getCrawlerMetricsResponse_httpStatus' - The response's http status code.
newGetCrawlerMetricsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCrawlerMetricsResponse
newGetCrawlerMetricsResponse :: Int -> GetCrawlerMetricsResponse
newGetCrawlerMetricsResponse Int
pHttpStatus_ =
  GetCrawlerMetricsResponse' :: Maybe [CrawlerMetrics]
-> Maybe Text -> Int -> GetCrawlerMetricsResponse
GetCrawlerMetricsResponse'
    { $sel:crawlerMetricsList:GetCrawlerMetricsResponse' :: Maybe [CrawlerMetrics]
crawlerMetricsList =
        Maybe [CrawlerMetrics]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetCrawlerMetricsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCrawlerMetricsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of metrics for the specified crawler.
getCrawlerMetricsResponse_crawlerMetricsList :: Lens.Lens' GetCrawlerMetricsResponse (Prelude.Maybe [CrawlerMetrics])
getCrawlerMetricsResponse_crawlerMetricsList :: (Maybe [CrawlerMetrics] -> f (Maybe [CrawlerMetrics]))
-> GetCrawlerMetricsResponse -> f GetCrawlerMetricsResponse
getCrawlerMetricsResponse_crawlerMetricsList = (GetCrawlerMetricsResponse -> Maybe [CrawlerMetrics])
-> (GetCrawlerMetricsResponse
    -> Maybe [CrawlerMetrics] -> GetCrawlerMetricsResponse)
-> Lens' GetCrawlerMetricsResponse (Maybe [CrawlerMetrics])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCrawlerMetricsResponse' {Maybe [CrawlerMetrics]
crawlerMetricsList :: Maybe [CrawlerMetrics]
$sel:crawlerMetricsList:GetCrawlerMetricsResponse' :: GetCrawlerMetricsResponse -> Maybe [CrawlerMetrics]
crawlerMetricsList} -> Maybe [CrawlerMetrics]
crawlerMetricsList) (\s :: GetCrawlerMetricsResponse
s@GetCrawlerMetricsResponse' {} Maybe [CrawlerMetrics]
a -> GetCrawlerMetricsResponse
s {$sel:crawlerMetricsList:GetCrawlerMetricsResponse' :: Maybe [CrawlerMetrics]
crawlerMetricsList = Maybe [CrawlerMetrics]
a} :: GetCrawlerMetricsResponse) ((Maybe [CrawlerMetrics] -> f (Maybe [CrawlerMetrics]))
 -> GetCrawlerMetricsResponse -> f GetCrawlerMetricsResponse)
-> ((Maybe [CrawlerMetrics] -> f (Maybe [CrawlerMetrics]))
    -> Maybe [CrawlerMetrics] -> f (Maybe [CrawlerMetrics]))
-> (Maybe [CrawlerMetrics] -> f (Maybe [CrawlerMetrics]))
-> GetCrawlerMetricsResponse
-> f GetCrawlerMetricsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CrawlerMetrics] [CrawlerMetrics] [CrawlerMetrics] [CrawlerMetrics]
-> Iso
     (Maybe [CrawlerMetrics])
     (Maybe [CrawlerMetrics])
     (Maybe [CrawlerMetrics])
     (Maybe [CrawlerMetrics])
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
  [CrawlerMetrics] [CrawlerMetrics] [CrawlerMetrics] [CrawlerMetrics]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A continuation token, if the returned list does not contain the last
-- metric available.
getCrawlerMetricsResponse_nextToken :: Lens.Lens' GetCrawlerMetricsResponse (Prelude.Maybe Prelude.Text)
getCrawlerMetricsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetCrawlerMetricsResponse -> f GetCrawlerMetricsResponse
getCrawlerMetricsResponse_nextToken = (GetCrawlerMetricsResponse -> Maybe Text)
-> (GetCrawlerMetricsResponse
    -> Maybe Text -> GetCrawlerMetricsResponse)
-> Lens' GetCrawlerMetricsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCrawlerMetricsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCrawlerMetricsResponse' :: GetCrawlerMetricsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCrawlerMetricsResponse
s@GetCrawlerMetricsResponse' {} Maybe Text
a -> GetCrawlerMetricsResponse
s {$sel:nextToken:GetCrawlerMetricsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetCrawlerMetricsResponse)

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

instance Prelude.NFData GetCrawlerMetricsResponse