{-# 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.CreateAutoPredictor
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Amazon Forecast predictor.
--
-- Amazon Forecast creates predictors with AutoPredictor, which involves
-- applying the optimal combination of algorithms to each time series in
-- your datasets. You can use CreateAutoPredictor to create new predictors
-- or upgrade\/retrain existing predictors.
--
-- __Creating new predictors__
--
-- The following parameters are required when creating a new predictor:
--
-- -   @PredictorName@ - A unique name for the predictor.
--
-- -   @DatasetGroupArn@ - The ARN of the dataset group used to train the
--     predictor.
--
-- -   @ForecastFrequency@ - The granularity of your forecasts (hourly,
--     daily, weekly, etc).
--
-- -   @ForecastHorizon@ - The number of time-steps that the model
--     predicts. The forecast horizon is also called the prediction length.
--
-- When creating a new predictor, do not specify a value for
-- @ReferencePredictorArn@.
--
-- __Upgrading and retraining predictors__
--
-- The following parameters are required when retraining or upgrading a
-- predictor:
--
-- -   @PredictorName@ - A unique name for the predictor.
--
-- -   @ReferencePredictorArn@ - The ARN of the predictor to retrain or
--     upgrade.
--
-- When upgrading or retraining a predictor, only specify values for the
-- @ReferencePredictorArn@ and @PredictorName@.
module Amazonka.Forecast.CreateAutoPredictor
  ( -- * Creating a Request
    CreateAutoPredictor (..),
    newCreateAutoPredictor,

    -- * Request Lenses
    createAutoPredictor_dataConfig,
    createAutoPredictor_encryptionConfig,
    createAutoPredictor_explainPredictor,
    createAutoPredictor_forecastDimensions,
    createAutoPredictor_forecastFrequency,
    createAutoPredictor_forecastHorizon,
    createAutoPredictor_forecastTypes,
    createAutoPredictor_monitorConfig,
    createAutoPredictor_optimizationMetric,
    createAutoPredictor_referencePredictorArn,
    createAutoPredictor_tags,
    createAutoPredictor_timeAlignmentBoundary,
    createAutoPredictor_predictorName,

    -- * Destructuring the Response
    CreateAutoPredictorResponse (..),
    newCreateAutoPredictorResponse,

    -- * Response Lenses
    createAutoPredictorResponse_predictorArn,
    createAutoPredictorResponse_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:/ 'newCreateAutoPredictor' smart constructor.
data CreateAutoPredictor = CreateAutoPredictor'
  { -- | The data configuration for your dataset group and any additional
    -- datasets.
    CreateAutoPredictor -> Maybe DataConfig
dataConfig :: Prelude.Maybe DataConfig,
    CreateAutoPredictor -> Maybe EncryptionConfig
encryptionConfig :: Prelude.Maybe EncryptionConfig,
    -- | Create an Explainability resource for the predictor.
    CreateAutoPredictor -> Maybe Bool
explainPredictor :: Prelude.Maybe Prelude.Bool,
    -- | An array of dimension (field) names that specify how to group the
    -- generated forecast.
    --
    -- For example, if you are generating forecasts for item sales across all
    -- your stores, and your dataset contains a @store_id@ field, you would
    -- specify @store_id@ as a dimension to group sales forecasts for each
    -- store.
    CreateAutoPredictor -> Maybe (NonEmpty Text)
forecastDimensions :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The frequency of predictions in a forecast.
    --
    -- Valid intervals are Y (Year), M (Month), W (Week), D (Day), H (Hour),
    -- 30min (30 minutes), 15min (15 minutes), 10min (10 minutes), 5min (5
    -- minutes), and 1min (1 minute). For example, \"Y\" indicates every year
    -- and \"5min\" indicates every five minutes.
    --
    -- The frequency must be greater than or equal to the TARGET_TIME_SERIES
    -- dataset frequency.
    --
    -- When a RELATED_TIME_SERIES dataset is provided, the frequency must be
    -- equal to the RELATED_TIME_SERIES dataset frequency.
    CreateAutoPredictor -> Maybe Text
forecastFrequency :: Prelude.Maybe Prelude.Text,
    -- | The number of time-steps that the model predicts. The forecast horizon
    -- is also called the prediction length.
    --
    -- The maximum forecast horizon is the lesser of 500 time-steps or 1\/4 of
    -- the TARGET_TIME_SERIES dataset length. If you are retraining an existing
    -- AutoPredictor, then the maximum forecast horizon is the lesser of 500
    -- time-steps or 1\/3 of the TARGET_TIME_SERIES dataset length.
    --
    -- If you are upgrading to an AutoPredictor or retraining an existing
    -- AutoPredictor, you cannot update the forecast horizon parameter. You can
    -- meet this requirement by providing longer time-series in the dataset.
    CreateAutoPredictor -> Maybe Int
forecastHorizon :: Prelude.Maybe Prelude.Int,
    -- | The forecast types used to train a predictor. You can specify up to five
    -- forecast types. Forecast types can be quantiles from 0.01 to 0.99, by
    -- increments of 0.01 or higher. You can also specify the mean forecast
    -- with @mean@.
    CreateAutoPredictor -> Maybe (NonEmpty Text)
forecastTypes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The configuration details for predictor monitoring. Provide a name for
    -- the monitor resource to enable predictor monitoring.
    --
    -- Predictor monitoring allows you to see how your predictor\'s performance
    -- changes over time. For more information, see
    -- <https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring.html Predictor Monitoring>.
    CreateAutoPredictor -> Maybe MonitorConfig
monitorConfig :: Prelude.Maybe MonitorConfig,
    -- | The accuracy metric used to optimize the predictor.
    CreateAutoPredictor -> Maybe OptimizationMetric
optimizationMetric :: Prelude.Maybe OptimizationMetric,
    -- | The ARN of the predictor to retrain or upgrade. This parameter is only
    -- used when retraining or upgrading a predictor. When creating a new
    -- predictor, do not specify a value for this parameter.
    --
    -- When upgrading or retraining a predictor, only specify values for the
    -- @ReferencePredictorArn@ and @PredictorName@. The value for
    -- @PredictorName@ must be a unique predictor name.
    CreateAutoPredictor -> Maybe Text
referencePredictorArn :: Prelude.Maybe Prelude.Text,
    -- | Optional metadata to help you categorize and organize your predictors.
    -- Each tag consists of a key and an optional value, both of which you
    -- define. Tag keys and values are case sensitive.
    --
    -- The following restrictions apply to tags:
    --
    -- -   For each resource, each tag key must be unique and each tag key must
    --     have one value.
    --
    -- -   Maximum number of tags per resource: 50.
    --
    -- -   Maximum key length: 128 Unicode characters in UTF-8.
    --
    -- -   Maximum value length: 256 Unicode characters in UTF-8.
    --
    -- -   Accepted characters: all letters and numbers, spaces representable
    --     in UTF-8, and + - = . _ : \/ \@. If your tagging schema is used
    --     across other services and resources, the character restrictions of
    --     those services also apply.
    --
    -- -   Key prefixes cannot include any upper or lowercase combination of
    --     @aws:@ or @AWS:@. Values can have this prefix. If a tag value has
    --     @aws@ as its prefix but the key does not, 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. You cannot edit or delete tag keys with this prefix.
    CreateAutoPredictor -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The time boundary Forecast uses to align and aggregate any data that
    -- doesn\'t align with your forecast frequency. Provide the unit of time
    -- and the time boundary as a key value pair. For more information on
    -- specifying a time boundary, see
    -- <https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#specifying-time-boundary Specifying a Time Boundary>.
    -- If you don\'t provide a time boundary, Forecast uses a set of
    -- <https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#default-time-boundaries Default Time Boundaries>.
    CreateAutoPredictor -> Maybe TimeAlignmentBoundary
timeAlignmentBoundary :: Prelude.Maybe TimeAlignmentBoundary,
    -- | A unique name for the predictor
    CreateAutoPredictor -> Text
predictorName :: Prelude.Text
  }
  deriving (CreateAutoPredictor -> CreateAutoPredictor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAutoPredictor -> CreateAutoPredictor -> Bool
$c/= :: CreateAutoPredictor -> CreateAutoPredictor -> Bool
== :: CreateAutoPredictor -> CreateAutoPredictor -> Bool
$c== :: CreateAutoPredictor -> CreateAutoPredictor -> Bool
Prelude.Eq, Int -> CreateAutoPredictor -> ShowS
[CreateAutoPredictor] -> ShowS
CreateAutoPredictor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAutoPredictor] -> ShowS
$cshowList :: [CreateAutoPredictor] -> ShowS
show :: CreateAutoPredictor -> String
$cshow :: CreateAutoPredictor -> String
showsPrec :: Int -> CreateAutoPredictor -> ShowS
$cshowsPrec :: Int -> CreateAutoPredictor -> ShowS
Prelude.Show, forall x. Rep CreateAutoPredictor x -> CreateAutoPredictor
forall x. CreateAutoPredictor -> Rep CreateAutoPredictor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAutoPredictor x -> CreateAutoPredictor
$cfrom :: forall x. CreateAutoPredictor -> Rep CreateAutoPredictor x
Prelude.Generic)

-- |
-- Create a value of 'CreateAutoPredictor' 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:
--
-- 'dataConfig', 'createAutoPredictor_dataConfig' - The data configuration for your dataset group and any additional
-- datasets.
--
-- 'encryptionConfig', 'createAutoPredictor_encryptionConfig' - Undocumented member.
--
-- 'explainPredictor', 'createAutoPredictor_explainPredictor' - Create an Explainability resource for the predictor.
--
-- 'forecastDimensions', 'createAutoPredictor_forecastDimensions' - An array of dimension (field) names that specify how to group the
-- generated forecast.
--
-- For example, if you are generating forecasts for item sales across all
-- your stores, and your dataset contains a @store_id@ field, you would
-- specify @store_id@ as a dimension to group sales forecasts for each
-- store.
--
-- 'forecastFrequency', 'createAutoPredictor_forecastFrequency' - The frequency of predictions in a forecast.
--
-- Valid intervals are Y (Year), M (Month), W (Week), D (Day), H (Hour),
-- 30min (30 minutes), 15min (15 minutes), 10min (10 minutes), 5min (5
-- minutes), and 1min (1 minute). For example, \"Y\" indicates every year
-- and \"5min\" indicates every five minutes.
--
-- The frequency must be greater than or equal to the TARGET_TIME_SERIES
-- dataset frequency.
--
-- When a RELATED_TIME_SERIES dataset is provided, the frequency must be
-- equal to the RELATED_TIME_SERIES dataset frequency.
--
-- 'forecastHorizon', 'createAutoPredictor_forecastHorizon' - The number of time-steps that the model predicts. The forecast horizon
-- is also called the prediction length.
--
-- The maximum forecast horizon is the lesser of 500 time-steps or 1\/4 of
-- the TARGET_TIME_SERIES dataset length. If you are retraining an existing
-- AutoPredictor, then the maximum forecast horizon is the lesser of 500
-- time-steps or 1\/3 of the TARGET_TIME_SERIES dataset length.
--
-- If you are upgrading to an AutoPredictor or retraining an existing
-- AutoPredictor, you cannot update the forecast horizon parameter. You can
-- meet this requirement by providing longer time-series in the dataset.
--
-- 'forecastTypes', 'createAutoPredictor_forecastTypes' - The forecast types used to train a predictor. You can specify up to five
-- forecast types. Forecast types can be quantiles from 0.01 to 0.99, by
-- increments of 0.01 or higher. You can also specify the mean forecast
-- with @mean@.
--
-- 'monitorConfig', 'createAutoPredictor_monitorConfig' - The configuration details for predictor monitoring. Provide a name for
-- the monitor resource to enable predictor monitoring.
--
-- Predictor monitoring allows you to see how your predictor\'s performance
-- changes over time. For more information, see
-- <https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring.html Predictor Monitoring>.
--
-- 'optimizationMetric', 'createAutoPredictor_optimizationMetric' - The accuracy metric used to optimize the predictor.
--
-- 'referencePredictorArn', 'createAutoPredictor_referencePredictorArn' - The ARN of the predictor to retrain or upgrade. This parameter is only
-- used when retraining or upgrading a predictor. When creating a new
-- predictor, do not specify a value for this parameter.
--
-- When upgrading or retraining a predictor, only specify values for the
-- @ReferencePredictorArn@ and @PredictorName@. The value for
-- @PredictorName@ must be a unique predictor name.
--
-- 'tags', 'createAutoPredictor_tags' - Optional metadata to help you categorize and organize your predictors.
-- Each tag consists of a key and an optional value, both of which you
-- define. Tag keys and values are case sensitive.
--
-- The following restrictions apply to tags:
--
-- -   For each resource, each tag key must be unique and each tag key must
--     have one value.
--
-- -   Maximum number of tags per resource: 50.
--
-- -   Maximum key length: 128 Unicode characters in UTF-8.
--
-- -   Maximum value length: 256 Unicode characters in UTF-8.
--
-- -   Accepted characters: all letters and numbers, spaces representable
--     in UTF-8, and + - = . _ : \/ \@. If your tagging schema is used
--     across other services and resources, the character restrictions of
--     those services also apply.
--
-- -   Key prefixes cannot include any upper or lowercase combination of
--     @aws:@ or @AWS:@. Values can have this prefix. If a tag value has
--     @aws@ as its prefix but the key does not, 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. You cannot edit or delete tag keys with this prefix.
--
-- 'timeAlignmentBoundary', 'createAutoPredictor_timeAlignmentBoundary' - The time boundary Forecast uses to align and aggregate any data that
-- doesn\'t align with your forecast frequency. Provide the unit of time
-- and the time boundary as a key value pair. For more information on
-- specifying a time boundary, see
-- <https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#specifying-time-boundary Specifying a Time Boundary>.
-- If you don\'t provide a time boundary, Forecast uses a set of
-- <https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#default-time-boundaries Default Time Boundaries>.
--
-- 'predictorName', 'createAutoPredictor_predictorName' - A unique name for the predictor
newCreateAutoPredictor ::
  -- | 'predictorName'
  Prelude.Text ->
  CreateAutoPredictor
newCreateAutoPredictor :: Text -> CreateAutoPredictor
newCreateAutoPredictor Text
pPredictorName_ =
  CreateAutoPredictor'
    { $sel:dataConfig:CreateAutoPredictor' :: Maybe DataConfig
dataConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionConfig:CreateAutoPredictor' :: Maybe EncryptionConfig
encryptionConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:explainPredictor:CreateAutoPredictor' :: Maybe Bool
explainPredictor = forall a. Maybe a
Prelude.Nothing,
      $sel:forecastDimensions:CreateAutoPredictor' :: Maybe (NonEmpty Text)
forecastDimensions = forall a. Maybe a
Prelude.Nothing,
      $sel:forecastFrequency:CreateAutoPredictor' :: Maybe Text
forecastFrequency = forall a. Maybe a
Prelude.Nothing,
      $sel:forecastHorizon:CreateAutoPredictor' :: Maybe Int
forecastHorizon = forall a. Maybe a
Prelude.Nothing,
      $sel:forecastTypes:CreateAutoPredictor' :: Maybe (NonEmpty Text)
forecastTypes = forall a. Maybe a
Prelude.Nothing,
      $sel:monitorConfig:CreateAutoPredictor' :: Maybe MonitorConfig
monitorConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:optimizationMetric:CreateAutoPredictor' :: Maybe OptimizationMetric
optimizationMetric = forall a. Maybe a
Prelude.Nothing,
      $sel:referencePredictorArn:CreateAutoPredictor' :: Maybe Text
referencePredictorArn = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateAutoPredictor' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:timeAlignmentBoundary:CreateAutoPredictor' :: Maybe TimeAlignmentBoundary
timeAlignmentBoundary = forall a. Maybe a
Prelude.Nothing,
      $sel:predictorName:CreateAutoPredictor' :: Text
predictorName = Text
pPredictorName_
    }

-- | The data configuration for your dataset group and any additional
-- datasets.
createAutoPredictor_dataConfig :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe DataConfig)
createAutoPredictor_dataConfig :: Lens' CreateAutoPredictor (Maybe DataConfig)
createAutoPredictor_dataConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe DataConfig
dataConfig :: Maybe DataConfig
$sel:dataConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe DataConfig
dataConfig} -> Maybe DataConfig
dataConfig) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe DataConfig
a -> CreateAutoPredictor
s {$sel:dataConfig:CreateAutoPredictor' :: Maybe DataConfig
dataConfig = Maybe DataConfig
a} :: CreateAutoPredictor)

-- | Undocumented member.
createAutoPredictor_encryptionConfig :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe EncryptionConfig)
createAutoPredictor_encryptionConfig :: Lens' CreateAutoPredictor (Maybe EncryptionConfig)
createAutoPredictor_encryptionConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe EncryptionConfig
encryptionConfig :: Maybe EncryptionConfig
$sel:encryptionConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe EncryptionConfig
encryptionConfig} -> Maybe EncryptionConfig
encryptionConfig) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe EncryptionConfig
a -> CreateAutoPredictor
s {$sel:encryptionConfig:CreateAutoPredictor' :: Maybe EncryptionConfig
encryptionConfig = Maybe EncryptionConfig
a} :: CreateAutoPredictor)

-- | Create an Explainability resource for the predictor.
createAutoPredictor_explainPredictor :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe Prelude.Bool)
createAutoPredictor_explainPredictor :: Lens' CreateAutoPredictor (Maybe Bool)
createAutoPredictor_explainPredictor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe Bool
explainPredictor :: Maybe Bool
$sel:explainPredictor:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Bool
explainPredictor} -> Maybe Bool
explainPredictor) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe Bool
a -> CreateAutoPredictor
s {$sel:explainPredictor:CreateAutoPredictor' :: Maybe Bool
explainPredictor = Maybe Bool
a} :: CreateAutoPredictor)

