{-# 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.CreateWhatIfForecast
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- A what-if forecast is a forecast that is created from a modified version
-- of the baseline forecast. Each what-if forecast incorporates either a
-- replacement dataset or a set of transformations to the original dataset.
module Amazonka.Forecast.CreateWhatIfForecast
  ( -- * Creating a Request
    CreateWhatIfForecast (..),
    newCreateWhatIfForecast,

    -- * Request Lenses
    createWhatIfForecast_tags,
    createWhatIfForecast_timeSeriesReplacementsDataSource,
    createWhatIfForecast_timeSeriesTransformations,
    createWhatIfForecast_whatIfForecastName,
    createWhatIfForecast_whatIfAnalysisArn,

    -- * Destructuring the Response
    CreateWhatIfForecastResponse (..),
    newCreateWhatIfForecastResponse,

    -- * Response Lenses
    createWhatIfForecastResponse_whatIfForecastArn,
    createWhatIfForecastResponse_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:/ 'newCreateWhatIfForecast' smart constructor.
data CreateWhatIfForecast = CreateWhatIfForecast'
  { -- | A list of
    -- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
    -- to apply to the what if forecast.
    CreateWhatIfForecast -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The replacement time series dataset, which contains the rows that you
    -- want to change in the related time series dataset. A replacement time
    -- series does not need to contain all rows that are in the baseline
    -- related time series. Include only the rows (measure-dimension
    -- combinations) that you want to include in the what-if forecast. This
    -- dataset is merged with the original time series to create a transformed
    -- dataset that is used for the what-if analysis.
    --
    -- This dataset should contain the items to modify (such as item_id or
    -- workforce_type), any relevant dimensions, the timestamp column, and at
    -- least one of the related time series columns. This file should not
    -- contain duplicate timestamps for the same time series.
    --
    -- Timestamps and item_ids not included in this dataset are not included in
    -- the what-if analysis.
    CreateWhatIfForecast -> Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource :: Prelude.Maybe TimeSeriesReplacementsDataSource,
    -- | The transformations that are applied to the baseline time series. Each
    -- transformation contains an action and a set of conditions. An action is
    -- applied only when all conditions are met. If no conditions are provided,
    -- the action is applied to all items.
    CreateWhatIfForecast -> Maybe [TimeSeriesTransformation]
timeSeriesTransformations :: Prelude.Maybe [TimeSeriesTransformation],
    -- | The name of the what-if forecast. Names must be unique within each
    -- what-if analysis.
    CreateWhatIfForecast -> Text
whatIfForecastName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the what-if analysis.
    CreateWhatIfForecast -> Text
whatIfAnalysisArn :: Prelude.Text
  }
  deriving (CreateWhatIfForecast -> CreateWhatIfForecast -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWhatIfForecast -> CreateWhatIfForecast -> Bool
$c/= :: CreateWhatIfForecast -> CreateWhatIfForecast -> Bool
== :: CreateWhatIfForecast -> CreateWhatIfForecast -> Bool
$c== :: CreateWhatIfForecast -> CreateWhatIfForecast -> Bool
Prelude.Eq, Int -> CreateWhatIfForecast -> ShowS
[CreateWhatIfForecast] -> ShowS
CreateWhatIfForecast -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWhatIfForecast] -> ShowS
$cshowList :: [CreateWhatIfForecast] -> ShowS
show :: CreateWhatIfForecast -> String
$cshow :: CreateWhatIfForecast -> String
showsPrec :: Int -> CreateWhatIfForecast -> ShowS
$cshowsPrec :: Int -> CreateWhatIfForecast -> ShowS
Prelude.Show, forall x. Rep CreateWhatIfForecast x -> CreateWhatIfForecast
forall x. CreateWhatIfForecast -> Rep CreateWhatIfForecast x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWhatIfForecast x -> CreateWhatIfForecast
$cfrom :: forall x. CreateWhatIfForecast -> Rep CreateWhatIfForecast x
Prelude.Generic)

-- |
-- Create a value of 'CreateWhatIfForecast' 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', 'createWhatIfForecast_tags' - A list of
-- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
-- to apply to the what if forecast.
--
-- 'timeSeriesReplacementsDataSource', 'createWhatIfForecast_timeSeriesReplacementsDataSource' - The replacement time series dataset, which contains the rows that you
-- want to change in the related time series dataset. A replacement time
-- series does not need to contain all rows that are in the baseline
-- related time series. Include only the rows (measure-dimension
-- combinations) that you want to include in the what-if forecast. This
-- dataset is merged with the original time series to create a transformed
-- dataset that is used for the what-if analysis.
--
-- This dataset should contain the items to modify (such as item_id or
-- workforce_type), any relevant dimensions, the timestamp column, and at
-- least one of the related time series columns. This file should not
-- contain duplicate timestamps for the same time series.
--
-- Timestamps and item_ids not included in this dataset are not included in
-- the what-if analysis.
--
-- 'timeSeriesTransformations', 'createWhatIfForecast_timeSeriesTransformations' - The transformations that are applied to the baseline time series. Each
-- transformation contains an action and a set of conditions. An action is
-- applied only when all conditions are met. If no conditions are provided,
-- the action is applied to all items.
--
-- 'whatIfForecastName', 'createWhatIfForecast_whatIfForecastName' - The name of the what-if forecast. Names must be unique within each
-- what-if analysis.
--
-- 'whatIfAnalysisArn', 'createWhatIfForecast_whatIfAnalysisArn' - The Amazon Resource Name (ARN) of the what-if analysis.
newCreateWhatIfForecast ::
  -- | 'whatIfForecastName'
  Prelude.Text ->
  -- | 'whatIfAnalysisArn'
  Prelude.Text ->
  CreateWhatIfForecast
newCreateWhatIfForecast :: Text -> Text -> CreateWhatIfForecast
newCreateWhatIfForecast
  Text
pWhatIfForecastName_
  Text
pWhatIfAnalysisArn_ =
    CreateWhatIfForecast'
      { $sel:tags:CreateWhatIfForecast' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:timeSeriesReplacementsDataSource:CreateWhatIfForecast' :: Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource = forall a. Maybe a
Prelude.Nothing,
        $sel:timeSeriesTransformations:CreateWhatIfForecast' :: Maybe [TimeSeriesTransformation]
timeSeriesTransformations = forall a. Maybe a
Prelude.Nothing,
        $sel:whatIfForecastName:CreateWhatIfForecast' :: Text
whatIfForecastName = Text
pWhatIfForecastName_,
        $sel:whatIfAnalysisArn:CreateWhatIfForecast' :: Text
whatIfAnalysisArn = Text
pWhatIfAnalysisArn_
      }

-- | A list of
-- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
-- to apply to the what if forecast.
createWhatIfForecast_tags :: Lens.Lens' CreateWhatIfForecast (Prelude.Maybe [Tag])
createWhatIfForecast_tags :: Lens' CreateWhatIfForecast (Maybe [Tag])
createWhatIfForecast_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfForecast' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateWhatIfForecast
s@CreateWhatIfForecast' {} Maybe [Tag]
a -> CreateWhatIfForecast
s {$sel:tags:CreateWhatIfForecast' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateWhatIfForecast) 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 replacement time series dataset, which contains the rows that you
-- want to change in the related time series dataset. A replacement time
-- series does not need to contain all rows that are in the baseline
-- related time series. Include only the rows (measure-dimension
-- combinations) that you want to include in the what-if forecast. This
-- dataset is merged with the original time series to create a transformed
-- dataset that is used for the what-if analysis.
--
-- This dataset should contain the items to modify (such as item_id or
-- workforce_type), any relevant dimensions, the timestamp column, and at
-- least one of the related time series columns. This file should not
-- contain duplicate timestamps for the same time series.
--
-- Timestamps and item_ids not included in this dataset are not included in
-- the what-if analysis.
createWhatIfForecast_timeSeriesReplacementsDataSource :: Lens.Lens' CreateWhatIfForecast (Prelude.Maybe TimeSeriesReplacementsDataSource)
createWhatIfForecast_timeSeriesReplacementsDataSource :: Lens' CreateWhatIfForecast (Maybe TimeSeriesReplacementsDataSource)
createWhatIfForecast_timeSeriesReplacementsDataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfForecast' {Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource :: Maybe TimeSeriesReplacementsDataSource
$sel:timeSeriesReplacementsDataSource:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource} -> Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource) (\s :: CreateWhatIfForecast
s@CreateWhatIfForecast' {} Maybe TimeSeriesReplacementsDataSource
a -> CreateWhatIfForecast
s {$sel:timeSeriesReplacementsDataSource:CreateWhatIfForecast' :: Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource = Maybe TimeSeriesReplacementsDataSource
a} :: CreateWhatIfForecast)

