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

    -- * Request Lenses
    listFleetMetrics_nextToken,
    listFleetMetrics_maxResults,

    -- * Destructuring the Response
    ListFleetMetricsResponse (..),
    newListFleetMetricsResponse,

    -- * Response Lenses
    listFleetMetricsResponse_fleetMetrics,
    listFleetMetricsResponse_nextToken,
    listFleetMetricsResponse_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:/ 'newListFleetMetrics' smart constructor.
data ListFleetMetrics = ListFleetMetrics'
  { -- | To retrieve the next set of results, the @nextToken@ value from a
    -- previous response; otherwise @null@ to receive the first set of results.
    ListFleetMetrics -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in this operation.
    ListFleetMetrics -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListFleetMetrics -> ListFleetMetrics -> Bool
(ListFleetMetrics -> ListFleetMetrics -> Bool)
-> (ListFleetMetrics -> ListFleetMetrics -> Bool)
-> Eq ListFleetMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFleetMetrics -> ListFleetMetrics -> Bool
$c/= :: ListFleetMetrics -> ListFleetMetrics -> Bool
== :: ListFleetMetrics -> ListFleetMetrics -> Bool
$c== :: ListFleetMetrics -> ListFleetMetrics -> Bool
Prelude.Eq, ReadPrec [ListFleetMetrics]
ReadPrec ListFleetMetrics
Int -> ReadS ListFleetMetrics
ReadS [ListFleetMetrics]
(Int -> ReadS ListFleetMetrics)
-> ReadS [ListFleetMetrics]
-> ReadPrec ListFleetMetrics
-> ReadPrec [ListFleetMetrics]
-> Read ListFleetMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFleetMetrics]
$creadListPrec :: ReadPrec [ListFleetMetrics]
readPrec :: ReadPrec ListFleetMetrics
$creadPrec :: ReadPrec ListFleetMetrics
readList :: ReadS [ListFleetMetrics]
$creadList :: ReadS [ListFleetMetrics]
readsPrec :: Int -> ReadS ListFleetMetrics
$creadsPrec :: Int -> ReadS ListFleetMetrics
Prelude.Read, Int -> ListFleetMetrics -> ShowS
[ListFleetMetrics] -> ShowS
ListFleetMetrics -> String
(Int -> ListFleetMetrics -> ShowS)
-> (ListFleetMetrics -> String)
-> ([ListFleetMetrics] -> ShowS)
-> Show ListFleetMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFleetMetrics] -> ShowS
$cshowList :: [ListFleetMetrics] -> ShowS
show :: ListFleetMetrics -> String
$cshow :: ListFleetMetrics -> String
showsPrec :: Int -> ListFleetMetrics -> ShowS
$cshowsPrec :: Int -> ListFleetMetrics -> ShowS
Prelude.Show, (forall x. ListFleetMetrics -> Rep ListFleetMetrics x)
-> (forall x. Rep ListFleetMetrics x -> ListFleetMetrics)
-> Generic ListFleetMetrics
forall x. Rep ListFleetMetrics x -> ListFleetMetrics
forall x. ListFleetMetrics -> Rep ListFleetMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFleetMetrics x -> ListFleetMetrics
$cfrom :: forall x. ListFleetMetrics -> Rep ListFleetMetrics x
Prelude.Generic)

-- |
-- Create a value of 'ListFleetMetrics' 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', 'listFleetMetrics_nextToken' - To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise @null@ to receive the first set of results.
--
-- 'maxResults', 'listFleetMetrics_maxResults' - The maximum number of results to return in this operation.
newListFleetMetrics ::
  ListFleetMetrics
newListFleetMetrics :: ListFleetMetrics
newListFleetMetrics =
  ListFleetMetrics' :: Maybe Text -> Maybe Natural -> ListFleetMetrics
ListFleetMetrics'
    { $sel:nextToken:ListFleetMetrics' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFleetMetrics' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise @null@ to receive the first set of results.
listFleetMetrics_nextToken :: Lens.Lens' ListFleetMetrics (Prelude.Maybe Prelude.Text)
listFleetMetrics_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFleetMetrics -> f ListFleetMetrics
listFleetMetrics_nextToken = (ListFleetMetrics -> Maybe Text)
-> (ListFleetMetrics -> Maybe Text -> ListFleetMetrics)
-> Lens ListFleetMetrics ListFleetMetrics (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleetMetrics' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFleetMetrics' :: ListFleetMetrics -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFleetMetrics
s@ListFleetMetrics' {} Maybe Text
a -> ListFleetMetrics
s {$sel:nextToken:ListFleetMetrics' :: Maybe Text
nextToken = Maybe Text
a} :: ListFleetMetrics)

-- | The maximum number of results to return in this operation.
listFleetMetrics_maxResults :: Lens.Lens' ListFleetMetrics (Prelude.Maybe Prelude.Natural)
listFleetMetrics_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListFleetMetrics -> f ListFleetMetrics
listFleetMetrics_maxResults = (ListFleetMetrics -> Maybe Natural)
-> (ListFleetMetrics -> Maybe Natural -> ListFleetMetrics)
-> Lens
     ListFleetMetrics ListFleetMetrics (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleetMetrics' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFleetMetrics' :: ListFleetMetrics -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFleetMetrics
s@ListFleetMetrics' {} Maybe Natural
a -> ListFleetMetrics
s {$sel:maxResults:ListFleetMetrics' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFleetMetrics)

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

instance Prelude.NFData ListFleetMetrics

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

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

instance Core.ToQuery ListFleetMetrics where
  toQuery :: ListFleetMetrics -> QueryString
toQuery ListFleetMetrics' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListFleetMetrics' :: ListFleetMetrics -> Maybe Natural
$sel:nextToken:ListFleetMetrics' :: ListFleetMetrics -> 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:/ 'newListFleetMetricsResponse' smart constructor.
data ListFleetMetricsResponse = ListFleetMetricsResponse'
  { -- | The list of fleet metrics objects.
    ListFleetMetricsResponse -> Maybe [FleetMetricNameAndArn]
fleetMetrics :: Prelude.Maybe [FleetMetricNameAndArn],
    -- | The token for the next set of results. Will not be returned if the
    -- operation has returned all results.
    ListFleetMetricsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFleetMetricsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFleetMetricsResponse -> ListFleetMetricsResponse -> Bool
(ListFleetMetricsResponse -> ListFleetMetricsResponse -> Bool)
-> (ListFleetMetricsResponse -> ListFleetMetricsResponse -> Bool)
-> Eq ListFleetMetricsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFleetMetricsResponse -> ListFleetMetricsResponse -> Bool
$c/= :: ListFleetMetricsResponse -> ListFleetMetricsResponse -> Bool
== :: ListFleetMetricsResponse -> ListFleetMetricsResponse -> Bool
$c== :: ListFleetMetricsResponse -> ListFleetMetricsResponse -> Bool
Prelude.Eq, ReadPrec [ListFleetMetricsResponse]
ReadPrec ListFleetMetricsResponse
Int -> ReadS ListFleetMetricsResponse
ReadS [ListFleetMetricsResponse]
(Int -> ReadS ListFleetMetricsResponse)
-> ReadS [ListFleetMetricsResponse]
-> ReadPrec ListFleetMetricsResponse
-> ReadPrec [ListFleetMetricsResponse]
-> Read ListFleetMetricsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFleetMetricsResponse]
$creadListPrec :: ReadPrec [ListFleetMetricsResponse]
readPrec :: ReadPrec ListFleetMetricsResponse
$creadPrec :: ReadPrec ListFleetMetricsResponse
readList :: ReadS [ListFleetMetricsResponse]
$creadList :: ReadS [ListFleetMetricsResponse]
readsPrec :: Int -> ReadS ListFleetMetricsResponse
$creadsPrec :: Int -> ReadS ListFleetMetricsResponse
Prelude.Read, Int -> ListFleetMetricsResponse -> ShowS
[ListFleetMetricsResponse] -> ShowS
ListFleetMetricsResponse -> String
(Int -> ListFleetMetricsResponse -> ShowS)
-> (ListFleetMetricsResponse -> String)
-> ([ListFleetMetricsResponse] -> ShowS)
-> Show ListFleetMetricsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFleetMetricsResponse] -> ShowS
$cshowList :: [ListFleetMetricsResponse] -> ShowS
show :: ListFleetMetricsResponse -> String
$cshow :: ListFleetMetricsResponse -> String
showsPrec :: Int -> ListFleetMetricsResponse -> ShowS
$cshowsPrec :: Int -> ListFleetMetricsResponse -> ShowS
Prelude.Show, (forall x.
 ListFleetMetricsResponse -> Rep ListFleetMetricsResponse x)
-> (forall x.
    Rep ListFleetMetricsResponse x -> ListFleetMetricsResponse)
-> Generic ListFleetMetricsResponse
forall x.
Rep ListFleetMetricsResponse x -> ListFleetMetricsResponse
forall x.
ListFleetMetricsResponse -> Rep ListFleetMetricsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFleetMetricsResponse x -> ListFleetMetricsResponse
$cfrom :: forall x.
ListFleetMetricsResponse -> Rep ListFleetMetricsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFleetMetricsResponse' 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:
--
-- 'fleetMetrics', 'listFleetMetricsResponse_fleetMetrics' - The list of fleet metrics objects.
--
-- 'nextToken', 'listFleetMetricsResponse_nextToken' - The token for the next set of results. Will not be returned if the
-- operation has returned all results.
--
-- 'httpStatus', 'listFleetMetricsResponse_httpStatus' - The response's http status code.
newListFleetMetricsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFleetMetricsResponse
newListFleetMetricsResponse :: Int -> ListFleetMetricsResponse
newListFleetMetricsResponse Int
pHttpStatus_ =
  ListFleetMetricsResponse' :: Maybe [FleetMetricNameAndArn]
-> Maybe Text -> Int -> ListFleetMetricsResponse
ListFleetMetricsResponse'
    { $sel:fleetMetrics:ListFleetMetricsResponse' :: Maybe [FleetMetricNameAndArn]
fleetMetrics =
        Maybe [FleetMetricNameAndArn]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFleetMetricsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFleetMetricsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of fleet metrics objects.
listFleetMetricsResponse_fleetMetrics :: Lens.Lens' ListFleetMetricsResponse (Prelude.Maybe [FleetMetricNameAndArn])
listFleetMetricsResponse_fleetMetrics :: (Maybe [FleetMetricNameAndArn]
 -> f (Maybe [FleetMetricNameAndArn]))
-> ListFleetMetricsResponse -> f ListFleetMetricsResponse
listFleetMetricsResponse_fleetMetrics = (ListFleetMetricsResponse -> Maybe [FleetMetricNameAndArn])
-> (ListFleetMetricsResponse
    -> Maybe [FleetMetricNameAndArn] -> ListFleetMetricsResponse)
-> Lens' ListFleetMetricsResponse (Maybe [FleetMetricNameAndArn])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleetMetricsResponse' {Maybe [FleetMetricNameAndArn]
fleetMetrics :: Maybe [FleetMetricNameAndArn]
$sel:fleetMetrics:ListFleetMetricsResponse' :: ListFleetMetricsResponse -> Maybe [FleetMetricNameAndArn]
fleetMetrics} -> Maybe [FleetMetricNameAndArn]
fleetMetrics) (\s :: ListFleetMetricsResponse
s@ListFleetMetricsResponse' {} Maybe [FleetMetricNameAndArn]
a -> ListFleetMetricsResponse
s {$sel:fleetMetrics:ListFleetMetricsResponse' :: Maybe [FleetMetricNameAndArn]
fleetMetrics = Maybe [FleetMetricNameAndArn]
a} :: ListFleetMetricsResponse) ((Maybe [FleetMetricNameAndArn]
  -> f (Maybe [FleetMetricNameAndArn]))
 -> ListFleetMetricsResponse -> f ListFleetMetricsResponse)
-> ((Maybe [FleetMetricNameAndArn]
     -> f (Maybe [FleetMetricNameAndArn]))
    -> Maybe [FleetMetricNameAndArn]
    -> f (Maybe [FleetMetricNameAndArn]))
-> (Maybe [FleetMetricNameAndArn]
    -> f (Maybe [FleetMetricNameAndArn]))
-> ListFleetMetricsResponse
-> f ListFleetMetricsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FleetMetricNameAndArn]
  [FleetMetricNameAndArn]
  [FleetMetricNameAndArn]
  [FleetMetricNameAndArn]
-> Iso
     (Maybe [FleetMetricNameAndArn])
     (Maybe [FleetMetricNameAndArn])
     (Maybe [FleetMetricNameAndArn])
     (Maybe [FleetMetricNameAndArn])
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
  [FleetMetricNameAndArn]
  [FleetMetricNameAndArn]
  [FleetMetricNameAndArn]
  [FleetMetricNameAndArn]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results. Will not be returned if the
-- operation has returned all results.
listFleetMetricsResponse_nextToken :: Lens.Lens' ListFleetMetricsResponse (Prelude.Maybe Prelude.Text)
listFleetMetricsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFleetMetricsResponse -> f ListFleetMetricsResponse
listFleetMetricsResponse_nextToken = (ListFleetMetricsResponse -> Maybe Text)
-> (ListFleetMetricsResponse
    -> Maybe Text -> ListFleetMetricsResponse)
-> Lens' ListFleetMetricsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleetMetricsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFleetMetricsResponse' :: ListFleetMetricsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFleetMetricsResponse
s@ListFleetMetricsResponse' {} Maybe Text
a -> ListFleetMetricsResponse
s {$sel:nextToken:ListFleetMetricsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFleetMetricsResponse)

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

instance Prelude.NFData ListFleetMetricsResponse