{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.QuickSight.Types.TimeBasedForecastProperties
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.TimeBasedForecastProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The forecast properties setup of a forecast in the line chart.
--
-- /See:/ 'newTimeBasedForecastProperties' smart constructor.
data TimeBasedForecastProperties = TimeBasedForecastProperties'
  { -- | The lower boundary setup of a forecast computation.
    TimeBasedForecastProperties -> Maybe Double
lowerBoundary :: Prelude.Maybe Prelude.Double,
    -- | The periods backward setup of a forecast computation.
    TimeBasedForecastProperties -> Maybe Natural
periodsBackward :: Prelude.Maybe Prelude.Natural,
    -- | The periods forward setup of a forecast computation.
    TimeBasedForecastProperties -> Maybe Natural
periodsForward :: Prelude.Maybe Prelude.Natural,
    -- | The prediction interval setup of a forecast computation.
    TimeBasedForecastProperties -> Maybe Natural
predictionInterval :: Prelude.Maybe Prelude.Natural,
    -- | The seasonality setup of a forecast computation. Choose one of the
    -- following options:
    --
    -- -   @NULL@: The input is set to @NULL@.
    --
    -- -   @NON_NULL@: The input is set to a custom value.
    TimeBasedForecastProperties -> Maybe Natural
seasonality :: Prelude.Maybe Prelude.Natural,
    -- | The upper boundary setup of a forecast computation.
    TimeBasedForecastProperties -> Maybe Double
upperBoundary :: Prelude.Maybe Prelude.Double
  }
  deriving (TimeBasedForecastProperties -> TimeBasedForecastProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TimeBasedForecastProperties -> TimeBasedForecastProperties -> Bool
$c/= :: TimeBasedForecastProperties -> TimeBasedForecastProperties -> Bool
== :: TimeBasedForecastProperties -> TimeBasedForecastProperties -> Bool
$c== :: TimeBasedForecastProperties -> TimeBasedForecastProperties -> Bool
Prelude.Eq, ReadPrec [TimeBasedForecastProperties]
ReadPrec TimeBasedForecastProperties
Int -> ReadS TimeBasedForecastProperties
ReadS [TimeBasedForecastProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TimeBasedForecastProperties]
$creadListPrec :: ReadPrec [TimeBasedForecastProperties]
readPrec :: ReadPrec TimeBasedForecastProperties
$creadPrec :: ReadPrec TimeBasedForecastProperties
readList :: ReadS [TimeBasedForecastProperties]
$creadList :: ReadS [TimeBasedForecastProperties]
readsPrec :: Int -> ReadS TimeBasedForecastProperties
$creadsPrec :: Int -> ReadS TimeBasedForecastProperties
Prelude.Read, Int -> TimeBasedForecastProperties -> ShowS
[TimeBasedForecastProperties] -> ShowS
TimeBasedForecastProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TimeBasedForecastProperties] -> ShowS
$cshowList :: [TimeBasedForecastProperties] -> ShowS
show :: TimeBasedForecastProperties -> String
$cshow :: TimeBasedForecastProperties -> String
showsPrec :: Int -> TimeBasedForecastProperties -> ShowS
$cshowsPrec :: Int -> TimeBasedForecastProperties -> ShowS
Prelude.Show, forall x.
Rep TimeBasedForecastProperties x -> TimeBasedForecastProperties
forall x.
TimeBasedForecastProperties -> Rep TimeBasedForecastProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TimeBasedForecastProperties x -> TimeBasedForecastProperties
$cfrom :: forall x.
TimeBasedForecastProperties -> Rep TimeBasedForecastProperties x
Prelude.Generic)

-- |
-- Create a value of 'TimeBasedForecastProperties' 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:
--
-- 'lowerBoundary', 'timeBasedForecastProperties_lowerBoundary' - The lower boundary setup of a forecast computation.
--
-- 'periodsBackward', 'timeBasedForecastProperties_periodsBackward' - The periods backward setup of a forecast computation.
--
-- 'periodsForward', 'timeBasedForecastProperties_periodsForward' - The periods forward setup of a forecast computation.
--
-- 'predictionInterval', 'timeBasedForecastProperties_predictionInterval' - The prediction interval setup of a forecast computation.
--
-- 'seasonality', 'timeBasedForecastProperties_seasonality' - The seasonality setup of a forecast computation. Choose one of the
-- following options:
--
-- -   @NULL@: The input is set to @NULL@.
--
-- -   @NON_NULL@: The input is set to a custom value.
--
-- 'upperBoundary', 'timeBasedForecastProperties_upperBoundary' - The upper boundary setup of a forecast computation.
newTimeBasedForecastProperties ::
  TimeBasedForecastProperties