-- | The transformations that are applied to the baseline time series. Each
-- transformation contains an action and a set of conditions. An action is
-- applied only when all conditions are met. If no conditions are provided,
-- the action is applied to all items.
createWhatIfForecast_timeSeriesTransformations :: Lens.Lens' CreateWhatIfForecast (Prelude.Maybe [TimeSeriesTransformation])
createWhatIfForecast_timeSeriesTransformations :: Lens' CreateWhatIfForecast (Maybe [TimeSeriesTransformation])
createWhatIfForecast_timeSeriesTransformations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfForecast' {Maybe [TimeSeriesTransformation]
timeSeriesTransformations :: Maybe [TimeSeriesTransformation]
$sel:timeSeriesTransformations:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe [TimeSeriesTransformation]
timeSeriesTransformations} -> Maybe [TimeSeriesTransformation]
timeSeriesTransformations) (\s :: CreateWhatIfForecast
s@CreateWhatIfForecast' {} Maybe [TimeSeriesTransformation]
a -> CreateWhatIfForecast
s {$sel:timeSeriesTransformations:CreateWhatIfForecast' :: Maybe [TimeSeriesTransformation]
timeSeriesTransformations = Maybe [TimeSeriesTransformation]
a} :: CreateWhatIfForecast) 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 name of the what-if forecast. Names must be unique within each
-- what-if analysis.
createWhatIfForecast_whatIfForecastName :: Lens.Lens' CreateWhatIfForecast Prelude.Text
createWhatIfForecast_whatIfForecastName :: Lens' CreateWhatIfForecast Text
createWhatIfForecast_whatIfForecastName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfForecast' {Text
whatIfForecastName :: Text
$sel:whatIfForecastName:CreateWhatIfForecast' :: CreateWhatIfForecast -> Text
whatIfForecastName} -> Text
whatIfForecastName) (\s :: CreateWhatIfForecast
s@CreateWhatIfForecast' {} Text
a -> CreateWhatIfForecast
s {$sel:whatIfForecastName:CreateWhatIfForecast' :: Text
whatIfForecastName = Text
a} :: CreateWhatIfForecast)

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

instance Core.AWSRequest CreateWhatIfForecast where
  type
    AWSResponse CreateWhatIfForecast =
      CreateWhatIfForecastResponse
  request :: (Service -> Service)
-> CreateWhatIfForecast -> Request CreateWhatIfForecast
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 CreateWhatIfForecast
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWhatIfForecast)))
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 -> CreateWhatIfForecastResponse
CreateWhatIfForecastResponse'
            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
"WhatIfForecastArn")
            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 CreateWhatIfForecast where
  hashWithSalt :: Int -> CreateWhatIfForecast -> Int
hashWithSalt Int
_salt CreateWhatIfForecast' {Maybe [Tag]
Maybe [TimeSeriesTransformation]
Maybe TimeSeriesReplacementsDataSource
Text
whatIfAnalysisArn :: Text
whatIfForecastName :: Text
timeSeriesTransformations :: Maybe [TimeSeriesTransformation]
timeSeriesReplacementsDataSource :: Maybe TimeSeriesReplacementsDataSource
tags :: Maybe [Tag]
$sel:whatIfAnalysisArn:CreateWhatIfForecast' :: CreateWhatIfForecast -> Text
$sel:whatIfForecastName:CreateWhatIfForecast' :: CreateWhatIfForecast -> Text
$sel:timeSeriesTransformations:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe [TimeSeriesTransformation]
$sel:timeSeriesReplacementsDataSource:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe TimeSeriesReplacementsDataSource
$sel:tags:CreateWhatIfForecast' :: CreateWhatIfForecast -> 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 TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TimeSeriesTransformation]
timeSeriesTransformations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
whatIfForecastName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
whatIfAnalysisArn

instance Prelude.NFData CreateWhatIfForecast where
  rnf :: CreateWhatIfForecast -> ()
rnf CreateWhatIfForecast' {Maybe [Tag]
Maybe [TimeSeriesTransformation]
Maybe TimeSeriesReplacementsDataSource
Text
whatIfAnalysisArn :: Text
whatIfForecastName :: Text
timeSeriesTransformations :: Maybe [TimeSeriesTransformation]
timeSeriesReplacementsDataSource :: Maybe TimeSeriesReplacementsDataSource
tags :: Maybe [Tag]
$sel:whatIfAnalysisArn:CreateWhatIfForecast' :: CreateWhatIfForecast -> Text
$sel:whatIfForecastName:CreateWhatIfForecast' :: CreateWhatIfForecast -> Text
$sel:timeSeriesTransformations:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe [TimeSeriesTransformation]
$sel:timeSeriesReplacementsDataSource:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe TimeSeriesReplacementsDataSource
$sel:tags:CreateWhatIfForecast' :: CreateWhatIfForecast -> 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 TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TimeSeriesTransformation]
timeSeriesTransformations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
whatIfForecastName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
whatIfAnalysisArn

instance Data.ToHeaders CreateWhatIfForecast where
  toHeaders :: CreateWhatIfForecast -> 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.CreateWhatIfForecast" ::
                          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 CreateWhatIfForecast where
  toJSON :: CreateWhatIfForecast -> Value
toJSON CreateWhatIfForecast' {Maybe [Tag]
Maybe [TimeSeriesTransformation]
Maybe TimeSeriesReplacementsDataSource
Text
whatIfAnalysisArn :: Text
whatIfForecastName :: Text
timeSeriesTransformations :: Maybe [TimeSeriesTransformation]
timeSeriesReplacementsDataSource :: Maybe TimeSeriesReplacementsDataSource
tags :: Maybe [Tag]
$sel:whatIfAnalysisArn:CreateWhatIfForecast' :: CreateWhatIfForecast -> Text
$sel:whatIfForecastName:CreateWhatIfForecast' :: CreateWhatIfForecast -> Text
$sel:timeSeriesTransformations:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe [TimeSeriesTransformation]
$sel:timeSeriesReplacementsDataSource:CreateWhatIfForecast' :: CreateWhatIfForecast -> Maybe TimeSeriesReplacementsDataSource
$sel:tags:CreateWhatIfForecast' :: CreateWhatIfForecast -> 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
"TimeSeriesReplacementsDataSource" 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 TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource,
            (Key
"TimeSeriesTransformations" 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 [TimeSeriesTransformation]
timeSeriesTransformations,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"WhatIfForecastName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
whatIfForecastName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"WhatIfAnalysisArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
whatIfAnalysisArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateWhatIfForecastResponse' 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:
--
-- 'whatIfForecastArn', 'createWhatIfForecastResponse_whatIfForecastArn' - The Amazon Resource Name (ARN) of the what-if forecast.
--
-- 'httpStatus', 'createWhatIfForecastResponse_httpStatus' - The response's http status code.
newCreateWhatIfForecastResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWhatIfForecastResponse
newCreateWhatIfForecastResponse :: Int -> CreateWhatIfForecastResponse
newCreateWhatIfForecastResponse Int
pHttpStatus_ =
  CreateWhatIfForecastResponse'
    { $sel:whatIfForecastArn:CreateWhatIfForecastResponse' :: Maybe Text
whatIfForecastArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWhatIfForecastResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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