{-# 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.CreateWhatIfForecastExport
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Exports a forecast created by the CreateWhatIfForecast operation to your
-- Amazon Simple Storage Service (Amazon S3) bucket. The forecast file name
-- will match the following conventions:
--
-- @≈\<ForecastExportJobName>_\<ExportTimestamp>_\<PartNumber>@
--
-- The \<ExportTimestamp> component is in Java SimpleDateFormat
-- (yyyy-MM-ddTHH-mm-ssZ).
--
-- You must specify a DataDestination object that includes an AWS Identity
-- and Access Management (IAM) role that Amazon Forecast can assume to
-- access the Amazon S3 bucket. For more information, see
-- aws-forecast-iam-roles.
--
-- For more information, see howitworks-forecast.
--
-- To get a list of all your what-if forecast export jobs, use the
-- ListWhatIfForecastExports operation.
--
-- The @Status@ of the forecast export job must be @ACTIVE@ before you can
-- access the forecast in your Amazon S3 bucket. To get the status, use the
-- DescribeWhatIfForecastExport operation.
module Amazonka.Forecast.CreateWhatIfForecastExport
  ( -- * Creating a Request
    CreateWhatIfForecastExport (..),
    newCreateWhatIfForecastExport,

    -- * Request Lenses
    createWhatIfForecastExport_format,
    createWhatIfForecastExport_tags,
    createWhatIfForecastExport_whatIfForecastExportName,
    createWhatIfForecastExport_whatIfForecastArns,
    createWhatIfForecastExport_destination,

    -- * Destructuring the Response
    CreateWhatIfForecastExportResponse (..),
    newCreateWhatIfForecastExportResponse,

    -- * Response Lenses
    createWhatIfForecastExportResponse_whatIfForecastExportArn,
    createWhatIfForecastExportResponse_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:/ 'newCreateWhatIfForecastExport' smart constructor.
data CreateWhatIfForecastExport = CreateWhatIfForecastExport'
  { -- | The format of the exported data, CSV or PARQUET.
    CreateWhatIfForecastExport -> Maybe Text
format :: Prelude.Maybe Prelude.Text,
    -- | A list of
    -- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
    -- to apply to the what if forecast.
    CreateWhatIfForecastExport -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the what-if forecast to export.
    CreateWhatIfForecastExport -> Text
whatIfForecastExportName :: Prelude.Text,
    -- | The list of what-if forecast Amazon Resource Names (ARNs) to export.
    CreateWhatIfForecastExport -> NonEmpty Text
whatIfForecastArns :: Prelude.NonEmpty Prelude.Text,
    -- | The location where you want to save the forecast and an AWS Identity and
    -- Access Management (IAM) role that Amazon Forecast can assume to access
    -- the location. The forecast must be exported to an Amazon S3 bucket.
    --
    -- If encryption is used, @Destination@ must include an AWS Key Management
    -- Service (KMS) key. The IAM role must allow Amazon Forecast permission to
    -- access the key.
    CreateWhatIfForecastExport -> DataDestination
destination :: DataDestination
  }
  deriving (CreateWhatIfForecastExport -> CreateWhatIfForecastExport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWhatIfForecastExport -> CreateWhatIfForecastExport -> Bool
$c/= :: CreateWhatIfForecastExport -> CreateWhatIfForecastExport -> Bool
== :: CreateWhatIfForecastExport -> CreateWhatIfForecastExport -> Bool
$c== :: CreateWhatIfForecastExport -> CreateWhatIfForecastExport -> Bool
Prelude.Eq, Int -> CreateWhatIfForecastExport -> ShowS
[CreateWhatIfForecastExport] -> ShowS
CreateWhatIfForecastExport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWhatIfForecastExport] -> ShowS
$cshowList :: [CreateWhatIfForecastExport] -> ShowS
show :: CreateWhatIfForecastExport -> String
$cshow :: CreateWhatIfForecastExport -> String
showsPrec :: Int -> CreateWhatIfForecastExport -> ShowS
$cshowsPrec :: Int -> CreateWhatIfForecastExport -> ShowS
Prelude.Show, forall x.
Rep CreateWhatIfForecastExport x -> CreateWhatIfForecastExport
forall x.
CreateWhatIfForecastExport -> Rep CreateWhatIfForecastExport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWhatIfForecastExport x -> CreateWhatIfForecastExport
$cfrom :: forall x.
CreateWhatIfForecastExport -> Rep CreateWhatIfForecastExport x
Prelude.Generic)

-- |
-- Create a value of 'CreateWhatIfForecastExport' 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:
--
-- 'format', 'createWhatIfForecastExport_format' - The format of the exported data, CSV or PARQUET.
--
-- 'tags', 'createWhatIfForecastExport_tags' - A list of
-- <https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html tags>
-- to apply to the what if forecast.
--
-- 'whatIfForecastExportName', 'createWhatIfForecastExport_whatIfForecastExportName' - The name of the what-if forecast to export.
--
-- 'whatIfForecastArns', 'createWhatIfForecastExport_whatIfForecastArns' - The list of what-if forecast Amazon Resource Names (ARNs) to export.
--
-- 'destination', 'createWhatIfForecastExport_destination' - The location where you want to save the forecast and an AWS Identity and
-- Access Management (IAM) role that Amazon Forecast can assume to access
-- the location. The forecast must be exported to an Amazon S3 bucket.
--
-- If encryption is used, @Destination@ must include an AWS Key Management
-- Service (KMS) key. The IAM role must allow Amazon Forecast permission to
-- access the key.
newCreateWhatIfForecastExport ::
  -- | 'whatIfForecastExportName'
  Prelude.Text ->
  -- | 'whatIfForecastArns'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'destination'
  DataDestination ->
  CreateWhatIfForecastExport
newCreateWhatIfForecastExport :: Text
-> NonEmpty Text -> DataDestination -> CreateWhatIfForecastExport
newCreateWhatIfForecastExport
  Text
pWhatIfForecastExportName_
  NonEmpty Text
pWhatIfForecastArns_
  DataDestination
pDestination_ =
    CreateWhatIfForecastExport'
      { $sel:format:CreateWhatIfForecastExport' :: Maybe Text
format =
          forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateWhatIfForecastExport' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:whatIfForecastExportName:CreateWhatIfForecastExport' :: Text
whatIfForecastExportName =
          Text
pWhatIfForecastExportName_,
        $sel:whatIfForecastArns:CreateWhatIfForecastExport' :: NonEmpty Text
whatIfForecastArns =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pWhatIfForecastArns_,
        $sel:destination:CreateWhatIfForecastExport' :: DataDestination
destination = DataDestination
pDestination_
      }

-- | The format of the exported data, CSV or PARQUET.
createWhatIfForecastExport_format :: Lens.Lens' CreateWhatIfForecastExport (Prelude.Maybe Prelude.Text)
createWhatIfForecastExport_format :: Lens' CreateWhatIfForecastExport (Maybe Text)
createWhatIfForecastExport_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfForecastExport' {Maybe Text
format :: Maybe Text
$sel:format:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Maybe Text
format} -> Maybe Text
format) (\s :: CreateWhatIfForecastExport
s@CreateWhatIfForecastExport' {} Maybe Text
a -> CreateWhatIfForecastExport
s {$sel:format:CreateWhatIfForecastExport' :: Maybe Text
format = Maybe Text
a} :: CreateWhatIfForecastExport)

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

-- | The list of what-if forecast Amazon Resource Names (ARNs) to export.
createWhatIfForecastExport_whatIfForecastArns :: Lens.Lens' CreateWhatIfForecastExport (Prelude.NonEmpty Prelude.Text)
createWhatIfForecastExport_whatIfForecastArns :: Lens' CreateWhatIfForecastExport (NonEmpty Text)
createWhatIfForecastExport_whatIfForecastArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfForecastExport' {NonEmpty Text
whatIfForecastArns :: NonEmpty Text
$sel:whatIfForecastArns:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> NonEmpty Text
whatIfForecastArns} -> NonEmpty Text
whatIfForecastArns) (\s :: CreateWhatIfForecastExport
s@CreateWhatIfForecastExport' {} NonEmpty Text
a -> CreateWhatIfForecastExport
s {$sel:whatIfForecastArns:CreateWhatIfForecastExport' :: NonEmpty Text
whatIfForecastArns = NonEmpty Text
a} :: CreateWhatIfForecastExport) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The location where you want to save the forecast and an AWS Identity and
-- Access Management (IAM) role that Amazon Forecast can assume to access
-- the location. The forecast must be exported to an Amazon S3 bucket.
--
-- If encryption is used, @Destination@ must include an AWS Key Management
-- Service (KMS) key. The IAM role must allow Amazon Forecast permission to
-- access the key.
createWhatIfForecastExport_destination :: Lens.Lens' CreateWhatIfForecastExport DataDestination
createWhatIfForecastExport_destination :: Lens' CreateWhatIfForecastExport DataDestination
createWhatIfForecastExport_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWhatIfForecastExport' {DataDestination
destination :: DataDestination
$sel:destination:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> DataDestination
destination} -> DataDestination
destination) (\s :: CreateWhatIfForecastExport
s@CreateWhatIfForecastExport' {} DataDestination
a -> CreateWhatIfForecastExport
s {$sel:destination:CreateWhatIfForecastExport' :: DataDestination
destination = DataDestination
a} :: CreateWhatIfForecastExport)

instance Core.AWSRequest CreateWhatIfForecastExport where
  type
    AWSResponse CreateWhatIfForecastExport =
      CreateWhatIfForecastExportResponse
  request :: (Service -> Service)
-> CreateWhatIfForecastExport -> Request CreateWhatIfForecastExport
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 CreateWhatIfForecastExport
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWhatIfForecastExport)))
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 -> CreateWhatIfForecastExportResponse
CreateWhatIfForecastExportResponse'
            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
"WhatIfForecastExportArn")
            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 CreateWhatIfForecastExport where
  hashWithSalt :: Int -> CreateWhatIfForecastExport -> Int
hashWithSalt Int
_salt CreateWhatIfForecastExport' {Maybe [Tag]
Maybe Text
NonEmpty Text
Text
DataDestination
destination :: DataDestination
whatIfForecastArns :: NonEmpty Text
whatIfForecastExportName :: Text
tags :: Maybe [Tag]
format :: Maybe Text
$sel:destination:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> DataDestination
$sel:whatIfForecastArns:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> NonEmpty Text
$sel:whatIfForecastExportName:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Text
$sel:tags:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Maybe [Tag]
$sel:format:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
format
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
whatIfForecastExportName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
whatIfForecastArns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DataDestination
destination

instance Prelude.NFData CreateWhatIfForecastExport where
  rnf :: CreateWhatIfForecastExport -> ()
rnf CreateWhatIfForecastExport' {Maybe [Tag]
Maybe Text
NonEmpty Text
Text
DataDestination
destination :: DataDestination
whatIfForecastArns :: NonEmpty Text
whatIfForecastExportName :: Text
tags :: Maybe [Tag]
format :: Maybe Text
$sel:destination:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> DataDestination
$sel:whatIfForecastArns:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> NonEmpty Text
$sel:whatIfForecastExportName:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Text
$sel:tags:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Maybe [Tag]
$sel:format:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
format
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
whatIfForecastExportName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
whatIfForecastArns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DataDestination
destination

instance Data.ToHeaders CreateWhatIfForecastExport where
  toHeaders :: CreateWhatIfForecastExport -> 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.CreateWhatIfForecastExport" ::
                          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 CreateWhatIfForecastExport where
  toJSON :: CreateWhatIfForecastExport -> Value
toJSON CreateWhatIfForecastExport' {Maybe [Tag]
Maybe Text
NonEmpty Text
Text
DataDestination
destination :: DataDestination
whatIfForecastArns :: NonEmpty Text
whatIfForecastExportName :: Text
tags :: Maybe [Tag]
format :: Maybe Text
$sel:destination:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> DataDestination
$sel:whatIfForecastArns:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> NonEmpty Text
$sel:whatIfForecastExportName:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Text
$sel:tags:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Maybe [Tag]
$sel:format:CreateWhatIfForecastExport' :: CreateWhatIfForecastExport -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Format" 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
format,
            (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,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"WhatIfForecastExportName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
whatIfForecastExportName
              ),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"WhatIfForecastArns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
whatIfForecastArns),
            forall a. a -> Maybe a
Prelude.Just (Key
"Destination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DataDestination
destination)
          ]
      )

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

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

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

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

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

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

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