{-# 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.ListWhatIfAnalyses
-- 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 analyses created using the
-- CreateWhatIfAnalysis operation. For each what-if analysis, 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 analysis ARN with the DescribeWhatIfAnalysis
-- operation.
--
-- This operation returns paginated results.
module Amazonka.Forecast.ListWhatIfAnalyses
  ( -- * Creating a Request
    ListWhatIfAnalyses (..),
    newListWhatIfAnalyses,

    -- * Request Lenses
    listWhatIfAnalyses_filters,
    listWhatIfAnalyses_maxResults,
    listWhatIfAnalyses_nextToken,

    -- * Destructuring the Response
    ListWhatIfAnalysesResponse (..),
    newListWhatIfAnalysesResponse,

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

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

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

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

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

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

-- |
-- Create a value of 'ListWhatIfAnalysesResponse' 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', 'listWhatIfAnalysesResponse_nextToken' - If the response is truncated, Forecast returns this token. To retrieve
-- the next set of results, use the token in the next request.
--
-- 'whatIfAnalyses', 'listWhatIfAnalysesResponse_whatIfAnalyses' - An array of @WhatIfAnalysisSummary@ objects that describe the matched
-- analyses.
--
-- 'httpStatus', 'listWhatIfAnalysesResponse_httpStatus' - The response's http status code.
newListWhatIfAnalysesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWhatIfAnalysesResponse
newListWhatIfAnalysesResponse :: Int -> ListWhatIfAnalysesResponse
newListWhatIfAnalysesResponse Int
pHttpStatus_ =
  ListWhatIfAnalysesResponse'
    { $sel:nextToken:ListWhatIfAnalysesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:whatIfAnalyses:ListWhatIfAnalysesResponse' :: Maybe [WhatIfAnalysisSummary]
whatIfAnalyses = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWhatIfAnalysesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of @WhatIfAnalysisSummary@ objects that describe the matched
-- analyses.
listWhatIfAnalysesResponse_whatIfAnalyses :: Lens.Lens' ListWhatIfAnalysesResponse (Prelude.Maybe [WhatIfAnalysisSummary])
listWhatIfAnalysesResponse_whatIfAnalyses :: Lens' ListWhatIfAnalysesResponse (Maybe [WhatIfAnalysisSummary])
listWhatIfAnalysesResponse_whatIfAnalyses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWhatIfAnalysesResponse' {Maybe [WhatIfAnalysisSummary]
whatIfAnalyses :: Maybe [WhatIfAnalysisSummary]
$sel:whatIfAnalyses:ListWhatIfAnalysesResponse' :: ListWhatIfAnalysesResponse -> Maybe [WhatIfAnalysisSummary]
whatIfAnalyses} -> Maybe [WhatIfAnalysisSummary]
whatIfAnalyses) (\s :: ListWhatIfAnalysesResponse
s@ListWhatIfAnalysesResponse' {} Maybe [WhatIfAnalysisSummary]
a -> ListWhatIfAnalysesResponse
s {$sel:whatIfAnalyses:ListWhatIfAnalysesResponse' :: Maybe [WhatIfAnalysisSummary]
whatIfAnalyses = Maybe [WhatIfAnalysisSummary]
a} :: ListWhatIfAnalysesResponse) 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.
listWhatIfAnalysesResponse_httpStatus :: Lens.Lens' ListWhatIfAnalysesResponse Prelude.Int
listWhatIfAnalysesResponse_httpStatus :: Lens' ListWhatIfAnalysesResponse Int
listWhatIfAnalysesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWhatIfAnalysesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListWhatIfAnalysesResponse' :: ListWhatIfAnalysesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListWhatIfAnalysesResponse
s@ListWhatIfAnalysesResponse' {} Int
a -> ListWhatIfAnalysesResponse
s {$sel:httpStatus:ListWhatIfAnalysesResponse' :: Int
httpStatus = Int
a} :: ListWhatIfAnalysesResponse)

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