{-# 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.IoT.ListCustomMetrics
-- 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)
--
-- Lists your Device Defender detect custom metrics.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListCustomMetrics>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListCustomMetrics
  ( -- * Creating a Request
    ListCustomMetrics (..),
    newListCustomMetrics,

    -- * Request Lenses
    listCustomMetrics_nextToken,
    listCustomMetrics_maxResults,

    -- * Destructuring the Response
    ListCustomMetricsResponse (..),
    newListCustomMetricsResponse,

    -- * Response Lenses
    listCustomMetricsResponse_metricNames,
    listCustomMetricsResponse_nextToken,
    listCustomMetricsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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:/ 'newListCustomMetrics' smart constructor.
data ListCustomMetrics = ListCustomMetrics'
  { -- | The token for the next set of results.
    ListCustomMetrics -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return at one time. The default is 25.
    ListCustomMetrics -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListCustomMetrics -> ListCustomMetrics -> Bool
(ListCustomMetrics -> ListCustomMetrics -> Bool)
-> (ListCustomMetrics -> ListCustomMetrics -> Bool)
-> Eq ListCustomMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCustomMetrics -> ListCustomMetrics -> Bool
$c/= :: ListCustomMetrics -> ListCustomMetrics -> Bool
== :: ListCustomMetrics -> ListCustomMetrics -> Bool
$c== :: ListCustomMetrics -> ListCustomMetrics -> Bool
Prelude.Eq, ReadPrec [ListCustomMetrics]
ReadPrec ListCustomMetrics
Int -> ReadS ListCustomMetrics
ReadS [ListCustomMetrics]
(Int -> ReadS ListCustomMetrics)
-> ReadS [ListCustomMetrics]
-> ReadPrec ListCustomMetrics
-> ReadPrec [ListCustomMetrics]
-> Read ListCustomMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCustomMetrics]
$creadListPrec :: ReadPrec [ListCustomMetrics]
readPrec :: ReadPrec ListCustomMetrics
$creadPrec :: ReadPrec ListCustomMetrics
readList :: ReadS [ListCustomMetrics]
$creadList :: ReadS [ListCustomMetrics]
readsPrec :: Int -> ReadS ListCustomMetrics
$creadsPrec :: Int -> ReadS ListCustomMetrics
Prelude.Read, Int -> ListCustomMetrics -> ShowS
[ListCustomMetrics] -> ShowS
ListCustomMetrics -> String
(Int -> ListCustomMetrics -> ShowS)
-> (ListCustomMetrics -> String)
-> ([ListCustomMetrics] -> ShowS)
-> Show ListCustomMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCustomMetrics] -> ShowS
$cshowList :: [ListCustomMetrics] -> ShowS
show :: ListCustomMetrics -> String
$cshow :: ListCustomMetrics -> String
showsPrec :: Int -> ListCustomMetrics -> ShowS
$cshowsPrec :: Int -> ListCustomMetrics -> ShowS
Prelude.Show, (forall x. ListCustomMetrics -> Rep ListCustomMetrics x)
-> (forall x. Rep ListCustomMetrics x -> ListCustomMetrics)
-> Generic ListCustomMetrics
forall x. Rep ListCustomMetrics x -> ListCustomMetrics
forall x. ListCustomMetrics -> Rep ListCustomMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCustomMetrics x -> ListCustomMetrics
$cfrom :: forall x. ListCustomMetrics -> Rep ListCustomMetrics x
Prelude.Generic)

-- |
-- Create a value of 'ListCustomMetrics' 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', 'listCustomMetrics_nextToken' - The token for the next set of results.
--
-- 'maxResults', 'listCustomMetrics_maxResults' - The maximum number of results to return at one time. The default is 25.
newListCustomMetrics ::
  ListCustomMetrics
newListCustomMetrics :: ListCustomMetrics
newListCustomMetrics =
  ListCustomMetrics' :: Maybe Text -> Maybe Natural -> ListCustomMetrics
ListCustomMetrics'
    { $sel:nextToken:ListCustomMetrics' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCustomMetrics' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The token for the next set of results.
listCustomMetrics_nextToken :: Lens.Lens' ListCustomMetrics (Prelude.Maybe Prelude.Text)
listCustomMetrics_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCustomMetrics -> f ListCustomMetrics
listCustomMetrics_nextToken = (ListCustomMetrics -> Maybe Text)
-> (ListCustomMetrics -> Maybe Text -> ListCustomMetrics)
-> Lens
     ListCustomMetrics ListCustomMetrics (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomMetrics' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCustomMetrics' :: ListCustomMetrics -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCustomMetrics
s@ListCustomMetrics' {} Maybe Text
a -> ListCustomMetrics
s {$sel:nextToken:ListCustomMetrics' :: Maybe Text
nextToken = Maybe Text
a} :: ListCustomMetrics)

-- | The maximum number of results to return at one time. The default is 25.
listCustomMetrics_maxResults :: Lens.Lens' ListCustomMetrics (Prelude.Maybe Prelude.Natural)
listCustomMetrics_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListCustomMetrics -> f ListCustomMetrics
listCustomMetrics_maxResults = (ListCustomMetrics -> Maybe Natural)
-> (ListCustomMetrics -> Maybe Natural -> ListCustomMetrics)
-> Lens
     ListCustomMetrics ListCustomMetrics (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomMetrics' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCustomMetrics' :: ListCustomMetrics -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCustomMetrics
s@ListCustomMetrics' {} Maybe Natural
a -> ListCustomMetrics
s {$sel:maxResults:ListCustomMetrics' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCustomMetrics)

instance Core.AWSPager ListCustomMetrics where
  page :: ListCustomMetrics
-> AWSResponse ListCustomMetrics -> Maybe ListCustomMetrics
page ListCustomMetrics
rq AWSResponse ListCustomMetrics
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCustomMetrics
ListCustomMetricsResponse
rs
            ListCustomMetricsResponse
-> Getting (First Text) ListCustomMetricsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCustomMetricsResponse
-> Const (First Text) ListCustomMetricsResponse
Lens' ListCustomMetricsResponse (Maybe Text)
listCustomMetricsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCustomMetricsResponse
 -> Const (First Text) ListCustomMetricsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCustomMetricsResponse 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 ListCustomMetrics
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCustomMetrics
ListCustomMetricsResponse
rs
            ListCustomMetricsResponse
-> Getting (First [Text]) ListCustomMetricsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListCustomMetricsResponse
-> Const (First [Text]) ListCustomMetricsResponse
Lens' ListCustomMetricsResponse (Maybe [Text])
listCustomMetricsResponse_metricNames
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListCustomMetricsResponse
 -> Const (First [Text]) ListCustomMetricsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListCustomMetricsResponse [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 ListCustomMetrics
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListCustomMetrics -> Maybe ListCustomMetrics
forall a. a -> Maybe a
Prelude.Just (ListCustomMetrics -> Maybe ListCustomMetrics)
-> ListCustomMetrics -> Maybe ListCustomMetrics
forall a b. (a -> b) -> a -> b
Prelude.$
        ListCustomMetrics
rq
          ListCustomMetrics
-> (ListCustomMetrics -> ListCustomMetrics) -> ListCustomMetrics
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListCustomMetrics -> Identity ListCustomMetrics
Lens ListCustomMetrics ListCustomMetrics (Maybe Text) (Maybe Text)
listCustomMetrics_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListCustomMetrics -> Identity ListCustomMetrics)
-> Maybe Text -> ListCustomMetrics -> ListCustomMetrics
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCustomMetrics
ListCustomMetricsResponse
rs
          ListCustomMetricsResponse
-> Getting (First Text) ListCustomMetricsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCustomMetricsResponse
-> Const (First Text) ListCustomMetricsResponse
Lens' ListCustomMetricsResponse (Maybe Text)
listCustomMetricsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCustomMetricsResponse
 -> Const (First Text) ListCustomMetricsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCustomMetricsResponse 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 ListCustomMetrics where
  type
    AWSResponse ListCustomMetrics =
      ListCustomMetricsResponse
  request :: ListCustomMetrics -> Request ListCustomMetrics
request = Service -> ListCustomMetrics -> Request ListCustomMetrics
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListCustomMetrics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCustomMetrics)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListCustomMetrics))
-> Logger
-> Service
-> Proxy ListCustomMetrics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCustomMetrics)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Text] -> Maybe Text -> Int -> ListCustomMetricsResponse
ListCustomMetricsResponse'
            (Maybe [Text] -> Maybe Text -> Int -> ListCustomMetricsResponse)
-> Either String (Maybe [Text])
-> Either String (Maybe Text -> Int -> ListCustomMetricsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricNames" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListCustomMetricsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListCustomMetricsResponse)
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 -> ListCustomMetricsResponse)
-> Either String Int -> Either String ListCustomMetricsResponse
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 ListCustomMetrics

instance Prelude.NFData ListCustomMetrics

instance Core.ToHeaders ListCustomMetrics where
  toHeaders :: ListCustomMetrics -> ResponseHeaders
toHeaders = ResponseHeaders -> ListCustomMetrics -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListCustomMetrics where
  toQuery :: ListCustomMetrics -> QueryString
toQuery ListCustomMetrics' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListCustomMetrics' :: ListCustomMetrics -> Maybe Natural
$sel:nextToken:ListCustomMetrics' :: ListCustomMetrics -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListCustomMetricsResponse' smart constructor.
data ListCustomMetricsResponse = ListCustomMetricsResponse'
  { -- | The name of the custom metric.
    ListCustomMetricsResponse -> Maybe [Text]
metricNames :: Prelude.Maybe [Prelude.Text],
    -- | A token that can be used to retrieve the next set of results, or @null@
    -- if there are no additional results.
    ListCustomMetricsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCustomMetricsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCustomMetricsResponse -> ListCustomMetricsResponse -> Bool
(ListCustomMetricsResponse -> ListCustomMetricsResponse -> Bool)
-> (ListCustomMetricsResponse -> ListCustomMetricsResponse -> Bool)
-> Eq ListCustomMetricsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCustomMetricsResponse -> ListCustomMetricsResponse -> Bool
$c/= :: ListCustomMetricsResponse -> ListCustomMetricsResponse -> Bool
== :: ListCustomMetricsResponse -> ListCustomMetricsResponse -> Bool
$c== :: ListCustomMetricsResponse -> ListCustomMetricsResponse -> Bool
Prelude.Eq, ReadPrec [ListCustomMetricsResponse]
ReadPrec ListCustomMetricsResponse
Int -> ReadS ListCustomMetricsResponse
ReadS [ListCustomMetricsResponse]
(Int -> ReadS ListCustomMetricsResponse)
-> ReadS [ListCustomMetricsResponse]
-> ReadPrec ListCustomMetricsResponse
-> ReadPrec [ListCustomMetricsResponse]
-> Read ListCustomMetricsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCustomMetricsResponse]
$creadListPrec :: ReadPrec [ListCustomMetricsResponse]
readPrec :: ReadPrec ListCustomMetricsResponse
$creadPrec :: ReadPrec ListCustomMetricsResponse
readList :: ReadS [ListCustomMetricsResponse]
$creadList :: ReadS [ListCustomMetricsResponse]
readsPrec :: Int -> ReadS ListCustomMetricsResponse
$creadsPrec :: Int -> ReadS ListCustomMetricsResponse
Prelude.Read, Int -> ListCustomMetricsResponse -> ShowS
[ListCustomMetricsResponse] -> ShowS
ListCustomMetricsResponse -> String
(Int -> ListCustomMetricsResponse -> ShowS)
-> (ListCustomMetricsResponse -> String)
-> ([ListCustomMetricsResponse] -> ShowS)
-> Show ListCustomMetricsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCustomMetricsResponse] -> ShowS
$cshowList :: [ListCustomMetricsResponse] -> ShowS
show :: ListCustomMetricsResponse -> String
$cshow :: ListCustomMetricsResponse -> String
showsPrec :: Int -> ListCustomMetricsResponse -> ShowS
$cshowsPrec :: Int -> ListCustomMetricsResponse -> ShowS
Prelude.Show, (forall x.
 ListCustomMetricsResponse -> Rep ListCustomMetricsResponse x)