newTimeBasedForecastProperties :: TimeBasedForecastProperties
newTimeBasedForecastProperties =
  TimeBasedForecastProperties'
    { $sel:lowerBoundary:TimeBasedForecastProperties' :: Maybe Double
lowerBoundary =
        forall a. Maybe a
Prelude.Nothing,
      $sel:periodsBackward:TimeBasedForecastProperties' :: Maybe Natural
periodsBackward = forall a. Maybe a
Prelude.Nothing,
      $sel:periodsForward:TimeBasedForecastProperties' :: Maybe Natural
periodsForward = forall a. Maybe a
Prelude.Nothing,
      $sel:predictionInterval:TimeBasedForecastProperties' :: Maybe Natural
predictionInterval = forall a. Maybe a
Prelude.Nothing,
      $sel:seasonality:TimeBasedForecastProperties' :: Maybe Natural
seasonality = forall a. Maybe a
Prelude.Nothing,
      $sel:upperBoundary:TimeBasedForecastProperties' :: Maybe Double
upperBoundary = forall a. Maybe a
Prelude.Nothing
    }

-- | The lower boundary setup of a forecast computation.
timeBasedForecastProperties_lowerBoundary :: Lens.Lens' TimeBasedForecastProperties (Prelude.Maybe Prelude.Double)
timeBasedForecastProperties_lowerBoundary :: Lens' TimeBasedForecastProperties (Maybe Double)
timeBasedForecastProperties_lowerBoundary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeBasedForecastProperties' {Maybe Double
lowerBoundary :: Maybe Double
$sel:lowerBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
lowerBoundary} -> Maybe Double
lowerBoundary) (\s :: TimeBasedForecastProperties
s@TimeBasedForecastProperties' {} Maybe Double
a -> TimeBasedForecastProperties
s {$sel:lowerBoundary:TimeBasedForecastProperties' :: Maybe Double
lowerBoundary = Maybe Double
a} :: TimeBasedForecastProperties)

-- | The periods backward setup of a forecast computation.
timeBasedForecastProperties_periodsBackward :: Lens.Lens' TimeBasedForecastProperties (Prelude.Maybe Prelude.Natural)
timeBasedForecastProperties_periodsBackward :: Lens' TimeBasedForecastProperties (Maybe Natural)
timeBasedForecastProperties_periodsBackward = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeBasedForecastProperties' {Maybe Natural
periodsBackward :: Maybe Natural
$sel:periodsBackward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
periodsBackward} -> Maybe Natural
periodsBackward) (\s :: TimeBasedForecastProperties
s@TimeBasedForecastProperties' {} Maybe Natural
a -> TimeBasedForecastProperties
s {$sel:periodsBackward:TimeBasedForecastProperties' :: Maybe Natural
periodsBackward = Maybe Natural
a} :: TimeBasedForecastProperties)

-- | The periods forward setup of a forecast computation.
timeBasedForecastProperties_periodsForward :: Lens.Lens' TimeBasedForecastProperties (Prelude.Maybe Prelude.Natural)
timeBasedForecastProperties_periodsForward :: Lens' TimeBasedForecastProperties (Maybe Natural)
timeBasedForecastProperties_periodsForward = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeBasedForecastProperties' {Maybe Natural
periodsForward :: Maybe Natural
$sel:periodsForward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
periodsForward} -> Maybe Natural
periodsForward) (\s :: TimeBasedForecastProperties
s@TimeBasedForecastProperties' {} Maybe Natural
a -> TimeBasedForecastProperties
s {$sel:periodsForward:TimeBasedForecastProperties' :: Maybe Natural
periodsForward = Maybe Natural
a} :: TimeBasedForecastProperties)

-- | The prediction interval setup of a forecast computation.
timeBasedForecastProperties_predictionInterval :: Lens.Lens' TimeBasedForecastProperties (Prelude.Maybe Prelude.Natural)
timeBasedForecastProperties_predictionInterval :: Lens' TimeBasedForecastProperties (Maybe Natural)
timeBasedForecastProperties_predictionInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeBasedForecastProperties' {Maybe Natural
predictionInterval :: Maybe Natural
$sel:predictionInterval:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
predictionInterval} -> Maybe Natural
predictionInterval) (\s :: TimeBasedForecastProperties
s@TimeBasedForecastProperties' {} Maybe Natural
a -> TimeBasedForecastProperties
s {$sel:predictionInterval:TimeBasedForecastProperties' :: Maybe Natural
predictionInterval = Maybe Natural
a} :: TimeBasedForecastProperties)

-- | The seasonality setup of a forecast computation. Choose one of the
-- following options:
--
-- -   @NULL@: The input is set to @NULL@.
--
-- -   @NON_NULL@: The input is set to a custom value.
timeBasedForecastProperties_seasonality :: Lens.Lens' TimeBasedForecastProperties (Prelude.Maybe Prelude.Natural)
timeBasedForecastProperties_seasonality :: Lens' TimeBasedForecastProperties (Maybe Natural)
timeBasedForecastProperties_seasonality = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeBasedForecastProperties' {Maybe Natural
seasonality :: Maybe Natural
$sel:seasonality:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
seasonality} -> Maybe Natural
seasonality) (\s :: TimeBasedForecastProperties
s@TimeBasedForecastProperties' {} Maybe Natural
a -> TimeBasedForecastProperties
s {$sel:seasonality:TimeBasedForecastProperties' :: Maybe Natural
seasonality = Maybe Natural
a} :: TimeBasedForecastProperties)

-- | The upper boundary setup of a forecast computation.
timeBasedForecastProperties_upperBoundary :: Lens.Lens' TimeBasedForecastProperties (Prelude.Maybe Prelude.Double)
timeBasedForecastProperties_upperBoundary :: Lens' TimeBasedForecastProperties (Maybe Double)
timeBasedForecastProperties_upperBoundary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeBasedForecastProperties' {Maybe Double
upperBoundary :: Maybe Double
$sel:upperBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
upperBoundary} -> Maybe Double
upperBoundary) (\s :: TimeBasedForecastProperties
s@TimeBasedForecastProperties' {} Maybe Double
a -> TimeBasedForecastProperties
s {$sel:upperBoundary:TimeBasedForecastProperties' :: Maybe Double
upperBoundary = Maybe Double
a} :: TimeBasedForecastProperties)

instance Data.FromJSON TimeBasedForecastProperties where
  parseJSON :: Value -> Parser TimeBasedForecastProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TimeBasedForecastProperties"
      ( \Object
x ->
          Maybe Double
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Double
-> TimeBasedForecastProperties
TimeBasedForecastProperties'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LowerBoundary")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PeriodsBackward")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PeriodsForward")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PredictionInterval")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Seasonality")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UpperBoundary")
      )

instance Prelude.Hashable TimeBasedForecastProperties where
  hashWithSalt :: Int -> TimeBasedForecastProperties -> Int
hashWithSalt Int
_salt TimeBasedForecastProperties' {Maybe Double
Maybe Natural
upperBoundary :: Maybe Double
seasonality :: Maybe Natural
predictionInterval :: Maybe Natural
periodsForward :: Maybe Natural
periodsBackward :: Maybe Natural
lowerBoundary :: Maybe Double
$sel:upperBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
$sel:seasonality:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:predictionInterval:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:periodsForward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:periodsBackward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:lowerBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
lowerBoundary
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
periodsBackward
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
periodsForward
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
predictionInterval
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
seasonality
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
upperBoundary

instance Prelude.NFData TimeBasedForecastProperties where
  rnf :: TimeBasedForecastProperties -> ()
rnf TimeBasedForecastProperties' {Maybe Double
Maybe Natural
upperBoundary :: Maybe Double
seasonality :: Maybe Natural
predictionInterval :: Maybe Natural
periodsForward :: Maybe Natural
periodsBackward :: Maybe Natural
lowerBoundary :: Maybe Double
$sel:upperBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
$sel:seasonality:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:predictionInterval:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:periodsForward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:periodsBackward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:lowerBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
lowerBoundary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
periodsBackward
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
periodsForward
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
predictionInterval
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
seasonality
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
upperBoundary

instance Data.ToJSON TimeBasedForecastProperties where
  toJSON :: TimeBasedForecastProperties -> Value
toJSON TimeBasedForecastProperties' {Maybe Double
Maybe Natural
upperBoundary :: Maybe Double
seasonality :: Maybe Natural
predictionInterval :: Maybe Natural
periodsForward :: Maybe Natural
periodsBackward :: Maybe Natural
lowerBoundary :: Maybe Double
$sel:upperBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
$sel:seasonality:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:predictionInterval:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:periodsForward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:periodsBackward:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Natural
$sel:lowerBoundary:TimeBasedForecastProperties' :: TimeBasedForecastProperties -> Maybe Double
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"LowerBoundary" 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 Double
lowerBoundary,
            (Key
"PeriodsBackward" 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 Natural
periodsBackward,
            (Key
"PeriodsForward" 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 Natural
periodsForward,
            (Key
"PredictionInterval" 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 Natural
predictionInterval,
            (Key
"Seasonality" 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 Natural
seasonality,
            (Key
"UpperBoundary" 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 Double
upperBoundary
          ]
      )