-- | An array of dimension (field) names that specify how to group the
-- generated forecast.
--
-- For example, if you are generating forecasts for item sales across all
-- your stores, and your dataset contains a @store_id@ field, you would
-- specify @store_id@ as a dimension to group sales forecasts for each
-- store.
createAutoPredictor_forecastDimensions :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
createAutoPredictor_forecastDimensions :: Lens' CreateAutoPredictor (Maybe (NonEmpty Text))
createAutoPredictor_forecastDimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe (NonEmpty Text)
forecastDimensions :: Maybe (NonEmpty Text)
$sel:forecastDimensions:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
forecastDimensions} -> Maybe (NonEmpty Text)
forecastDimensions) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe (NonEmpty Text)
a -> CreateAutoPredictor
s {$sel:forecastDimensions:CreateAutoPredictor' :: Maybe (NonEmpty Text)
forecastDimensions = Maybe (NonEmpty Text)
a} :: CreateAutoPredictor) 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 frequency of predictions in a forecast.
--
-- Valid intervals are Y (Year), M (Month), W (Week), D (Day), H (Hour),
-- 30min (30 minutes), 15min (15 minutes), 10min (10 minutes), 5min (5
-- minutes), and 1min (1 minute). For example, \"Y\" indicates every year
-- and \"5min\" indicates every five minutes.
--
-- The frequency must be greater than or equal to the TARGET_TIME_SERIES
-- dataset frequency.
--
-- When a RELATED_TIME_SERIES dataset is provided, the frequency must be
-- equal to the RELATED_TIME_SERIES dataset frequency.
createAutoPredictor_forecastFrequency :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe Prelude.Text)
createAutoPredictor_forecastFrequency :: Lens' CreateAutoPredictor (Maybe Text)
createAutoPredictor_forecastFrequency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe Text
forecastFrequency :: Maybe Text
$sel:forecastFrequency:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
forecastFrequency} -> Maybe Text
forecastFrequency) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe Text
a -> CreateAutoPredictor
s {$sel:forecastFrequency:CreateAutoPredictor' :: Maybe Text
forecastFrequency = Maybe Text
a} :: CreateAutoPredictor)

-- | The number of time-steps that the model predicts. The forecast horizon
-- is also called the prediction length.
--
-- The maximum forecast horizon is the lesser of 500 time-steps or 1\/4 of
-- the TARGET_TIME_SERIES dataset length. If you are retraining an existing
-- AutoPredictor, then the maximum forecast horizon is the lesser of 500
-- time-steps or 1\/3 of the TARGET_TIME_SERIES dataset length.
--
-- If you are upgrading to an AutoPredictor or retraining an existing
-- AutoPredictor, you cannot update the forecast horizon parameter. You can
-- meet this requirement by providing longer time-series in the dataset.
createAutoPredictor_forecastHorizon :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe Prelude.Int)
createAutoPredictor_forecastHorizon :: Lens' CreateAutoPredictor (Maybe Int)
createAutoPredictor_forecastHorizon = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe Int
forecastHorizon :: Maybe Int
$sel:forecastHorizon:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Int
forecastHorizon} -> Maybe Int
forecastHorizon) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe Int
a -> CreateAutoPredictor
s {$sel:forecastHorizon:CreateAutoPredictor' :: Maybe Int
forecastHorizon = Maybe Int
a} :: CreateAutoPredictor)

-- | The forecast types used to train a predictor. You can specify up to five
-- forecast types. Forecast types can be quantiles from 0.01 to 0.99, by
-- increments of 0.01 or higher. You can also specify the mean forecast
-- with @mean@.
createAutoPredictor_forecastTypes :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
createAutoPredictor_forecastTypes :: Lens' CreateAutoPredictor (Maybe (NonEmpty Text))
createAutoPredictor_forecastTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe (NonEmpty Text)
forecastTypes :: Maybe (NonEmpty Text)
$sel:forecastTypes:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
forecastTypes} -> Maybe (NonEmpty Text)
forecastTypes) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe (NonEmpty Text)
a -> CreateAutoPredictor
s {$sel:forecastTypes:CreateAutoPredictor' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
a} :: CreateAutoPredictor) 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 configuration details for predictor monitoring. Provide a name for
-- the monitor resource to enable predictor monitoring.
--
-- Predictor monitoring allows you to see how your predictor\'s performance
-- changes over time. For more information, see
-- <https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring.html Predictor Monitoring>.
createAutoPredictor_monitorConfig :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe MonitorConfig)
createAutoPredictor_monitorConfig :: Lens' CreateAutoPredictor (Maybe MonitorConfig)
createAutoPredictor_monitorConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe MonitorConfig
monitorConfig :: Maybe MonitorConfig
$sel:monitorConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe MonitorConfig
monitorConfig} -> Maybe MonitorConfig
monitorConfig) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe MonitorConfig
a -> CreateAutoPredictor
s {$sel:monitorConfig:CreateAutoPredictor' :: Maybe MonitorConfig
monitorConfig = Maybe MonitorConfig
a} :: CreateAutoPredictor)

-- | The accuracy metric used to optimize the predictor.
createAutoPredictor_optimizationMetric :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe OptimizationMetric)
createAutoPredictor_optimizationMetric :: Lens' CreateAutoPredictor (Maybe OptimizationMetric)
createAutoPredictor_optimizationMetric = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe OptimizationMetric
optimizationMetric :: Maybe OptimizationMetric
$sel:optimizationMetric:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe OptimizationMetric
optimizationMetric} -> Maybe OptimizationMetric
optimizationMetric) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe OptimizationMetric
a -> CreateAutoPredictor
s {$sel:optimizationMetric:CreateAutoPredictor' :: Maybe OptimizationMetric
optimizationMetric = Maybe OptimizationMetric
a} :: CreateAutoPredictor)

-- | The ARN of the predictor to retrain or upgrade. This parameter is only
-- used when retraining or upgrading a predictor. When creating a new
-- predictor, do not specify a value for this parameter.
--
-- When upgrading or retraining a predictor, only specify values for the
-- @ReferencePredictorArn@ and @PredictorName@. The value for
-- @PredictorName@ must be a unique predictor name.
createAutoPredictor_referencePredictorArn :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe Prelude.Text)
createAutoPredictor_referencePredictorArn :: Lens' CreateAutoPredictor (Maybe Text)
createAutoPredictor_referencePredictorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe Text
referencePredictorArn :: Maybe Text
$sel:referencePredictorArn:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
referencePredictorArn} -> Maybe Text
referencePredictorArn) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe Text
a -> CreateAutoPredictor
s {$sel:referencePredictorArn:CreateAutoPredictor' :: Maybe Text
referencePredictorArn = Maybe Text
a} :: CreateAutoPredictor)

-- | Optional metadata to help you categorize and organize your predictors.
-- Each tag consists of a key and an optional value, both of which you
-- define. Tag keys and values are case sensitive.
--
-- The following restrictions apply to tags:
--
-- -   For each resource, each tag key must be unique and each tag key must
--     have one value.
--
-- -   Maximum number of tags per resource: 50.
--
-- -   Maximum key length: 128 Unicode characters in UTF-8.
--
-- -   Maximum value length: 256 Unicode characters in UTF-8.
--
-- -   Accepted characters: all letters and numbers, spaces representable
--     in UTF-8, and + - = . _ : \/ \@. If your tagging schema is used
--     across other services and resources, the character restrictions of
--     those services also apply.
--
-- -   Key prefixes cannot include any upper or lowercase combination of
--     @aws:@ or @AWS:@. Values can have this prefix. If a tag value has
--     @aws@ as its prefix but the key does not, 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. You cannot edit or delete tag keys with this prefix.
createAutoPredictor_tags :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe [Tag])
createAutoPredictor_tags :: Lens' CreateAutoPredictor (Maybe [Tag])
createAutoPredictor_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe [Tag]
a -> CreateAutoPredictor
s {$sel:tags:CreateAutoPredictor' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateAutoPredictor) 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 time boundary Forecast uses to align and aggregate any data that
-- doesn\'t align with your forecast frequency. Provide the unit of time
-- and the time boundary as a key value pair. For more information on
-- specifying a time boundary, see
-- <https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#specifying-time-boundary Specifying a Time Boundary>.
-- If you don\'t provide a time boundary, Forecast uses a set of
-- <https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#default-time-boundaries Default Time Boundaries>.
createAutoPredictor_timeAlignmentBoundary :: Lens.Lens' CreateAutoPredictor (Prelude.Maybe TimeAlignmentBoundary)
createAutoPredictor_timeAlignmentBoundary :: Lens' CreateAutoPredictor (Maybe TimeAlignmentBoundary)
createAutoPredictor_timeAlignmentBoundary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Maybe TimeAlignmentBoundary
timeAlignmentBoundary :: Maybe TimeAlignmentBoundary
$sel:timeAlignmentBoundary:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe TimeAlignmentBoundary
timeAlignmentBoundary} -> Maybe TimeAlignmentBoundary
timeAlignmentBoundary) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Maybe TimeAlignmentBoundary
a -> CreateAutoPredictor
s {$sel:timeAlignmentBoundary:CreateAutoPredictor' :: Maybe TimeAlignmentBoundary
timeAlignmentBoundary = Maybe TimeAlignmentBoundary
a} :: CreateAutoPredictor)

-- | A unique name for the predictor
createAutoPredictor_predictorName :: Lens.Lens' CreateAutoPredictor Prelude.Text
createAutoPredictor_predictorName :: Lens' CreateAutoPredictor Text
createAutoPredictor_predictorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictor' {Text
predictorName :: Text
$sel:predictorName:CreateAutoPredictor' :: CreateAutoPredictor -> Text
predictorName} -> Text
predictorName) (\s :: CreateAutoPredictor
s@CreateAutoPredictor' {} Text
a -> CreateAutoPredictor
s {$sel:predictorName:CreateAutoPredictor' :: Text
predictorName = Text
a} :: CreateAutoPredictor)

instance Core.AWSRequest CreateAutoPredictor where
  type
    AWSResponse CreateAutoPredictor =
      CreateAutoPredictorResponse
  request :: (Service -> Service)
-> CreateAutoPredictor -> Request CreateAutoPredictor
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 CreateAutoPredictor
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAutoPredictor)))
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 -> CreateAutoPredictorResponse
CreateAutoPredictorResponse'
            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
"PredictorArn")
            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 CreateAutoPredictor where
  hashWithSalt :: Int -> CreateAutoPredictor -> Int
hashWithSalt Int
_salt CreateAutoPredictor' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe (NonEmpty Text)
Maybe Text
Maybe DataConfig
Maybe EncryptionConfig
Maybe MonitorConfig
Maybe OptimizationMetric
Maybe TimeAlignmentBoundary
Text
predictorName :: Text
timeAlignmentBoundary :: Maybe TimeAlignmentBoundary
tags :: Maybe [Tag]
referencePredictorArn :: Maybe Text
optimizationMetric :: Maybe OptimizationMetric
monitorConfig :: Maybe MonitorConfig
forecastTypes :: Maybe (NonEmpty Text)
forecastHorizon :: Maybe Int
forecastFrequency :: Maybe Text
forecastDimensions :: Maybe (NonEmpty Text)
explainPredictor :: Maybe Bool
encryptionConfig :: Maybe EncryptionConfig
dataConfig :: Maybe DataConfig
$sel:predictorName:CreateAutoPredictor' :: CreateAutoPredictor -> Text
$sel:timeAlignmentBoundary:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe TimeAlignmentBoundary
$sel:tags:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe [Tag]
$sel:referencePredictorArn:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
$sel:optimizationMetric:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe OptimizationMetric
$sel:monitorConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe MonitorConfig
$sel:forecastTypes:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
$sel:forecastHorizon:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Int
$sel:forecastFrequency:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
$sel:forecastDimensions:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
$sel:explainPredictor:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Bool
$sel:encryptionConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe EncryptionConfig
$sel:dataConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe DataConfig
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataConfig
dataConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EncryptionConfig
encryptionConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
explainPredictor
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
forecastDimensions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
forecastFrequency
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
forecastHorizon
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
forecastTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MonitorConfig
monitorConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OptimizationMetric
optimizationMetric
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
referencePredictorArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TimeAlignmentBoundary
timeAlignmentBoundary
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
predictorName

instance Prelude.NFData CreateAutoPredictor where
  rnf :: CreateAutoPredictor -> ()
rnf CreateAutoPredictor' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe (NonEmpty Text)
Maybe Text
Maybe DataConfig
Maybe EncryptionConfig
Maybe MonitorConfig
Maybe OptimizationMetric
Maybe TimeAlignmentBoundary
Text
predictorName :: Text
timeAlignmentBoundary :: Maybe TimeAlignmentBoundary
tags :: Maybe [Tag]
referencePredictorArn :: Maybe Text
optimizationMetric :: Maybe OptimizationMetric
monitorConfig :: Maybe MonitorConfig
forecastTypes :: Maybe (NonEmpty Text)
forecastHorizon :: Maybe Int
forecastFrequency :: Maybe Text
forecastDimensions :: Maybe (NonEmpty Text)
explainPredictor :: Maybe Bool
encryptionConfig :: Maybe EncryptionConfig
dataConfig :: Maybe DataConfig
$sel:predictorName:CreateAutoPredictor' :: CreateAutoPredictor -> Text
$sel:timeAlignmentBoundary:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe TimeAlignmentBoundary
$sel:tags:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe [Tag]
$sel:referencePredictorArn:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
$sel:optimizationMetric:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe OptimizationMetric
$sel:monitorConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe MonitorConfig
$sel:forecastTypes:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
$sel:forecastHorizon:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Int
$sel:forecastFrequency:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
$sel:forecastDimensions:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
$sel:explainPredictor:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Bool
$sel:encryptionConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe EncryptionConfig
$sel:dataConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe DataConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DataConfig
dataConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EncryptionConfig
encryptionConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
explainPredictor
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
forecastDimensions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
forecastFrequency
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
forecastHorizon
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
forecastTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MonitorConfig
monitorConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OptimizationMetric
optimizationMetric
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
referencePredictorArn
      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 Maybe TimeAlignmentBoundary
timeAlignmentBoundary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
predictorName

instance Data.ToHeaders CreateAutoPredictor where
  toHeaders :: CreateAutoPredictor -> 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.CreateAutoPredictor" ::
                          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 CreateAutoPredictor where
  toJSON :: CreateAutoPredictor -> Value
toJSON CreateAutoPredictor' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe (NonEmpty Text)
Maybe Text
Maybe DataConfig
Maybe EncryptionConfig
Maybe MonitorConfig
Maybe OptimizationMetric
Maybe TimeAlignmentBoundary
Text
predictorName :: Text
timeAlignmentBoundary :: Maybe TimeAlignmentBoundary
tags :: Maybe [Tag]
referencePredictorArn :: Maybe Text
optimizationMetric :: Maybe OptimizationMetric
monitorConfig :: Maybe MonitorConfig
forecastTypes :: Maybe (NonEmpty Text)
forecastHorizon :: Maybe Int
forecastFrequency :: Maybe Text
forecastDimensions :: Maybe (NonEmpty Text)
explainPredictor :: Maybe Bool
encryptionConfig :: Maybe EncryptionConfig
dataConfig :: Maybe DataConfig
$sel:predictorName:CreateAutoPredictor' :: CreateAutoPredictor -> Text
$sel:timeAlignmentBoundary:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe TimeAlignmentBoundary
$sel:tags:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe [Tag]
$sel:referencePredictorArn:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
$sel:optimizationMetric:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe OptimizationMetric
$sel:monitorConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe MonitorConfig
$sel:forecastTypes:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
$sel:forecastHorizon:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Int
$sel:forecastFrequency:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Text
$sel:forecastDimensions:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe (NonEmpty Text)
$sel:explainPredictor:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe Bool
$sel:encryptionConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe EncryptionConfig
$sel:dataConfig:CreateAutoPredictor' :: CreateAutoPredictor -> Maybe DataConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DataConfig" 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 DataConfig
dataConfig,
            (Key
"EncryptionConfig" 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 EncryptionConfig
encryptionConfig,
            (Key
"ExplainPredictor" 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 Bool
explainPredictor,
            (Key
"ForecastDimensions" 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 (NonEmpty Text)
forecastDimensions,
            (Key
"ForecastFrequency" 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
forecastFrequency,
            (Key
"ForecastHorizon" 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 Int
forecastHorizon,
            (Key
"ForecastTypes" 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 (NonEmpty Text)
forecastTypes,
            (Key
"MonitorConfig" 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 MonitorConfig
monitorConfig,
            (Key
"OptimizationMetric" 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 OptimizationMetric
optimizationMetric,
            (Key
"ReferencePredictorArn" 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
referencePredictorArn,
            (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
"TimeAlignmentBoundary" 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 TimeAlignmentBoundary
timeAlignmentBoundary,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"PredictorName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
predictorName)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateAutoPredictorResponse' 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:
--
-- 'predictorArn', 'createAutoPredictorResponse_predictorArn' - The Amazon Resource Name (ARN) of the predictor.
--
-- 'httpStatus', 'createAutoPredictorResponse_httpStatus' - The response's http status code.
newCreateAutoPredictorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAutoPredictorResponse
newCreateAutoPredictorResponse :: Int -> CreateAutoPredictorResponse
newCreateAutoPredictorResponse Int
pHttpStatus_ =
  CreateAutoPredictorResponse'
    { $sel:predictorArn:CreateAutoPredictorResponse' :: Maybe Text
predictorArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAutoPredictorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the predictor.
createAutoPredictorResponse_predictorArn :: Lens.Lens' CreateAutoPredictorResponse (Prelude.Maybe Prelude.Text)
createAutoPredictorResponse_predictorArn :: Lens' CreateAutoPredictorResponse (Maybe Text)
createAutoPredictorResponse_predictorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoPredictorResponse' {Maybe Text
predictorArn :: Maybe Text
$sel:predictorArn:CreateAutoPredictorResponse' :: CreateAutoPredictorResponse -> Maybe Text
predictorArn} -> Maybe Text
predictorArn) (\s :: CreateAutoPredictorResponse
s@CreateAutoPredictorResponse' {} Maybe Text
a -> CreateAutoPredictorResponse
s {$sel:predictorArn:CreateAutoPredictorResponse' :: Maybe Text
predictorArn = Maybe Text
a} :: CreateAutoPredictorResponse)

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

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