{-# 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.ListWhatIfForecasts
-- 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 what-if forecasts created using the
-- CreateWhatIfForecast operation. For each what-if forecast, this
-- operation returns a summary of its properties, including its Amazon
-- Resource Name (ARN). You can retrieve the complete set of properties by
-- using the what-if forecast ARN with the DescribeWhatIfForecast
-- operation.
--
-- This operation returns paginated results.
module Amazonka.Forecast.ListWhatIfForecasts
  ( -- * Creating a Request
    ListWhatIfForecasts (..),
    newListWhatIfForecasts,

    -- * Request Lenses
    listWhatIfForecasts_filters,
    listWhatIfForecasts_maxResults,
    listWhatIfForecasts_nextToken,

    -- * Destructuring the Response
    ListWhatIfForecastsResponse (..),
    newListWhatIfForecastsResponse,

    -- * Response Lenses
    listWhatIfForecastsResponse_nextToken,
    listWhatIfForecastsResponse_whatIfForecasts,
    listWhatIfForecastsResponse_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:/ 'newListWhatIfForecasts' smart constructor.
data ListWhatIfForecasts = ListWhatIfForecasts'
  { -- | 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 what-if forecast export jobs
    -- 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 forecast export jobs that match the
    --     statement, specify @IS@. To exclude matching forecast export jobs,
    --     specify @IS_NOT@.
    --
    -- -   @Key@ - The name of the parameter to filter on. Valid values are
    --     @WhatIfForecastArn@ and @Status@.
    --
    -- -   @Value@ - The value to match.
    --
    -- For example, to list all jobs that export a forecast named
    -- /electricityWhatIfForecast/, specify the following filter:
    --
    -- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"WhatIfForecastArn\", \"Value\": \"arn:aws:forecast:us-west-2:\<acct-id>:forecast\/electricityWhatIfForecast\" } ]@
    ListWhatIfForecasts -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The number of items to return in the response.
    ListWhatIfForecasts -> 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.
    ListWhatIfForecasts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListWhatIfForecasts -> ListWhatIfForecasts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWhatIfForecasts -> ListWhatIfForecasts -> Bool
$c/= :: ListWhatIfForecasts -> ListWhatIfForecasts -> Bool
== :: ListWhatIfForecasts -> ListWhatIfForecasts -> Bool
$c== :: ListWhatIfForecasts -> ListWhatIfForecasts -> Bool
Prelude.Eq, ReadPrec [ListWhatIfForecasts]
ReadPrec ListWhatIfForecasts
Int -> ReadS ListWhatIfForecasts
ReadS [ListWhatIfForecasts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWhatIfForecasts]
$creadListPrec :: ReadPrec [ListWhatIfForecasts]
readPrec :: ReadPrec ListWhatIfForecasts
$creadPrec :: ReadPrec ListWhatIfForecasts
readList :: ReadS [ListWhatIfForecasts]
$creadList :: ReadS [ListWhatIfForecasts]
readsPrec :: Int -> ReadS ListWhatIfForecasts
$creadsPrec :: Int -> ReadS ListWhatIfForecasts
Prelude.Read, Int -> ListWhatIfForecasts -> ShowS
[ListWhatIfForecasts] -> ShowS
ListWhatIfForecasts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWhatIfForecasts] -> ShowS
$cshowList :: [ListWhatIfForecasts] -> ShowS
show :: ListWhatIfForecasts -> String
$cshow :: ListWhatIfForecasts -> String
showsPrec :: Int -> ListWhatIfForecasts -> ShowS
$cshowsPrec :: Int -> ListWhatIfForecasts -> ShowS
Prelude.Show, forall x. Rep ListWhatIfForecasts x -> ListWhatIfForecasts
forall x. ListWhatIfForecasts -> Rep ListWhatIfForecasts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWhatIfForecasts x -> ListWhatIfForecasts
$cfrom :: forall x. ListWhatIfForecasts -> Rep ListWhatIfForecasts x
Prelude.Generic)

-- |
-- Create a value of 'ListWhatIfForecasts' 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', 'listWhatIfForecasts_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 what-if forecast export jobs
-- 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 forecast export jobs that match the
--     statement, specify @IS@. To exclude matching forecast export jobs,
--     specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @WhatIfForecastArn@ and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all jobs that export a forecast named
-- /electricityWhatIfForecast/, specify the following filter:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"WhatIfForecastArn\", \"Value\": \"arn:aws:forecast:us-west-2:\<acct-id>:forecast\/electricityWhatIfForecast\" } ]@
--
-- 'maxResults', 'listWhatIfForecasts_maxResults' - The number of items to return in the response.
--
-- 'nextToken', 'listWhatIfForecasts_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.
newListWhatIfForecasts ::
  ListWhatIfForecasts
newListWhatIfForecasts :: ListWhatIfForecasts
newListWhatIfForecasts =
  ListWhatIfForecasts'
    { $sel:filters:ListWhatIfForecasts' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListWhatIfForecasts' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWhatIfForecasts' :: 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 what-if forecast export jobs
-- 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 forecast export jobs that match the
--     statement, specify @IS@. To exclude matching forecast export jobs,
--     specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @WhatIfForecastArn@ and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all jobs that export a forecast named
-- /electricityWhatIfForecast/, specify the following filter:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"WhatIfForecastArn\", \"Value\": \"arn:aws:forecast:us-west-2:\<acct-id>:forecast\/electricityWhatIfForecast\" } ]@
listWhatIfForecasts_filters :: Lens.Lens' ListWhatIfForecasts (Prelude.Maybe [Filter])
listWhatIfForecasts_filters :: Lens' ListWhatIfForecasts (Maybe [Filter])
listWhatIfForecasts_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWhatIfForecasts' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListWhatIfForecasts
s@ListWhatIfForecasts' {} Maybe [Filter]
a -> ListWhatIfForecasts
s {$sel:filters:ListWhatIfForecasts' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListWhatIfForecasts) 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.
listWhatIfForecasts_maxResults :: Lens.Lens' ListWhatIfForecasts (Prelude.Maybe Prelude.Natural)
listWhatIfForecasts_maxResults :: Lens' ListWhatIfForecasts (Maybe Natural)
listWhatIfForecasts_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWhatIfForecasts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListWhatIfForecasts
s@ListWhatIfForecasts' {} Maybe Natural
a -> ListWhatIfForecasts
s {$sel:maxResults:ListWhatIfForecasts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListWhatIfForecasts)

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

instance Core.AWSPager ListWhatIfForecasts where
  page :: ListWhatIfForecasts
-> AWSResponse ListWhatIfForecasts -> Maybe ListWhatIfForecasts
page ListWhatIfForecasts
rq AWSResponse ListWhatIfForecasts
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListWhatIfForecasts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListWhatIfForecastsResponse (Maybe Text)
listWhatIfForecastsResponse_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 ListWhatIfForecasts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListWhatIfForecastsResponse (Maybe [WhatIfForecastSummary])
listWhatIfForecastsResponse_whatIfForecasts
            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.$ ListWhatIfForecasts
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListWhatIfForecasts (Maybe Text)
listWhatIfForecasts_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListWhatIfForecasts
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListWhatIfForecastsResponse (Maybe Text)
listWhatIfForecastsResponse_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 ListWhatIfForecasts where
  type
    AWSResponse ListWhatIfForecasts =
      ListWhatIfForecastsResponse
  request :: (Service -> Service)
-> ListWhatIfForecasts -> Request ListWhatIfForecasts
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 ListWhatIfForecasts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListWhatIfForecasts)))
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 Text
-> Maybe [WhatIfForecastSummary]
-> Int
-> ListWhatIfForecastsResponse
ListWhatIfForecastsResponse'
            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
"NextToken")
            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
"WhatIfForecasts"
                            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListWhatIfForecasts where
  hashWithSalt :: Int -> ListWhatIfForecasts -> Int
hashWithSalt Int
_salt ListWhatIfForecasts' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe Text
$sel:maxResults:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe Natural
$sel:filters:ListWhatIfForecasts' :: ListWhatIfForecasts -> 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 ListWhatIfForecasts where
  rnf :: ListWhatIfForecasts -> ()
rnf ListWhatIfForecasts' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe Text
$sel:maxResults:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe Natural
$sel:filters:ListWhatIfForecasts' :: ListWhatIfForecasts -> 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 ListWhatIfForecasts where
  toHeaders :: ListWhatIfForecasts -> 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.ListWhatIfForecasts" ::
                          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 ListWhatIfForecasts where
  toJSON :: ListWhatIfForecasts -> Value
toJSON ListWhatIfForecasts' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe Text
$sel:maxResults:ListWhatIfForecasts' :: ListWhatIfForecasts -> Maybe Natural
$sel:filters:ListWhatIfForecasts' :: ListWhatIfForecasts -> 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 ListWhatIfForecasts where
  toPath :: ListWhatIfForecasts -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListWhatIfForecastsResponse' smart constructor.
data ListWhatIfForecastsResponse = ListWhatIfForecastsResponse'
  { -- | 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.
    ListWhatIfForecastsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of @WhatIfForecasts@ objects that describe the matched
    -- forecasts.
    ListWhatIfForecastsResponse -> Maybe [WhatIfForecastSummary]
whatIfForecasts :: Prelude.Maybe [WhatIfForecastSummary],
    -- | The response's http status code.
    ListWhatIfForecastsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListWhatIfForecastsResponse -> ListWhatIfForecastsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWhatIfForecastsResponse -> ListWhatIfForecastsResponse -> Bool
$c/= :: ListWhatIfForecastsResponse -> ListWhatIfForecastsResponse -> Bool
== :: ListWhatIfForecastsResponse -> ListWhatIfForecastsResponse -> Bool
$c== :: ListWhatIfForecastsResponse -> ListWhatIfForecastsResponse -> Bool
Prelude.Eq, ReadPrec [ListWhatIfForecastsResponse]
ReadPrec ListWhatIfForecastsResponse
Int -> ReadS ListWhatIfForecastsResponse
ReadS [ListWhatIfForecastsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWhatIfForecastsResponse]
$creadListPrec :: ReadPrec [ListWhatIfForecastsResponse]
readPrec :: ReadPrec ListWhatIfForecastsResponse
$creadPrec :: ReadPrec ListWhatIfForecastsResponse
readList :: ReadS [ListWhatIfForecastsResponse]
$creadList :: ReadS [ListWhatIfForecastsResponse]
readsPrec :: Int -> ReadS ListWhatIfForecastsResponse
$creadsPrec :: Int -> ReadS ListWhatIfForecastsResponse
Prelude.Read, Int -> ListWhatIfForecastsResponse -> ShowS
[ListWhatIfForecastsResponse] -> ShowS
ListWhatIfForecastsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWhatIfForecastsResponse] -> ShowS
$cshowList :: [ListWhatIfForecastsResponse] -> ShowS
show :: ListWhatIfForecastsResponse -> String
$cshow :: ListWhatIfForecastsResponse -> String
showsPrec :: Int -> ListWhatIfForecastsResponse -> ShowS
$cshowsPrec :: Int -> ListWhatIfForecastsResponse -> ShowS
Prelude.Show, forall x.
Rep ListWhatIfForecastsResponse x -> ListWhatIfForecastsResponse
forall x.
ListWhatIfForecastsResponse -> Rep ListWhatIfForecastsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListWhatIfForecastsResponse x -> ListWhatIfForecastsResponse
$cfrom :: forall x.
ListWhatIfForecastsResponse -> Rep ListWhatIfForecastsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListWhatIfForecastsResponse' 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', 'listWhatIfForecastsResponse_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.
--
-- 'whatIfForecasts', 'listWhatIfForecastsResponse_whatIfForecasts' - An array of @WhatIfForecasts@ objects that describe the matched
-- forecasts.
--
-- 'httpStatus', 'listWhatIfForecastsResponse_httpStatus' - The response's http status code.
newListWhatIfForecastsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWhatIfForecastsResponse
newListWhatIfForecastsResponse :: Int -> ListWhatIfForecastsResponse
newListWhatIfForecastsResponse Int
pHttpStatus_ =
  ListWhatIfForecastsResponse'
    { $sel:nextToken:ListWhatIfForecastsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:whatIfForecasts:ListWhatIfForecastsResponse' :: Maybe [WhatIfForecastSummary]
whatIfForecasts = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWhatIfForecastsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of @WhatIfForecasts@ objects that describe the matched
-- forecasts.
listWhatIfForecastsResponse_whatIfForecasts :: Lens.Lens' ListWhatIfForecastsResponse (Prelude.Maybe [WhatIfForecastSummary])
listWhatIfForecastsResponse_whatIfForecasts :: Lens' ListWhatIfForecastsResponse (Maybe [WhatIfForecastSummary])
listWhatIfForecastsResponse_whatIfForecasts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWhatIfForecastsResponse' {Maybe [WhatIfForecastSummary]
whatIfForecasts :: Maybe [WhatIfForecastSummary]
$sel:whatIfForecasts:ListWhatIfForecastsResponse' :: ListWhatIfForecastsResponse -> Maybe [WhatIfForecastSummary]
whatIfForecasts} -> Maybe [WhatIfForecastSummary]
whatIfForecasts) (\s :: ListWhatIfForecastsResponse
s@ListWhatIfForecastsResponse' {} Maybe [WhatIfForecastSummary]
a -> ListWhatIfForecastsResponse
s {$sel:whatIfForecasts:ListWhatIfForecastsResponse' :: Maybe [WhatIfForecastSummary]
whatIfForecasts = Maybe [WhatIfForecastSummary]
a} :: ListWhatIfForecastsResponse) 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 response's http status code.
listWhatIfForecastsResponse_httpStatus :: Lens.Lens' ListWhatIfForecastsResponse Prelude.Int
listWhatIfForecastsResponse_httpStatus :: Lens' ListWhatIfForecastsResponse Int
listWhatIfForecastsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWhatIfForecastsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListWhatIfForecastsResponse' :: ListWhatIfForecastsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListWhatIfForecastsResponse
s@ListWhatIfForecastsResponse' {} Int
a -> ListWhatIfForecastsResponse
s {$sel:httpStatus:ListWhatIfForecastsResponse' :: Int
httpStatus = Int
a} :: ListWhatIfForecastsResponse)

instance Prelude.NFData ListWhatIfForecastsResponse where
  rnf :: ListWhatIfForecastsResponse -> ()
rnf ListWhatIfForecastsResponse' {Int
Maybe [WhatIfForecastSummary]
Maybe Text
httpStatus :: Int
whatIfForecasts :: Maybe [WhatIfForecastSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListWhatIfForecastsResponse' :: ListWhatIfForecastsResponse -> Int
$sel:whatIfForecasts:ListWhatIfForecastsResponse' :: ListWhatIfForecastsResponse -> Maybe [WhatIfForecastSummary]
$sel:nextToken:ListWhatIfForecastsResponse' :: ListWhatIfForecastsResponse -> Maybe Text
..} =
    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 Maybe [WhatIfForecastSummary]
whatIfForecasts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus