{-# 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.Forecast.Types.MonitorDataSource
-- 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.Forecast.Types.MonitorDataSource 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 source of the data the monitor used during the evaluation.
--
-- /See:/ 'newMonitorDataSource' smart constructor.
data MonitorDataSource = MonitorDataSource'
  { -- | The Amazon Resource Name (ARN) of the dataset import job used to import
    -- the data that initiated the monitor evaluation.
    MonitorDataSource -> Maybe Text
datasetImportJobArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the forecast the monitor used during
    -- the evaluation.
    MonitorDataSource -> Maybe Text
forecastArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the predictor resource you are
    -- monitoring.
    MonitorDataSource -> Maybe Text
predictorArn :: Prelude.Maybe Prelude.Text
  }
  deriving (MonitorDataSource -> MonitorDataSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitorDataSource -> MonitorDataSource -> Bool
$c/= :: MonitorDataSource -> MonitorDataSource -> Bool
== :: MonitorDataSource -> MonitorDataSource -> Bool
$c== :: MonitorDataSource -> MonitorDataSource -> Bool
Prelude.Eq, ReadPrec [MonitorDataSource]
ReadPrec MonitorDataSource
Int -> ReadS MonitorDataSource
ReadS [MonitorDataSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitorDataSource]
$creadListPrec :: ReadPrec [MonitorDataSource]
readPrec :: ReadPrec MonitorDataSource
$creadPrec :: ReadPrec MonitorDataSource
readList :: ReadS [MonitorDataSource]
$creadList :: ReadS [MonitorDataSource]
readsPrec :: Int -> ReadS MonitorDataSource
$creadsPrec :: Int -> ReadS MonitorDataSource
Prelude.Read, Int -> MonitorDataSource -> ShowS
[MonitorDataSource] -> ShowS
MonitorDataSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitorDataSource] -> ShowS
$cshowList :: [MonitorDataSource] -> ShowS
show :: MonitorDataSource -> String
$cshow :: MonitorDataSource -> String
showsPrec :: Int -> MonitorDataSource -> ShowS
$cshowsPrec :: Int -> MonitorDataSource -> ShowS
Prelude.Show, forall x. Rep MonitorDataSource x -> MonitorDataSource
forall x. MonitorDataSource -> Rep MonitorDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitorDataSource x -> MonitorDataSource
$cfrom :: forall x. MonitorDataSource -> Rep MonitorDataSource x
Prelude.Generic)

-- |
-- Create a value of 'MonitorDataSource' 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:
--
-- 'datasetImportJobArn', 'monitorDataSource_datasetImportJobArn' - The Amazon Resource Name (ARN) of the dataset import job used to import
-- the data that initiated the monitor evaluation.
--
-- 'forecastArn', 'monitorDataSource_forecastArn' - The Amazon Resource Name (ARN) of the forecast the monitor used during
-- the evaluation.
--
-- 'predictorArn', 'monitorDataSource_predictorArn' - The Amazon Resource Name (ARN) of the predictor resource you are
-- monitoring.
newMonitorDataSource ::
  MonitorDataSource
newMonitorDataSource :: MonitorDataSource
newMonitorDataSource =
  MonitorDataSource'
    { $sel:datasetImportJobArn:MonitorDataSource' :: Maybe Text
datasetImportJobArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:forecastArn:MonitorDataSource' :: Maybe Text
forecastArn = forall a. Maybe a
Prelude.Nothing,
      $sel:predictorArn:MonitorDataSource' :: Maybe Text
predictorArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the dataset import job used to import
-- the data that initiated the monitor evaluation.
monitorDataSource_datasetImportJobArn :: Lens.Lens' MonitorDataSource (Prelude.Maybe Prelude.Text)
monitorDataSource_datasetImportJobArn :: Lens' MonitorDataSource (Maybe Text)
monitorDataSource_datasetImportJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorDataSource' {Maybe Text
datasetImportJobArn :: Maybe Text
$sel:datasetImportJobArn:MonitorDataSource' :: MonitorDataSource -> Maybe Text
datasetImportJobArn} -> Maybe Text
datasetImportJobArn) (\s :: MonitorDataSource
s@MonitorDataSource' {} Maybe Text
a -> MonitorDataSource
s {$sel:datasetImportJobArn:MonitorDataSource' :: Maybe Text
datasetImportJobArn = Maybe Text
a} :: MonitorDataSource)

-- | The Amazon Resource Name (ARN) of the forecast the monitor used during
-- the evaluation.
monitorDataSource_forecastArn :: Lens.Lens' MonitorDataSource (Prelude.Maybe Prelude.Text)
monitorDataSource_forecastArn :: Lens' MonitorDataSource (Maybe Text)
monitorDataSource_forecastArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorDataSource' {Maybe Text
forecastArn :: Maybe Text
$sel:forecastArn:MonitorDataSource' :: MonitorDataSource -> Maybe Text
forecastArn} -> Maybe Text
forecastArn) (\s :: MonitorDataSource
s@MonitorDataSource' {} Maybe Text
a -> MonitorDataSource
s {$sel:forecastArn:MonitorDataSource' :: Maybe Text
forecastArn = Maybe Text
a} :: MonitorDataSource)

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

instance Data.FromJSON MonitorDataSource where
  parseJSON :: Value -> Parser MonitorDataSource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MonitorDataSource"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> MonitorDataSource
MonitorDataSource'
            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
"DatasetImportJobArn")
            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
"ForecastArn")
            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
"PredictorArn")
      )

instance Prelude.Hashable MonitorDataSource where
  hashWithSalt :: Int -> MonitorDataSource -> Int
hashWithSalt Int
_salt MonitorDataSource' {Maybe Text
predictorArn :: Maybe Text
forecastArn :: Maybe Text
datasetImportJobArn :: Maybe Text
$sel:predictorArn:MonitorDataSource' :: MonitorDataSource -> Maybe Text
$sel:forecastArn:MonitorDataSource' :: MonitorDataSource -> Maybe Text
$sel:datasetImportJobArn:MonitorDataSource' :: MonitorDataSource -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datasetImportJobArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
forecastArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
predictorArn

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