{-# 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.CreateWhatIfAnalysis
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- What-if analysis is a scenario modeling technique where you make a
-- hypothetical change to a time series and compare the forecasts generated
-- by these changes against the baseline, unchanged time series. It is
-- important to remember that the purpose of a what-if analysis is to
-- understand how a forecast can change given different modifications to
-- the baseline time series.
--
-- For example, imagine you are a clothing retailer who is considering an
-- end of season sale to clear space for new styles. After creating a
-- baseline forecast, you can use a what-if analysis to investigate how
-- different sales tactics might affect your goals. You could create a
-- scenario where everything is given a 25% markdown and another where
-- everything is given a fixed dollar markdown. You can create a scenario
-- where the sale lasts for 1 week and another where the sale lasts for 1
-- month. Your what-if analysis enables you to compare many different
-- scenarios against each other.
--
-- Note that a what-if analysis is meant to display what the forecasting
-- model has learned and how it will behave in the scenarios that you are
-- evaluating. Do not blindly use the results of the what-if analysis to
-- make business decisions. For instance, forecasts might not be accurate
-- for novel scenarios where there is no reference available to determine
-- whether a forecast is good.
--
-- The TimeSeriesSelector object defines the items that you want in the
-- what-if analysis.
module Amazonka.Forecast.CreateWhatIfAnalysis
  ( -- * Creating a Request
    CreateWhatIfAnalysis (..),
    newCreateWhatIfAnalysis,

    -- * Request Lenses
    createWhatIfAnalysis_tags,
    createWhatIfAnalysis_timeSeriesSelector,
    createWhatIfAnalysis_whatIfAnalysisName,
    createWhatIfAnalysis_forecastArn,

    -- * Destructuring the Response
    CreateWhatIfAnalysisResponse (..),
    newCreateWhatIfAnalysisResponse,

    -- * Response Lenses
    createWhatIfAnalysisResponse_whatIfAnalysisArn,
    createWhatIfAnalysisResponse_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:/ 'newCreateWhatIfAnalysis' smart constructor.
data CreateWhatIfAnalysis = CreateWhatIfAnalysis'
  { -- | A list of
    -- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
    -- to apply to the what if forecast.
    CreateWhatIfAnalysis -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Defines the set of time series that are used in the what-if analysis
    -- with a @TimeSeriesIdentifiers@ object. What-if analyses are performed
    -- only for the time series in this object.
    --
    -- The @TimeSeriesIdentifiers@ object needs the following information:
    --
    -- -   @DataSource@
    --
    -- -   @Format@
    --
    -- -   @Schema@
    CreateWhatIfAnalysis -> Maybe TimeSeriesSelector
timeSeriesSelector :: Prelude.Maybe TimeSeriesSelector,
    -- | The name of the what-if analysis. Each name must be unique.
    CreateWhatIfAnalysis -> Text
whatIfAnalysisName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the baseline forecast.
    CreateWhatIfAnalysis -> Text
forecastArn :: Prelude.Text
  }
  deriving (CreateWhatIfAnalysis -> CreateWhatIfAnalysis -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWhatIfAnalysis -> CreateWhatIfAnalysis -> Bool
$c/= :: CreateWhatIfAnalysis -> CreateWhatIfAnalysis -> Bool
== :: CreateWhatIfAnalysis -> CreateWhatIfAnalysis -> Bool
$c== :: CreateWhatIfAnalysis -> CreateWhatIfAnalysis -> Bool
Prelude.Eq, Int -> CreateWhatIfAnalysis -> ShowS
[CreateWhatIfAnalysis] -> ShowS
CreateWhatIfAnalysis -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWhatIfAnalysis] -> ShowS
$cshowList :: [CreateWhatIfAnalysis] -> ShowS
show :: CreateWhatIfAnalysis -> String
$cshow :: CreateWhatIfAnalysis -> String
showsPrec :: Int -> CreateWhatIfAnalysis -> ShowS
$cshowsPrec :: Int -> CreateWhatIfAnalysis -> ShowS
Prelude.Show, forall x. Rep CreateWhatIfAnalysis x -> CreateWhatIfAnalysis
forall x. CreateWhatIfAnalysis -> Rep CreateWhatIfAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWhatIfAnalysis x -> CreateWhatIfAnalysis
$cfrom :: forall x. CreateWhatIfAnalysis -> Rep CreateWhatIfAnalysis x
Prelude.Generic)

-- |
-- Create a value of 'CreateWhatIfAnalysis' 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:
--
-- 'tags', 'createWhatIfAnalysis_tags' - A list of
-- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
-- to apply to the what if forecast.
--
-- 'timeSeriesSelector', 'createWhatIfAnalysis_timeSeriesSelector' - Defines the set of time series that are used in the what-if analysis
-- with a @TimeSeriesIdentifiers@ object. What-if analyses are performed
-- only for the time series in this object.
--
-- The @TimeSeriesIdentifiers@ object needs the following information:
--
-- -   @DataSource@
--
-- -   @Format@
--
-- -   @Schema@
--
-- 'whatIfAnalysisName', 'createWhatIfAnalysis_whatIfAnalysisName' - The name of the what-if analysis. Each name must be unique.
--
-- 'forecastArn', 'createWhatIfAnalysis_forecastArn' - The Amazon Resource Name (ARN) of the baseline forecast.
newCreateWhatIfAnalysis ::
  -- | 'whatIfAnalysisName'
  Prelude.Text ->
  -- | 'forecastArn'
  Prelude.Text ->
  CreateWhatIfAnalysis
newCreateWhatIfAnalysis :: Text -> Text -> CreateWhatIfAnalysis
newCreateWhatIfAnalysis
  Text
pWhatIfAnalysisName_
  Text
pForecastArn_ =
    CreateWhatIfAnalysis'
      { $sel:tags:CreateWhatIfAnalysis' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:timeSeriesSelector:CreateWhatIfAnalysis' :: Maybe TimeSeriesSelector
timeSeriesSelector = forall a. Maybe a
Prelude.Nothing,
        $sel:whatIfAnalysisName:CreateWhatIfAnalysis' :: Text
whatIfAnalysisName = Text
pWhatIfAnalysisName_,
        $sel:forecastArn:CreateWhatIfAnalysis' :: Text
forecastArn = Text
pForecastArn_
      }

-- | A list of
-- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
-- to apply to the what if forecast.
createWhatIfAnalysis_tags :: Lens.Lens' CreateWhatIfAnalysis (Prelude.Maybe [Tag])
createWhatIfAnalysis_tags :: Lens' CreateWhatIfAnalysis (Maybe [Tag])
createWhatIfAnalysis_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfAnalysis' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateWhatIfAnalysis
s@CreateWhatIfAnalysis' {} Maybe [Tag]
a -> CreateWhatIfAnalysis
s {$sel:tags:CreateWhatIfAnalysis' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateWhatIfAnalysis) 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

-- | Defines the set of time series that are used in the what-if analysis
-- with a @TimeSeriesIdentifiers@ object. What-if analyses are performed
-- only for the time series in this object.
--
-- The @TimeSeriesIdentifiers@ object needs the following information:
--
-- -   @DataSource@
--
-- -   @Format@
--
-- -   @Schema@
createWhatIfAnalysis_timeSeriesSelector :: Lens.Lens' CreateWhatIfAnalysis (Prelude.Maybe TimeSeriesSelector)
createWhatIfAnalysis_timeSeriesSelector :: Lens' CreateWhatIfAnalysis (Maybe TimeSeriesSelector)
createWhatIfAnalysis_timeSeriesSelector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfAnalysis' {Maybe TimeSeriesSelector
timeSeriesSelector :: Maybe TimeSeriesSelector
$sel:timeSeriesSelector:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe TimeSeriesSelector
timeSeriesSelector} -> Maybe TimeSeriesSelector
timeSeriesSelector) (\s :: CreateWhatIfAnalysis
s@CreateWhatIfAnalysis' {} Maybe TimeSeriesSelector
a -> CreateWhatIfAnalysis
s {$sel:timeSeriesSelector:CreateWhatIfAnalysis' :: Maybe TimeSeriesSelector
timeSeriesSelector = Maybe TimeSeriesSelector
a} :: CreateWhatIfAnalysis)

-- | The name of the what-if analysis. Each name must be unique.
createWhatIfAnalysis_whatIfAnalysisName :: Lens.Lens' CreateWhatIfAnalysis Prelude.Text
createWhatIfAnalysis_whatIfAnalysisName :: Lens' CreateWhatIfAnalysis Text
createWhatIfAnalysis_whatIfAnalysisName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfAnalysis' {Text
whatIfAnalysisName :: Text
$sel:whatIfAnalysisName:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
whatIfAnalysisName} -> Text
whatIfAnalysisName) (\s :: CreateWhatIfAnalysis
s@CreateWhatIfAnalysis' {} Text
a -> CreateWhatIfAnalysis
s {$sel:whatIfAnalysisName:CreateWhatIfAnalysis' :: Text
whatIfAnalysisName = Text
a} :: CreateWhatIfAnalysis)

-- | The Amazon Resource Name (ARN) of the baseline forecast.
createWhatIfAnalysis_forecastArn :: Lens.Lens' CreateWhatIfAnalysis Prelude.Text
createWhatIfAnalysis_forecastArn :: Lens' CreateWhatIfAnalysis Text
createWhatIfAnalysis_forecastArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfAnalysis' {Text
forecastArn :: Text
$sel:forecastArn:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
forecastArn} -> Text
forecastArn) (\s :: CreateWhatIfAnalysis
s@CreateWhatIfAnalysis' {} Text
a -> CreateWhatIfAnalysis
s {$sel:forecastArn:CreateWhatIfAnalysis' :: Text
forecastArn = Text
a} :: CreateWhatIfAnalysis)

