{-# 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.CreateForecast
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a forecast for each item in the @TARGET_TIME_SERIES@ dataset
-- that was used to train the predictor. This is known as inference. To
-- retrieve the forecast for a single item at low latency, use the
-- operation. To export the complete forecast into your Amazon Simple
-- Storage Service (Amazon S3) bucket, use the CreateForecastExportJob
-- operation.
--
-- The range of the forecast is determined by the @ForecastHorizon@ value,
-- which you specify in the CreatePredictor request. When you query a
-- forecast, you can request a specific date range within the forecast.
--
-- To get a list of all your forecasts, use the ListForecasts operation.
--
-- The forecasts generated by Amazon Forecast are in the same time zone as
-- the dataset that was used to create the predictor.
--
-- For more information, see howitworks-forecast.
--
-- The @Status@ of the forecast must be @ACTIVE@ before you can query or
-- export the forecast. Use the DescribeForecast operation to get the
-- status.
module Amazonka.Forecast.CreateForecast
  ( -- * Creating a Request
    CreateForecast (..),
    newCreateForecast,

    -- * Request Lenses
    createForecast_forecastTypes,
    createForecast_tags,
    createForecast_forecastName,
    createForecast_predictorArn,

    -- * Destructuring the Response
    CreateForecastResponse (..),
    newCreateForecastResponse,

    -- * Response Lenses
    createForecastResponse_forecastArn,
    createForecastResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Forecast.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateForecast' smart constructor.
data CreateForecast = CreateForecast'
  { -- | The quantiles at which probabilistic forecasts are generated. __You can
    -- currently specify up to 5 quantiles per forecast__. Accepted values
    -- include @0.01 to 0.99@ (increments of .01 only) and @mean@. The mean
    -- forecast is different from the median (0.50) when the distribution is
    -- not symmetric (for example, Beta and Negative Binomial). The default
    -- value is @[\"0.1\", \"0.5\", \"0.9\"]@.
    CreateForecast -> Maybe (NonEmpty Text)
forecastTypes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The optional metadata that you apply to the forecast to help you
    -- categorize and organize them. Each tag consists of a key and an optional
    -- value, both of which you define.
    --
    -- The following basic restrictions apply to tags:
    --
    -- -   Maximum number of tags per resource - 50.
    --
    -- -   For each resource, each tag key must be unique, and each tag key can
    --     have only one value.
    --
    -- -   Maximum key length - 128 Unicode characters in UTF-8.
    --
    -- -   Maximum value length - 256 Unicode characters in UTF-8.
    --
    -- -   If your tagging schema is used across multiple services and
    --     resources, remember that other services may have restrictions on
    --     allowed characters. Generally allowed characters are: letters,
    --     numbers, and spaces representable in UTF-8, and the following
    --     characters: + - = . _ : \/ \@.
    --
    -- -   Tag keys and values are case sensitive.
    --
    -- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
    --     such as a prefix for keys as it is reserved for AWS use. You cannot
    --     edit or delete tag keys with this prefix. Values can have this
    --     prefix. If a tag value has @aws@ as its prefix but the key does not,
    --     then Forecast considers it to be a user tag and will count against
    --     the limit of 50 tags. Tags with only the key prefix of @aws@ do not
    --     count against your tags per resource limit.
    CreateForecast -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A name for the forecast.
    CreateForecast -> Text
forecastName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the predictor to use to generate the
    -- forecast.
    CreateForecast -> Text
predictorArn :: Prelude.Text
  }
  deriving (CreateForecast -> CreateForecast -> Bool
(CreateForecast -> CreateForecast -> Bool)
-> (CreateForecast -> CreateForecast -> Bool) -> Eq CreateForecast
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateForecast -> CreateForecast -> Bool
$c/= :: CreateForecast -> CreateForecast -> Bool
== :: CreateForecast -> CreateForecast -> Bool
$c== :: CreateForecast -> CreateForecast -> Bool
Prelude.Eq, Int -> CreateForecast -> ShowS
[CreateForecast] -> ShowS
CreateForecast -> String
(Int -> CreateForecast -> ShowS)
-> (CreateForecast -> String)
-> ([CreateForecast] -> ShowS)
-> Show CreateForecast
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateForecast] -> ShowS
$cshowList :: [CreateForecast] -> ShowS
show :: CreateForecast -> String
$cshow :: CreateForecast -> String
showsPrec :: Int -> CreateForecast -> ShowS
$cshowsPrec :: Int -> CreateForecast -> ShowS
Prelude.Show, (forall x. CreateForecast -> Rep CreateForecast x)
-> (forall x. Rep CreateForecast x -> CreateForecast)
-> Generic CreateForecast
forall x. Rep CreateForecast x -> CreateForecast
forall x. CreateForecast -> Rep CreateForecast x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateForecast x -> CreateForecast
$cfrom :: forall x. CreateForecast -> Rep CreateForecast x
Prelude.Generic)

-- |
-- Create a value of 'CreateForecast' 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:
--
-- 'forecastTypes', 'createForecast_forecastTypes' - The quantiles at which probabilistic forecasts are generated. __You can
-- currently specify up to 5 quantiles per forecast__. Accepted values
-- include @0.01 to 0.99@ (increments of .01 only) and @mean@. The mean
-- forecast is different from the median (0.50) when the distribution is
-- not symmetric (for example, Beta and Negative Binomial). The default
-- value is @[\"0.1\", \"0.5\", \"0.9\"]@.
--
-- 'tags', 'createForecast_tags' - The optional metadata that you apply to the forecast to help you
-- categorize and organize them. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50.
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8.
--
-- -   Maximum value length - 256 Unicode characters in UTF-8.
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for keys as it is reserved for AWS use. You cannot
--     edit or delete tag keys with this prefix. Values can have this
--     prefix. If a tag value has @aws@ as its prefix but the key does not,
--     then Forecast considers it to be a user tag and will count against
--     the limit of 50 tags. Tags with only the key prefix of @aws@ do not
--     count against your tags per resource limit.
--
-- 'forecastName', 'createForecast_forecastName' - A name for the forecast.
--
-- 'predictorArn', 'createForecast_predictorArn' - The Amazon Resource Name (ARN) of the predictor to use to generate the
-- forecast.
newCreateForecast ::
  -- | 'forecastName'
  Prelude.Text ->
  -- | 'predictorArn'
  Prelude.Text ->
  CreateForecast
newCreateForecast :: Text -> Text -> CreateForecast
newCreateForecast Text
pForecastName_ Text
pPredictorArn_ =
  CreateForecast' :: Maybe (NonEmpty Text)
-> Maybe [Tag] -> Text -> Text -> CreateForecast
CreateForecast'
    { $sel:forecastTypes:CreateForecast' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateForecast' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:forecastName:CreateForecast' :: Text
forecastName = Text
pForecastName_,
      $sel:predictorArn:CreateForecast' :: Text
predictorArn = Text
pPredictorArn_
    }

-- | The quantiles at which probabilistic forecasts are generated. __You can
-- currently specify up to 5 quantiles per forecast__. Accepted values
-- include @0.01 to 0.99@ (increments of .01 only) and @mean@. The mean
-- forecast is different from the median (0.50) when the distribution is
-- not symmetric (for example, Beta and Negative Binomial). The default
-- value is @[\"0.1\", \"0.5\", \"0.9\"]@.
createForecast_forecastTypes :: Lens.Lens' CreateForecast (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
createForecast_forecastTypes :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreateForecast -> f CreateForecast
createForecast_forecastTypes = (CreateForecast -> Maybe (NonEmpty Text))
-> (CreateForecast -> Maybe (NonEmpty Text) -> CreateForecast)
-> Lens
     CreateForecast
     CreateForecast
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecast' {Maybe (NonEmpty Text)
forecastTypes :: Maybe (NonEmpty Text)
$sel:forecastTypes:CreateForecast' :: CreateForecast -> Maybe (NonEmpty Text)
forecastTypes} -> Maybe (NonEmpty Text)
forecastTypes) (\s :: CreateForecast
s@CreateForecast' {} Maybe (NonEmpty Text)
a -> CreateForecast
s {$sel:forecastTypes:CreateForecast' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
a} :: CreateForecast) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> CreateForecast -> f CreateForecast)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreateForecast
-> f CreateForecast
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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 AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The optional metadata that you apply to the forecast to help you
-- categorize and organize them. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50.
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8.
--
-- -   Maximum value length - 256 Unicode characters in UTF-8.
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for keys as it is reserved for AWS use. You cannot
--     edit or delete tag keys with this prefix. Values can have this
--     prefix. If a tag value has @aws@ as its prefix but the key does not,
--     then Forecast considers it to be a user tag and will count against
--     the limit of 50 tags. Tags with only the key prefix of @aws@ do not
--     count against your tags per resource limit.
createForecast_tags :: Lens.Lens' CreateForecast (Prelude.Maybe [Tag])
createForecast_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateForecast -> f CreateForecast
createForecast_tags = (CreateForecast -> Maybe [Tag])
-> (CreateForecast -> Maybe [Tag] -> CreateForecast)
-> Lens CreateForecast CreateForecast (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecast' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateForecast' :: CreateForecast -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateForecast
s@CreateForecast' {} Maybe [Tag]
a -> CreateForecast
s {$sel:tags:CreateForecast' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateForecast) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateForecast -> f CreateForecast)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateForecast
-> f CreateForecast
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A name for the forecast.
createForecast_forecastName :: Lens.Lens' CreateForecast Prelude.Text
createForecast_forecastName :: (Text -> f Text) -> CreateForecast -> f CreateForecast
createForecast_forecastName = (CreateForecast -> Text)
-> (CreateForecast -> Text -> CreateForecast)
-> Lens CreateForecast CreateForecast Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecast' {Text
forecastName :: Text
$sel:forecastName:CreateForecast' :: CreateForecast -> Text
forecastName} -> Text
forecastName) (\s :: CreateForecast
s@CreateForecast' {} Text
a -> CreateForecast
s {$sel:forecastName:CreateForecast' :: Text
forecastName = Text
a} :: CreateForecast)

-- | The Amazon Resource Name (ARN) of the predictor to use to generate the
-- forecast.
createForecast_predictorArn :: Lens.Lens' CreateForecast Prelude.Text
createForecast_predictorArn :: (Text -> f Text) -> CreateForecast -> f CreateForecast
createForecast_predictorArn = (CreateForecast -> Text)
-> (CreateForecast -> Text -> CreateForecast)
-> Lens CreateForecast CreateForecast Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateForecast' {Text
predictorArn :: Text
$sel:predictorArn:CreateForecast' :: CreateForecast -> Text
predictorArn} -> Text
predictorArn) (\s :: CreateForecast
s@CreateForecast' {} Text
a -> CreateForecast
s {$sel:predictorArn:CreateForecast' :: Text
predictorArn = Text
a} :: CreateForecast)

instance Core.AWSRequest CreateForecast where
  type
    AWSResponse CreateForecast =
      CreateForecastResponse
  request :: CreateForecast -> Request CreateForecast
request = Service -> CreateForecast -> Request CreateForecast
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateForecast
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateForecast)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateForecast))
-> Logger
-> Service
-> Proxy CreateForecast
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateForecast)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateForecastResponse
CreateForecastResponse'
            (Maybe Text -> Int -> CreateForecastResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateForecastResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ForecastArn")
            Either String (Int -> CreateForecastResponse)
-> Either String Int -> Either String CreateForecastResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateForecast

instance Prelude.NFData CreateForecast

instance Core.ToHeaders CreateForecast where
  toHeaders :: CreateForecast -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateForecast -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonForecast.CreateForecast" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateForecast where
  toJSON :: CreateForecast -> Value
toJSON CreateForecast' {Maybe [Tag]
Maybe (NonEmpty Text)
Text
predictorArn :: Text
forecastName :: Text
tags :: Maybe [Tag]
forecastTypes :: Maybe (NonEmpty Text)
$sel:predictorArn:CreateForecast' :: CreateForecast -> Text
$sel:forecastName:CreateForecast' :: CreateForecast -> Text
$sel:tags:CreateForecast' :: CreateForecast -> Maybe [Tag]
$sel:forecastTypes:CreateForecast' :: CreateForecast -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ForecastTypes" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
forecastTypes,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ForecastName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
forecastName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PredictorArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
predictorArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateForecastResponse' 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:
--
-- 'forecastArn', 'createForecastResponse_forecastArn' - The Amazon Resource Name (ARN) of the forecast.
--
-- 'httpStatus', 'createForecastResponse_httpStatus' - The response's http status code.
newCreateForecastResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateForecastResponse
newCreateForecastResponse :: Int -> CreateForecastResponse
newCreateForecastResponse Int
pHttpStatus_ =
  CreateForecastResponse' :: Maybe Text -> Int -> CreateForecastResponse
CreateForecastResponse'
    { $sel:forecastArn:CreateForecastResponse' :: Maybe Text
forecastArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateForecastResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData CreateForecastResponse