-> (forall x.
    Rep ListCustomMetricsResponse x -> ListCustomMetricsResponse)
-> Generic ListCustomMetricsResponse
forall x.
Rep ListCustomMetricsResponse x -> ListCustomMetricsResponse
forall x.
ListCustomMetricsResponse -> Rep ListCustomMetricsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCustomMetricsResponse x -> ListCustomMetricsResponse
$cfrom :: forall x.
ListCustomMetricsResponse -> Rep ListCustomMetricsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCustomMetricsResponse' 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:
--
-- 'metricNames', 'listCustomMetricsResponse_metricNames' - The name of the custom metric.
--
-- 'nextToken', 'listCustomMetricsResponse_nextToken' - A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
--
-- 'httpStatus', 'listCustomMetricsResponse_httpStatus' - The response's http status code.
newListCustomMetricsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCustomMetricsResponse
newListCustomMetricsResponse :: Int -> ListCustomMetricsResponse
newListCustomMetricsResponse Int
pHttpStatus_ =
  ListCustomMetricsResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListCustomMetricsResponse
ListCustomMetricsResponse'
    { $sel:metricNames:ListCustomMetricsResponse' :: Maybe [Text]
metricNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCustomMetricsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCustomMetricsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the custom metric.
listCustomMetricsResponse_metricNames :: Lens.Lens' ListCustomMetricsResponse (Prelude.Maybe [Prelude.Text])
listCustomMetricsResponse_metricNames :: (Maybe [Text] -> f (Maybe [Text]))
-> ListCustomMetricsResponse -> f ListCustomMetricsResponse
listCustomMetricsResponse_metricNames = (ListCustomMetricsResponse -> Maybe [Text])
-> (ListCustomMetricsResponse
    -> Maybe [Text] -> ListCustomMetricsResponse)
-> Lens' ListCustomMetricsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomMetricsResponse' {Maybe [Text]
metricNames :: Maybe [Text]
$sel:metricNames:ListCustomMetricsResponse' :: ListCustomMetricsResponse -> Maybe [Text]
metricNames} -> Maybe [Text]
metricNames) (\s :: ListCustomMetricsResponse
s@ListCustomMetricsResponse' {} Maybe [Text]
a -> ListCustomMetricsResponse
s {$sel:metricNames:ListCustomMetricsResponse' :: Maybe [Text]
metricNames = Maybe [Text]
a} :: ListCustomMetricsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListCustomMetricsResponse -> f ListCustomMetricsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListCustomMetricsResponse
-> f ListCustomMetricsResponse
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

-- | A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
listCustomMetricsResponse_nextToken :: Lens.Lens' ListCustomMetricsResponse (Prelude.Maybe Prelude.Text)
listCustomMetricsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCustomMetricsResponse -> f ListCustomMetricsResponse
listCustomMetricsResponse_nextToken = (ListCustomMetricsResponse -> Maybe Text)
-> (ListCustomMetricsResponse
    -> Maybe Text -> ListCustomMetricsResponse)
-> Lens' ListCustomMetricsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomMetricsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCustomMetricsResponse' :: ListCustomMetricsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCustomMetricsResponse
s@ListCustomMetricsResponse' {} Maybe Text
a -> ListCustomMetricsResponse
s {$sel:nextToken:ListCustomMetricsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCustomMetricsResponse)

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

instance Prelude.NFData ListCustomMetricsResponse