instance Core.AWSRequest CreateWhatIfAnalysis where
  type
    AWSResponse CreateWhatIfAnalysis =
      CreateWhatIfAnalysisResponse
  request :: (Service -> Service)
-> CreateWhatIfAnalysis -> Request CreateWhatIfAnalysis
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 CreateWhatIfAnalysis
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWhatIfAnalysis)))
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 -> Int -> CreateWhatIfAnalysisResponse
CreateWhatIfAnalysisResponse'
            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
"WhatIfAnalysisArn")
            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 CreateWhatIfAnalysis where
  hashWithSalt :: Int -> CreateWhatIfAnalysis -> Int
hashWithSalt Int
_salt CreateWhatIfAnalysis' {Maybe [Tag]
Maybe TimeSeriesSelector
Text
forecastArn :: Text
whatIfAnalysisName :: Text
timeSeriesSelector :: Maybe TimeSeriesSelector
tags :: Maybe [Tag]
$sel:forecastArn:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
$sel:whatIfAnalysisName:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
$sel:timeSeriesSelector:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe TimeSeriesSelector
$sel:tags:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe [Tag]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TimeSeriesSelector
timeSeriesSelector
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
whatIfAnalysisName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
forecastArn

instance Prelude.NFData CreateWhatIfAnalysis where
  rnf :: CreateWhatIfAnalysis -> ()
rnf CreateWhatIfAnalysis' {Maybe [Tag]
Maybe TimeSeriesSelector
Text
forecastArn :: Text
whatIfAnalysisName :: Text
timeSeriesSelector :: Maybe TimeSeriesSelector
tags :: Maybe [Tag]
$sel:forecastArn:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
$sel:whatIfAnalysisName:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
$sel:timeSeriesSelector:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe TimeSeriesSelector
$sel:tags:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe [Tag]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TimeSeriesSelector
timeSeriesSelector
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
whatIfAnalysisName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
forecastArn

instance Data.ToHeaders CreateWhatIfAnalysis where
  toHeaders :: CreateWhatIfAnalysis -> 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.CreateWhatIfAnalysis" ::
                          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 CreateWhatIfAnalysis where
  toJSON :: CreateWhatIfAnalysis -> Value
toJSON CreateWhatIfAnalysis' {Maybe [Tag]
Maybe TimeSeriesSelector
Text
forecastArn :: Text
whatIfAnalysisName :: Text
timeSeriesSelector :: Maybe TimeSeriesSelector
tags :: Maybe [Tag]
$sel:forecastArn:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
$sel:whatIfAnalysisName:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Text
$sel:timeSeriesSelector:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe TimeSeriesSelector
$sel:tags:CreateWhatIfAnalysis' :: CreateWhatIfAnalysis -> Maybe [Tag]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Tags" 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 [Tag]
tags,
            (Key
"TimeSeriesSelector" 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 TimeSeriesSelector
timeSeriesSelector,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"WhatIfAnalysisName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
whatIfAnalysisName),
            forall a. a -> Maybe a
Prelude.Just (Key
"ForecastArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
forecastArn)
          ]
      )

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

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

-- | /See:/ 'newCreateWhatIfAnalysisResponse' smart constructor.
data CreateWhatIfAnalysisResponse = CreateWhatIfAnalysisResponse'
  { -- | The Amazon Resource Name (ARN) of the what-if analysis.
    CreateWhatIfAnalysisResponse -> Maybe Text
whatIfAnalysisArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWhatIfAnalysisResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWhatIfAnalysisResponse
-> CreateWhatIfAnalysisResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWhatIfAnalysisResponse
-> CreateWhatIfAnalysisResponse -> Bool
$c/= :: CreateWhatIfAnalysisResponse
-> CreateWhatIfAnalysisResponse -> Bool
== :: CreateWhatIfAnalysisResponse
-> CreateWhatIfAnalysisResponse -> Bool
$c== :: CreateWhatIfAnalysisResponse
-> CreateWhatIfAnalysisResponse -> Bool
Prelude.Eq, ReadPrec [CreateWhatIfAnalysisResponse]
ReadPrec CreateWhatIfAnalysisResponse
Int -> ReadS CreateWhatIfAnalysisResponse
ReadS [CreateWhatIfAnalysisResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWhatIfAnalysisResponse]
$creadListPrec :: ReadPrec [CreateWhatIfAnalysisResponse]
readPrec :: ReadPrec CreateWhatIfAnalysisResponse
$creadPrec :: ReadPrec CreateWhatIfAnalysisResponse
readList :: ReadS [CreateWhatIfAnalysisResponse]
$creadList :: ReadS [CreateWhatIfAnalysisResponse]
readsPrec :: Int -> ReadS CreateWhatIfAnalysisResponse
$creadsPrec :: Int -> ReadS CreateWhatIfAnalysisResponse
Prelude.Read, Int -> CreateWhatIfAnalysisResponse -> ShowS
[CreateWhatIfAnalysisResponse] -> ShowS
CreateWhatIfAnalysisResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWhatIfAnalysisResponse] -> ShowS
$cshowList :: [CreateWhatIfAnalysisResponse] -> ShowS
show :: CreateWhatIfAnalysisResponse -> String
$cshow :: CreateWhatIfAnalysisResponse -> String
showsPrec :: Int -> CreateWhatIfAnalysisResponse -> ShowS
$cshowsPrec :: Int -> CreateWhatIfAnalysisResponse -> ShowS
Prelude.Show, forall x.
Rep CreateWhatIfAnalysisResponse x -> CreateWhatIfAnalysisResponse
forall x.
CreateWhatIfAnalysisResponse -> Rep CreateWhatIfAnalysisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWhatIfAnalysisResponse x -> CreateWhatIfAnalysisResponse
$cfrom :: forall x.
CreateWhatIfAnalysisResponse -> Rep CreateWhatIfAnalysisResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWhatIfAnalysisResponse' 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:
--
-- 'whatIfAnalysisArn', 'createWhatIfAnalysisResponse_whatIfAnalysisArn' - The Amazon Resource Name (ARN) of the what-if analysis.
--
-- 'httpStatus', 'createWhatIfAnalysisResponse_httpStatus' - The response's http status code.
newCreateWhatIfAnalysisResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWhatIfAnalysisResponse
newCreateWhatIfAnalysisResponse :: Int -> CreateWhatIfAnalysisResponse
newCreateWhatIfAnalysisResponse Int
pHttpStatus_ =
  CreateWhatIfAnalysisResponse'
    { $sel:whatIfAnalysisArn:CreateWhatIfAnalysisResponse' :: Maybe Text
whatIfAnalysisArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWhatIfAnalysisResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the what-if analysis.
createWhatIfAnalysisResponse_whatIfAnalysisArn :: Lens.Lens' CreateWhatIfAnalysisResponse (Prelude.Maybe Prelude.Text)
createWhatIfAnalysisResponse_whatIfAnalysisArn :: Lens' CreateWhatIfAnalysisResponse (Maybe Text)
createWhatIfAnalysisResponse_whatIfAnalysisArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfAnalysisResponse' {Maybe Text
whatIfAnalysisArn :: Maybe Text
$sel:whatIfAnalysisArn:CreateWhatIfAnalysisResponse' :: CreateWhatIfAnalysisResponse -> Maybe Text
whatIfAnalysisArn} -> Maybe Text
whatIfAnalysisArn) (\s :: CreateWhatIfAnalysisResponse
s@CreateWhatIfAnalysisResponse' {} Maybe Text
a -> CreateWhatIfAnalysisResponse
s {$sel:whatIfAnalysisArn:CreateWhatIfAnalysisResponse' :: Maybe Text
whatIfAnalysisArn = Maybe Text
a} :: CreateWhatIfAnalysisResponse)

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

instance Prelude.NFData CreateWhatIfAnalysisResponse where
  rnf :: CreateWhatIfAnalysisResponse -> ()
rnf CreateWhatIfAnalysisResponse' {Int
Maybe Text
httpStatus :: Int
whatIfAnalysisArn :: Maybe Text
$sel:httpStatus:CreateWhatIfAnalysisResponse' :: CreateWhatIfAnalysisResponse -> Int
$sel:whatIfAnalysisArn:CreateWhatIfAnalysisResponse' :: CreateWhatIfAnalysisResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
whatIfAnalysisArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus