{-# 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.ListForecasts
-- 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 forecasts created using the CreateForecast operation.
-- For each forecast, this operation returns a summary of its properties,
-- including its Amazon Resource Name (ARN). To retrieve the complete set
-- of properties, specify the ARN with the DescribeForecast operation. You
-- can filter the list using an array of Filter objects.
--
-- This operation returns paginated results.
module Amazonka.Forecast.ListForecasts
  ( -- * Creating a Request
    ListForecasts (..),
    newListForecasts,

    -- * Request Lenses
    listForecasts_filters,
    listForecasts_maxResults,
    listForecasts_nextToken,

    -- * Destructuring the Response
    ListForecastsResponse (..),
    newListForecastsResponse,

    -- * Response Lenses
    listForecastsResponse_forecasts,
    listForecastsResponse_nextToken,
    listForecastsResponse_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:/ 'newListForecasts' smart constructor.
data ListForecasts = ListForecasts'
  { -- | An array of filters. For each filter, you provide a condition and a
    -- match statement. The condition is either @IS@ or @IS_NOT@, which
    -- specifies whether to include or exclude the forecasts that match the
    -- statement from the list, respectively. The match statement consists of a
    -- key and a value.
    --
    -- __Filter properties__
    --
    -- -   @Condition@ - The condition to apply. Valid values are @IS@ and
    --     @IS_NOT@. To include the forecasts that match the statement, specify
    --     @IS@. To exclude matching forecasts, specify @IS_NOT@.
    --
    -- -   @Key@ - The name of the parameter to filter on. Valid values are
    --     @DatasetGroupArn@, @PredictorArn@, and @Status@.
    --
    -- -   @Value@ - The value to match.
    --
    -- For example, to list all forecasts whose status is not ACTIVE, you would
    -- specify:
    --
    -- @\"Filters\": [ { \"Condition\": \"IS_NOT\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
    ListForecasts -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The number of items to return in the response.
    ListForecasts -> 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.
    ListForecasts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListForecasts -> ListForecasts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListForecasts -> ListForecasts -> Bool
$c/= :: ListForecasts -> ListForecasts -> Bool
== :: ListForecasts -> ListForecasts -> Bool
$c== :: ListForecasts -> ListForecasts -> Bool
Prelude.Eq, ReadPrec [ListForecasts]
ReadPrec ListForecasts
Int -> ReadS ListForecasts
ReadS [ListForecasts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListForecasts]
$creadListPrec :: ReadPrec [ListForecasts]
readPrec :: ReadPrec ListForecasts
$creadPrec :: ReadPrec ListForecasts
readList :: ReadS [ListForecasts]
$creadList :: ReadS [ListForecasts]
readsPrec :: Int -> ReadS ListForecasts
$creadsPrec :: Int -> ReadS ListForecasts
Prelude.Read, Int -> ListForecasts -> ShowS
[ListForecasts] -> ShowS
ListForecasts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListForecasts] -> ShowS
$cshowList :: [ListForecasts] -> ShowS
show :: ListForecasts -> String
$cshow :: ListForecasts -> String
showsPrec :: Int -> ListForecasts -> ShowS
$cshowsPrec :: Int -> ListForecasts -> ShowS
Prelude.Show, forall x. Rep ListForecasts x -> ListForecasts
forall x. ListForecasts -> Rep ListForecasts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListForecasts x -> ListForecasts
$cfrom :: forall x. ListForecasts -> Rep ListForecasts x
Prelude.Generic)

-- |
-- Create a value of 'ListForecasts' 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', 'listForecasts_filters' - An array of filters. For each filter, you provide a condition and a
-- match statement. The condition is either @IS@ or @IS_NOT@, which
-- specifies whether to include or exclude the forecasts that match the
-- statement from the list, respectively. The match statement consists of a
-- key and a value.
--
-- __Filter properties__
--
-- -   @Condition@ - The condition to apply. Valid values are @IS@ and
--     @IS_NOT@. To include the forecasts that match the statement, specify
--     @IS@. To exclude matching forecasts, specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @DatasetGroupArn@, @PredictorArn@, and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all forecasts whose status is not ACTIVE, you would
-- specify:
--
-- @\"Filters\": [ { \"Condition\": \"IS_NOT\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
--
-- 'maxResults', 'listForecasts_maxResults' - The number of items to return in the response.
--
-- 'nextToken', 'listForecasts_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.
newListForecasts ::
  ListForecasts
newListForecasts :: ListForecasts
newListForecasts =
  ListForecasts'
    { $sel:filters:ListForecasts' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListForecasts' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListForecasts' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | An array of filters. For each filter, you provide a condition and a
-- match statement. The condition is either @IS@ or @IS_NOT@, which
-- specifies whether to include or exclude the forecasts that match the
-- statement from the list, respectively. The match statement consists of a
-- key and a value.
--
-- __Filter properties__
--
-- -   @Condition@ - The condition to apply. Valid values are @IS@ and
--     @IS_NOT@. To include the forecasts that match the statement, specify
--     @IS@. To exclude matching forecasts, specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @DatasetGroupArn@, @PredictorArn@, and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all forecasts whose status is not ACTIVE, you would
-- specify:
--
-- @\"Filters\": [ { \"Condition\": \"IS_NOT\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
listForecasts_filters :: Lens.Lens' ListForecasts (Prelude.Maybe [Filter])
listForecasts_filters :: Lens' ListForecasts (Maybe [Filter])
listForecasts_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecasts' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListForecasts' :: ListForecasts -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListForecasts
s@ListForecasts' {} Maybe [Filter]
a -> ListForecasts
s {$sel:filters:ListForecasts' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListForecasts) 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 number of items to return in the response.
listForecasts_maxResults :: Lens.Lens' ListForecasts (Prelude.Maybe Prelude.Natural)
listForecasts_maxResults :: Lens' ListForecasts (Maybe Natural)
listForecasts_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecasts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListForecasts' :: ListForecasts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListForecasts
s@ListForecasts' {} Maybe Natural
a -> ListForecasts
s {$sel:maxResults:ListForecasts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListForecasts)

-- | 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.
listForecasts_nextToken :: Lens.Lens' ListForecasts (Prelude.Maybe Prelude.Text)
listForecasts_nextToken :: Lens' ListForecasts (Maybe Text)
listForecasts_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecasts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListForecasts' :: ListForecasts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListForecasts
s@ListForecasts' {} Maybe Text
a -> ListForecasts
s {$sel:nextToken:ListForecasts' :: Maybe Text
nextToken = Maybe Text
a} :: ListForecasts)

instance Core.AWSPager ListForecasts where
  page :: ListForecasts -> AWSResponse ListForecasts -> Maybe ListForecasts
page ListForecasts
rq AWSResponse ListForecasts
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListForecasts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListForecastsResponse (Maybe Text)
listForecastsResponse_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 ListForecasts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListForecastsResponse (Maybe [ForecastSummary])
listForecastsResponse_forecasts
            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.$ ListForecasts
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListForecasts (Maybe Text)
listForecasts_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListForecasts
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListForecastsResponse (Maybe Text)
listForecastsResponse_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 ListForecasts where
  type
    AWSResponse ListForecasts =
      ListForecastsResponse
  request :: (Service -> Service) -> ListForecasts -> Request ListForecasts
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 ListForecasts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListForecasts)))
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 [ForecastSummary]
-> Maybe Text -> Int -> ListForecastsResponse
ListForecastsResponse'
            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
"Forecasts" 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 ListForecasts where
  hashWithSalt :: Int -> ListForecasts -> Int
hashWithSalt Int
_salt ListForecasts' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListForecasts' :: ListForecasts -> Maybe Text
$sel:maxResults:ListForecasts' :: ListForecasts -> Maybe Natural
$sel:filters:ListForecasts' :: ListForecasts -> 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 ListForecasts where
  rnf :: ListForecasts -> ()
rnf ListForecasts' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListForecasts' :: ListForecasts -> Maybe Text
$sel:maxResults:ListForecasts' :: ListForecasts -> Maybe Natural
$sel:filters:ListForecasts' :: ListForecasts -> 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 ListForecasts where
  toHeaders :: ListForecasts -> 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.ListForecasts" ::
                          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 ListForecasts where
  toJSON :: ListForecasts -> Value
toJSON ListForecasts' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListForecasts' :: ListForecasts -> Maybe Text
$sel:maxResults:ListForecasts' :: ListForecasts -> Maybe Natural
$sel:filters:ListForecasts' :: ListForecasts -> 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 ListForecasts where
  toPath :: ListForecasts -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'ListForecastsResponse' 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:
--
-- 'forecasts', 'listForecastsResponse_forecasts' - An array of objects that summarize each forecast\'s properties.
--
-- 'nextToken', 'listForecastsResponse_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', 'listForecastsResponse_httpStatus' - The response's http status code.
newListForecastsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListForecastsResponse
newListForecastsResponse :: Int -> ListForecastsResponse
newListForecastsResponse Int
pHttpStatus_ =
  ListForecastsResponse'
    { $sel:forecasts:ListForecastsResponse' :: Maybe [ForecastSummary]
forecasts = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListForecastsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListForecastsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of objects that summarize each forecast\'s properties.
listForecastsResponse_forecasts :: Lens.Lens' ListForecastsResponse (Prelude.Maybe [ForecastSummary])
listForecastsResponse_forecasts :: Lens' ListForecastsResponse (Maybe [ForecastSummary])
listForecastsResponse_forecasts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecastsResponse' {Maybe [ForecastSummary]
forecasts :: Maybe [ForecastSummary]
$sel:forecasts:ListForecastsResponse' :: ListForecastsResponse -> Maybe [ForecastSummary]
forecasts} -> Maybe [ForecastSummary]
forecasts) (\s :: ListForecastsResponse
s@ListForecastsResponse' {} Maybe [ForecastSummary]
a -> ListForecastsResponse
s {$sel:forecasts:ListForecastsResponse' :: Maybe [ForecastSummary]
forecasts = Maybe [ForecastSummary]
a} :: ListForecastsResponse) 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.
listForecastsResponse_nextToken :: Lens.Lens' ListForecastsResponse (Prelude.Maybe Prelude.Text)
listForecastsResponse_nextToken :: Lens' ListForecastsResponse (Maybe Text)
listForecastsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecastsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListForecastsResponse' :: ListForecastsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListForecastsResponse
s@ListForecastsResponse' {} Maybe Text
a -> ListForecastsResponse
s {$sel:nextToken:ListForecastsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListForecastsResponse)

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

instance Prelude.NFData ListForecastsResponse where
  rnf :: ListForecastsResponse -> ()
rnf ListForecastsResponse' {Int
Maybe [ForecastSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
forecasts :: Maybe [ForecastSummary]
$sel:httpStatus:ListForecastsResponse' :: ListForecastsResponse -> Int
$sel:nextToken:ListForecastsResponse' :: ListForecastsResponse -> Maybe Text
$sel:forecasts:ListForecastsResponse' :: ListForecastsResponse -> Maybe [ForecastSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ForecastSummary]
forecasts
      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