{-# 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.Forecast.ListMonitors
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of monitors created with the CreateMonitor operation and
-- CreateAutoPredictor operation. For each monitor resource, this operation
-- returns of a summary of its properties, including its Amazon Resource
-- Name (ARN). You can retrieve a complete set of properties of a monitor
-- resource by specify the monitor\'s ARN in the DescribeMonitor operation.
--
-- This operation returns paginated results.
module Amazonka.Forecast.ListMonitors
  ( -- * Creating a Request
    ListMonitors (..),
    newListMonitors,

    -- * Request Lenses
    listMonitors_filters,
    listMonitors_maxResults,
    listMonitors_nextToken,

    -- * Destructuring the Response
    ListMonitorsResponse (..),
    newListMonitorsResponse,

    -- * Response Lenses
    listMonitorsResponse_monitors,
    listMonitorsResponse_nextToken,
    listMonitorsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Forecast.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListMonitors' smart constructor.
data ListMonitors = ListMonitors'
  { -- | An array of filters. For each filter, provide a condition and a match
    -- statement. The condition is either @IS@ or @IS_NOT@, which specifies
    -- whether to include or exclude the resources that match the statement
    -- from the list. The match statement consists of a key and a value.
    --
    -- __Filter properties__
    --
    -- -   @Condition@ - The condition to apply. Valid values are @IS@ and
    --     @IS_NOT@.
    --
    -- -   @Key@ - The name of the parameter to filter on. The only valid value
    --     is @Status@.
    --
    -- -   @Value@ - The value to match.
    --
    -- For example, to list all monitors who\'s status is ACTIVE, you would
    -- specify:
    --
    -- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
    ListMonitors -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of monitors to include in the response.
    ListMonitors -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the result of the previous request was truncated, the response
    -- includes a @NextToken@. To retrieve the next set of results, use the
    -- token in the next request. Tokens expire after 24 hours.
    ListMonitors -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListMonitors -> ListMonitors -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMonitors -> ListMonitors -> Bool
$c/= :: ListMonitors -> ListMonitors -> Bool
== :: ListMonitors -> ListMonitors -> Bool
$c== :: ListMonitors -> ListMonitors -> Bool
Prelude.Eq, ReadPrec [ListMonitors]
ReadPrec ListMonitors
Int -> ReadS ListMonitors
ReadS [ListMonitors]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMonitors]
$creadListPrec :: ReadPrec [ListMonitors]
readPrec :: ReadPrec ListMonitors
$creadPrec :: ReadPrec ListMonitors
readList :: ReadS [ListMonitors]
$creadList :: ReadS [ListMonitors]
readsPrec :: Int -> ReadS ListMonitors
$creadsPrec :: Int -> ReadS ListMonitors
Prelude.Read, Int -> ListMonitors -> ShowS
[ListMonitors] -> ShowS
ListMonitors -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMonitors] -> ShowS
$cshowList :: [ListMonitors] -> ShowS
show :: ListMonitors -> String
$cshow :: ListMonitors -> String
showsPrec :: Int -> ListMonitors -> ShowS
$cshowsPrec :: Int -> ListMonitors -> ShowS
Prelude.Show, forall x. Rep ListMonitors x -> ListMonitors
forall x. ListMonitors -> Rep ListMonitors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMonitors x -> ListMonitors
$cfrom :: forall x. ListMonitors -> Rep ListMonitors x
Prelude.Generic)

-- |
-- Create a value of 'ListMonitors' 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:
--
-- 'filters', 'listMonitors_filters' - An array of filters. For each filter, provide a condition and a match
-- statement. The condition is either @IS@ or @IS_NOT@, which specifies
-- whether to include or exclude the resources that match the statement
-- from the list. The match statement consists of a key and a value.
--
-- __Filter properties__
--
-- -   @Condition@ - The condition to apply. Valid values are @IS@ and
--     @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. The only valid value
--     is @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all monitors who\'s status is ACTIVE, you would
-- specify:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
--
-- 'maxResults', 'listMonitors_maxResults' - The maximum number of monitors to include in the response.
--
-- 'nextToken', 'listMonitors_nextToken' - If the result of the previous request was truncated, the response
-- includes a @NextToken@. To retrieve the next set of results, use the
-- token in the next request. Tokens expire after 24 hours.
newListMonitors ::
  ListMonitors
newListMonitors :: ListMonitors
newListMonitors =
  ListMonitors'
    { $sel:filters:ListMonitors' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListMonitors' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListMonitors' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | An array of filters. For each filter, provide a condition and a match
-- statement. The condition is either @IS@ or @IS_NOT@, which specifies
-- whether to include or exclude the resources that match the statement
-- from the list. The match statement consists of a key and a value.
--
-- __Filter properties__
--
-- -   @Condition@ - The condition to apply. Valid values are @IS@ and
--     @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. The only valid value
--     is @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all monitors who\'s status is ACTIVE, you would
-- specify:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
listMonitors_filters :: Lens.Lens' ListMonitors (Prelude.Maybe [Filter])
listMonitors_filters :: Lens' ListMonitors (Maybe [Filter])
listMonitors_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMonitors' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListMonitors' :: ListMonitors -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListMonitors
s@ListMonitors' {} Maybe [Filter]
a -> ListMonitors
s {$sel:filters:ListMonitors' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListMonitors) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of monitors to include in the response.
listMonitors_maxResults :: Lens.Lens' ListMonitors (Prelude.Maybe Prelude.Natural)
listMonitors_maxResults :: Lens' ListMonitors (Maybe Natural)
listMonitors_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMonitors' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListMonitors' :: ListMonitors -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListMonitors
s@ListMonitors' {} Maybe Natural
a -> ListMonitors
s {$sel:maxResults:ListMonitors' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListMonitors)

-- | If the result of the previous request was truncated, the response
-- includes a @NextToken@. To retrieve the next set of results, use the
-- token in the next request. Tokens expire after 24 hours.
listMonitors_nextToken :: Lens.Lens' ListMonitors (Prelude.Maybe Prelude.Text)
listMonitors_nextToken :: Lens' ListMonitors (Maybe Text)
listMonitors_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMonitors' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMonitors' :: ListMonitors -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMonitors
s@ListMonitors' {} Maybe Text
a -> ListMonitors
s {$sel:nextToken:ListMonitors' :: Maybe Text
nextToken = Maybe Text
a} :: ListMonitors)

instance Core.AWSPager ListMonitors where
  page :: ListMonitors -> AWSResponse ListMonitors -> Maybe ListMonitors
page ListMonitors
rq AWSResponse ListMonitors
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMonitors
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListMonitorsResponse (Maybe Text)
listMonitorsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMonitors
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListMonitorsResponse (Maybe [MonitorSummary])
listMonitorsResponse_monitors
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListMonitors
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListMonitors (Maybe Text)
listMonitors_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListMonitors
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListMonitorsResponse (Maybe Text)
listMonitorsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListMonitors where
  type AWSResponse ListMonitors = ListMonitorsResponse
  request :: (Service -> Service) -> ListMonitors -> Request ListMonitors
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListMonitors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListMonitors)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [MonitorSummary] -> Maybe Text -> Int -> ListMonitorsResponse
ListMonitorsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Monitors" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListMonitors where
  hashWithSalt :: Int -> ListMonitors -> Int
hashWithSalt Int
_salt ListMonitors' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListMonitors' :: ListMonitors -> Maybe Text
$sel:maxResults:ListMonitors' :: ListMonitors -> Maybe Natural
$sel:filters:ListMonitors' :: ListMonitors -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListMonitors where
  rnf :: ListMonitors -> ()
rnf ListMonitors' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListMonitors' :: ListMonitors -> Maybe Text
$sel:maxResults:ListMonitors' :: ListMonitors -> Maybe Natural
$sel:filters:ListMonitors' :: ListMonitors -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders ListMonitors where
  toHeaders :: ListMonitors -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonForecast.ListMonitors" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListMonitors where
  toJSON :: ListMonitors -> Value
toJSON ListMonitors' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListMonitors' :: ListMonitors -> Maybe Text
$sel:maxResults:ListMonitors' :: ListMonitors -> Maybe Natural
$sel:filters:ListMonitors' :: ListMonitors -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

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

-- | /See:/ 'newListMonitorsResponse' smart constructor.
data ListMonitorsResponse = ListMonitorsResponse'
  { -- | An array of objects that summarize each monitor\'s properties.
    ListMonitorsResponse -> Maybe [MonitorSummary]
monitors :: Prelude.Maybe [MonitorSummary],
    -- | If the response is truncated, Amazon Forecast returns this token. To
    -- retrieve the next set of results, use the token in the next request.
    ListMonitorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListMonitorsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListMonitorsResponse -> ListMonitorsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMonitorsResponse -> ListMonitorsResponse -> Bool
$c/= :: ListMonitorsResponse -> ListMonitorsResponse -> Bool
== :: ListMonitorsResponse -> ListMonitorsResponse -> Bool
$c== :: ListMonitorsResponse -> ListMonitorsResponse -> Bool
Prelude.Eq, ReadPrec [ListMonitorsResponse]
ReadPrec ListMonitorsResponse
Int -> ReadS ListMonitorsResponse
ReadS [ListMonitorsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMonitorsResponse]
$creadListPrec :: ReadPrec [ListMonitorsResponse]
readPrec :: ReadPrec ListMonitorsResponse
$creadPrec :: ReadPrec ListMonitorsResponse
readList :: ReadS [ListMonitorsResponse]
$creadList :: ReadS [ListMonitorsResponse]
readsPrec :: Int -> ReadS ListMonitorsResponse
$creadsPrec :: Int -> ReadS ListMonitorsResponse
Prelude.Read, Int -> ListMonitorsResponse -> ShowS
[ListMonitorsResponse] -> ShowS
ListMonitorsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMonitorsResponse] -> ShowS
$cshowList :: [ListMonitorsResponse] -> ShowS
show :: ListMonitorsResponse -> String
$cshow :: ListMonitorsResponse -> String
showsPrec :: Int -> ListMonitorsResponse -> ShowS
$cshowsPrec :: Int -> ListMonitorsResponse -> ShowS
Prelude.Show, forall x. Rep ListMonitorsResponse x -> ListMonitorsResponse
forall x. ListMonitorsResponse -> Rep ListMonitorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMonitorsResponse x -> ListMonitorsResponse
$cfrom :: forall x. ListMonitorsResponse -> Rep ListMonitorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListMonitorsResponse' 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:
--
-- 'monitors', 'listMonitorsResponse_monitors' - An array of objects that summarize each monitor\'s properties.
--
-- 'nextToken', 'listMonitorsResponse_nextToken' - If the response is truncated, Amazon Forecast returns this token. To
-- retrieve the next set of results, use the token in the next request.
--
-- 'httpStatus', 'listMonitorsResponse_httpStatus' - The response's http status code.
newListMonitorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListMonitorsResponse
newListMonitorsResponse :: Int -> ListMonitorsResponse
newListMonitorsResponse Int
pHttpStatus_ =
  ListMonitorsResponse'
    { $sel:monitors:ListMonitorsResponse' :: Maybe [MonitorSummary]
monitors = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListMonitorsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListMonitorsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of objects that summarize each monitor\'s properties.
listMonitorsResponse_monitors :: Lens.Lens' ListMonitorsResponse (Prelude.Maybe [MonitorSummary])
listMonitorsResponse_monitors :: Lens' ListMonitorsResponse (Maybe [MonitorSummary])
listMonitorsResponse_monitors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMonitorsResponse' {Maybe [MonitorSummary]
monitors :: Maybe [MonitorSummary]
$sel:monitors:ListMonitorsResponse' :: ListMonitorsResponse -> Maybe [MonitorSummary]
monitors} -> Maybe [MonitorSummary]
monitors) (\s :: ListMonitorsResponse
s@ListMonitorsResponse' {} Maybe [MonitorSummary]
a -> ListMonitorsResponse
s {$sel:monitors:ListMonitorsResponse' :: Maybe [MonitorSummary]
monitors = Maybe [MonitorSummary]
a} :: ListMonitorsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response is truncated, Amazon Forecast returns this token. To
-- retrieve the next set of results, use the token in the next request.
listMonitorsResponse_nextToken :: Lens.Lens' ListMonitorsResponse (Prelude.Maybe Prelude.Text)
listMonitorsResponse_nextToken :: Lens' ListMonitorsResponse (Maybe Text)
listMonitorsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMonitorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMonitorsResponse' :: ListMonitorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMonitorsResponse
s@ListMonitorsResponse' {} Maybe Text
a -> ListMonitorsResponse
s {$sel:nextToken:ListMonitorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListMonitorsResponse)

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

instance Prelude.NFData ListMonitorsResponse where
  rnf :: ListMonitorsResponse -> ()
rnf ListMonitorsResponse' {Int
Maybe [MonitorSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
monitors :: Maybe [MonitorSummary]
$sel:httpStatus:ListMonitorsResponse' :: ListMonitorsResponse -> Int
$sel:nextToken:ListMonitorsResponse' :: ListMonitorsResponse -> Maybe Text
$sel:monitors:ListMonitorsResponse' :: ListMonitorsResponse -> Maybe [MonitorSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [MonitorSummary]
monitors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus