{-# 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.IoTAnalytics.Types.Dataset
-- 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)
module Amazonka.IoTAnalytics.Types.Dataset where

import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.DatasetAction
import Amazonka.IoTAnalytics.Types.DatasetContentDeliveryRule
import Amazonka.IoTAnalytics.Types.DatasetStatus
import Amazonka.IoTAnalytics.Types.DatasetTrigger
import Amazonka.IoTAnalytics.Types.LateDataRule
import Amazonka.IoTAnalytics.Types.RetentionPeriod
import Amazonka.IoTAnalytics.Types.VersioningConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a dataset.
--
-- /See:/ 'newDataset' smart constructor.
data Dataset = Dataset'
  { -- | When the dataset was created.
    Dataset -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the dataset.
    Dataset -> Maybe DatasetStatus
status :: Prelude.Maybe DatasetStatus,
    -- | Optional. How many versions of dataset contents are kept. If not
    -- specified or set to null, only the latest version plus the latest
    -- succeeded version (if they are different) are kept for the time period
    -- specified by the @retentionPeriod@ parameter. For more information, see
    -- <https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions Keeping Multiple Versions of IoT Analytics datasets>
    -- in the /IoT Analytics User Guide/.
    Dataset -> Maybe VersioningConfiguration
versioningConfiguration :: Prelude.Maybe VersioningConfiguration,
    -- | The ARN of the dataset.
    Dataset -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The @DatasetAction@ objects that automatically create the dataset
    -- contents.
    Dataset -> Maybe (NonEmpty DatasetAction)
actions :: Prelude.Maybe (Prelude.NonEmpty DatasetAction),
    -- | The @DatasetTrigger@ objects that specify when the dataset is
    -- automatically updated.
    Dataset -> Maybe [DatasetTrigger]
triggers :: Prelude.Maybe [DatasetTrigger],
    -- | Optional. How long, in days, message data is kept for the dataset.
    Dataset -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
    -- | A list of data rules that send notifications to CloudWatch, when data
    -- arrives late. To specify @lateDataRules@, the dataset must use a
    -- <https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html DeltaTimer>
    -- filter.
    Dataset -> Maybe (NonEmpty LateDataRule)
lateDataRules :: Prelude.Maybe (Prelude.NonEmpty LateDataRule),
    -- | The name of the dataset.
    Dataset -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | When dataset contents are created they are delivered to destinations
    -- specified here.
    Dataset -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules :: Prelude.Maybe [DatasetContentDeliveryRule],
    -- | The last time the dataset was updated.
    Dataset -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX
  }
  deriving (Dataset -> Dataset -> Bool
(Dataset -> Dataset -> Bool)
-> (Dataset -> Dataset -> Bool) -> Eq Dataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Dataset -> Dataset -> Bool
$c/= :: Dataset -> Dataset -> Bool
== :: Dataset -> Dataset -> Bool
$c== :: Dataset -> Dataset -> Bool
Prelude.Eq, ReadPrec [Dataset]
ReadPrec Dataset
Int -> ReadS Dataset
ReadS [Dataset]
(Int -> ReadS Dataset)
-> ReadS [Dataset]
-> ReadPrec Dataset
-> ReadPrec [Dataset]
-> Read Dataset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Dataset]
$creadListPrec :: ReadPrec [Dataset]
readPrec :: ReadPrec Dataset
$creadPrec :: ReadPrec Dataset
readList :: ReadS [Dataset]
$creadList :: ReadS [Dataset]
readsPrec :: Int -> ReadS Dataset
$creadsPrec :: Int -> ReadS Dataset
Prelude.Read, Int -> Dataset -> ShowS
[Dataset] -> ShowS
Dataset -> String
(Int -> Dataset -> ShowS)
-> (Dataset -> String) -> ([Dataset] -> ShowS) -> Show Dataset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Dataset] -> ShowS
$cshowList :: [Dataset] -> ShowS
show :: Dataset -> String
$cshow :: Dataset -> String
showsPrec :: Int -> Dataset -> ShowS
$cshowsPrec :: Int -> Dataset -> ShowS
Prelude.Show, (forall x. Dataset -> Rep Dataset x)
-> (forall x. Rep Dataset x -> Dataset) -> Generic Dataset
forall x. Rep Dataset x -> Dataset
forall x. Dataset -> Rep Dataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Dataset x -> Dataset
$cfrom :: forall x. Dataset -> Rep Dataset x
Prelude.Generic)

-- |
-- Create a value of 'Dataset' 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:
--
-- 'creationTime', 'dataset_creationTime' - When the dataset was created.
--
-- 'status', 'dataset_status' - The status of the dataset.
--
-- 'versioningConfiguration', 'dataset_versioningConfiguration' - Optional. How many versions of dataset contents are kept. If not
-- specified or set to null, only the latest version plus the latest
-- succeeded version (if they are different) are kept for the time period
-- specified by the @retentionPeriod@ parameter. For more information, see
-- <https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions Keeping Multiple Versions of IoT Analytics datasets>
-- in the /IoT Analytics User Guide/.
--
-- 'arn', 'dataset_arn' - The ARN of the dataset.
--
-- 'actions', 'dataset_actions' - The @DatasetAction@ objects that automatically create the dataset
-- contents.
--
-- 'triggers', 'dataset_triggers' - The @DatasetTrigger@ objects that specify when the dataset is
-- automatically updated.
--
-- 'retentionPeriod', 'dataset_retentionPeriod' - Optional. How long, in days, message data is kept for the dataset.
--
-- 'lateDataRules', 'dataset_lateDataRules' - A list of data rules that send notifications to CloudWatch, when data
-- arrives late. To specify @lateDataRules@, the dataset must use a
-- <https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html DeltaTimer>
-- filter.
--
-- 'name', 'dataset_name' - The name of the dataset.
--
-- 'contentDeliveryRules', 'dataset_contentDeliveryRules' - When dataset contents are created they are delivered to destinations
-- specified here.
--
-- 'lastUpdateTime', 'dataset_lastUpdateTime' - The last time the dataset was updated.
newDataset ::
  Dataset
newDataset :: Dataset
newDataset =
  Dataset' :: Maybe POSIX
-> Maybe DatasetStatus
-> Maybe VersioningConfiguration
-> Maybe Text
-> Maybe (NonEmpty DatasetAction)
-> Maybe [DatasetTrigger]
-> Maybe RetentionPeriod
-> Maybe (NonEmpty LateDataRule)
-> Maybe Text
-> Maybe [DatasetContentDeliveryRule]
-> Maybe POSIX
-> Dataset
Dataset'
    { $sel:creationTime:Dataset' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:Dataset' :: Maybe DatasetStatus
status = Maybe DatasetStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:versioningConfiguration:Dataset' :: Maybe VersioningConfiguration
versioningConfiguration = Maybe VersioningConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Dataset' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actions:Dataset' :: Maybe (NonEmpty DatasetAction)
actions = Maybe (NonEmpty DatasetAction)
forall a. Maybe a
Prelude.Nothing,
      $sel:triggers:Dataset' :: Maybe [DatasetTrigger]
triggers = Maybe [DatasetTrigger]
forall a. Maybe a
Prelude.Nothing,
      $sel:retentionPeriod:Dataset' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:lateDataRules:Dataset' :: Maybe (NonEmpty LateDataRule)
lateDataRules = Maybe (NonEmpty LateDataRule)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Dataset' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentDeliveryRules:Dataset' :: Maybe [DatasetContentDeliveryRule]
contentDeliveryRules = Maybe [DatasetContentDeliveryRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:Dataset' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | When the dataset was created.
dataset_creationTime :: Lens.Lens' Dataset (Prelude.Maybe Prelude.UTCTime)
dataset_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Dataset -> f Dataset
dataset_creationTime = (Dataset -> Maybe POSIX)
-> (Dataset -> Maybe POSIX -> Dataset)
-> Lens Dataset Dataset (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Dataset' :: Dataset -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Dataset
s@Dataset' {} Maybe POSIX
a -> Dataset
s {$sel:creationTime:Dataset' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Dataset) ((Maybe POSIX -> f (Maybe POSIX)) -> Dataset -> f Dataset)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Dataset
-> f Dataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the dataset.
dataset_status :: Lens.Lens' Dataset (Prelude.Maybe DatasetStatus)
dataset_status :: (Maybe DatasetStatus -> f (Maybe DatasetStatus))
-> Dataset -> f Dataset
dataset_status = (Dataset -> Maybe DatasetStatus)
-> (Dataset -> Maybe DatasetStatus -> Dataset)
-> Lens Dataset Dataset (Maybe DatasetStatus) (Maybe DatasetStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe DatasetStatus
status :: Maybe DatasetStatus
$sel:status:Dataset' :: Dataset -> Maybe DatasetStatus
status} -> Maybe DatasetStatus
status) (\s :: Dataset
s@Dataset' {} Maybe DatasetStatus
a -> Dataset
s {$sel:status:Dataset' :: Maybe DatasetStatus
status = Maybe DatasetStatus
a} :: Dataset)

-- | Optional. How many versions of dataset contents are kept. If not
-- specified or set to null, only the latest version plus the latest
-- succeeded version (if they are different) are kept for the time period
-- specified by the @retentionPeriod@ parameter. For more information, see
-- <https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions Keeping Multiple Versions of IoT Analytics datasets>
-- in the /IoT Analytics User Guide/.
dataset_versioningConfiguration :: Lens.Lens' Dataset (Prelude.Maybe VersioningConfiguration)
dataset_versioningConfiguration :: (Maybe VersioningConfiguration
 -> f (Maybe VersioningConfiguration))
-> Dataset -> f Dataset
dataset_versioningConfiguration = (Dataset -> Maybe VersioningConfiguration)
-> (Dataset -> Maybe VersioningConfiguration -> Dataset)
-> Lens
     Dataset
     Dataset
     (Maybe VersioningConfiguration)
     (Maybe VersioningConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe VersioningConfiguration
versioningConfiguration :: Maybe VersioningConfiguration
$sel:versioningConfiguration:Dataset' :: Dataset -> Maybe VersioningConfiguration
versioningConfiguration} -> Maybe VersioningConfiguration
versioningConfiguration) (\s :: Dataset
s@Dataset' {} Maybe VersioningConfiguration
a -> Dataset
s {$sel:versioningConfiguration:Dataset' :: Maybe VersioningConfiguration
versioningConfiguration = Maybe VersioningConfiguration
a} :: Dataset)

-- | The ARN of the dataset.
dataset_arn :: Lens.Lens' Dataset (Prelude.Maybe Prelude.Text)
dataset_arn :: (Maybe Text -> f (Maybe Text)) -> Dataset -> f Dataset
dataset_arn = (Dataset -> Maybe Text)
-> (Dataset -> Maybe Text -> Dataset)
-> Lens Dataset Dataset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe Text
arn :: Maybe Text
$sel:arn:Dataset' :: Dataset -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Dataset
s@Dataset' {} Maybe Text
a -> Dataset
s {$sel:arn:Dataset' :: Maybe Text
arn = Maybe Text
a} :: Dataset)

-- | The @DatasetAction@ objects that automatically create the dataset
-- contents.
dataset_actions :: Lens.Lens' Dataset (Prelude.Maybe (Prelude.NonEmpty DatasetAction))
dataset_actions :: (Maybe (NonEmpty DatasetAction)
 -> f (Maybe (NonEmpty DatasetAction)))
-> Dataset -> f Dataset
dataset_actions = (Dataset -> Maybe (NonEmpty DatasetAction))
-> (Dataset -> Maybe (NonEmpty DatasetAction) -> Dataset)
-> Lens
     Dataset
     Dataset
     (Maybe (NonEmpty DatasetAction))
     (Maybe (NonEmpty DatasetAction))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe (NonEmpty DatasetAction)
actions :: Maybe (NonEmpty DatasetAction)
$sel:actions:Dataset' :: Dataset -> Maybe (NonEmpty DatasetAction)
actions} -> Maybe (NonEmpty DatasetAction)
actions) (\s :: Dataset
s@Dataset' {} Maybe (NonEmpty DatasetAction)
a -> Dataset
s {$sel:actions:Dataset' :: Maybe (NonEmpty DatasetAction)
actions = Maybe (NonEmpty DatasetAction)
a} :: Dataset) ((Maybe (NonEmpty DatasetAction)
  -> f (Maybe (NonEmpty DatasetAction)))
 -> Dataset -> f Dataset)
-> ((Maybe (NonEmpty DatasetAction)
     -> f (Maybe (NonEmpty DatasetAction)))
    -> Maybe (NonEmpty DatasetAction)
    -> f (Maybe (NonEmpty DatasetAction)))
-> (Maybe (NonEmpty DatasetAction)
    -> f (Maybe (NonEmpty DatasetAction)))
-> Dataset
-> f Dataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty DatasetAction)
  (NonEmpty DatasetAction)
  (NonEmpty DatasetAction)
  (NonEmpty DatasetAction)
-> Iso
     (Maybe (NonEmpty DatasetAction))
     (Maybe (NonEmpty DatasetAction))
     (Maybe (NonEmpty DatasetAction))
     (Maybe (NonEmpty DatasetAction))
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 DatasetAction)
  (NonEmpty DatasetAction)
  (NonEmpty DatasetAction)
  (NonEmpty DatasetAction)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @DatasetTrigger@ objects that specify when the dataset is
-- automatically updated.
dataset_triggers :: Lens.Lens' Dataset (Prelude.Maybe [DatasetTrigger])
dataset_triggers :: (Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> Dataset -> f Dataset
dataset_triggers = (Dataset -> Maybe [DatasetTrigger])
-> (Dataset -> Maybe [DatasetTrigger] -> Dataset)
-> Lens
     Dataset Dataset (Maybe [DatasetTrigger]) (Maybe [DatasetTrigger])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe [DatasetTrigger]
triggers :: Maybe [DatasetTrigger]
$sel:triggers:Dataset' :: Dataset -> Maybe [DatasetTrigger]
triggers} -> Maybe [DatasetTrigger]
triggers) (\s :: Dataset
s@Dataset' {} Maybe [DatasetTrigger]
a -> Dataset
s {$sel:triggers:Dataset' :: Maybe [DatasetTrigger]
triggers = Maybe [DatasetTrigger]
a} :: Dataset) ((Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
 -> Dataset -> f Dataset)
-> ((Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
    -> Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> (Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> Dataset
-> f Dataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DatasetTrigger] [DatasetTrigger] [DatasetTrigger] [DatasetTrigger]
-> Iso
     (Maybe [DatasetTrigger])
     (Maybe [DatasetTrigger])
     (Maybe [DatasetTrigger])
     (Maybe [DatasetTrigger])
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
  [DatasetTrigger] [DatasetTrigger] [DatasetTrigger] [DatasetTrigger]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Optional. How long, in days, message data is kept for the dataset.
dataset_retentionPeriod :: Lens.Lens' Dataset (Prelude.Maybe RetentionPeriod)
dataset_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> Dataset -> f Dataset
dataset_retentionPeriod = (Dataset -> Maybe RetentionPeriod)
-> (Dataset -> Maybe RetentionPeriod -> Dataset)
-> Lens
     Dataset Dataset (Maybe RetentionPeriod) (Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:Dataset' :: Dataset -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: Dataset
s@Dataset' {} Maybe RetentionPeriod
a -> Dataset
s {$sel:retentionPeriod:Dataset' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: Dataset)

-- | A list of data rules that send notifications to CloudWatch, when data
-- arrives late. To specify @lateDataRules@, the dataset must use a
-- <https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html DeltaTimer>
-- filter.
dataset_lateDataRules :: Lens.Lens' Dataset (Prelude.Maybe (Prelude.NonEmpty LateDataRule))
dataset_lateDataRules :: (Maybe (NonEmpty LateDataRule)
 -> f (Maybe (NonEmpty LateDataRule)))
-> Dataset -> f Dataset
dataset_lateDataRules = (Dataset -> Maybe (NonEmpty LateDataRule))
-> (Dataset -> Maybe (NonEmpty LateDataRule) -> Dataset)
-> Lens
     Dataset
     Dataset
     (Maybe (NonEmpty LateDataRule))
     (Maybe (NonEmpty LateDataRule))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe (NonEmpty LateDataRule)
lateDataRules :: Maybe (NonEmpty LateDataRule)
$sel:lateDataRules:Dataset' :: Dataset -> Maybe (NonEmpty LateDataRule)
lateDataRules} -> Maybe (NonEmpty LateDataRule)
lateDataRules) (\s :: Dataset
s@Dataset' {} Maybe (NonEmpty LateDataRule)
a -> Dataset
s {$sel:lateDataRules:Dataset' :: Maybe (NonEmpty LateDataRule)
lateDataRules = Maybe (NonEmpty LateDataRule)
a} :: Dataset) ((Maybe (NonEmpty LateDataRule)
  -> f (Maybe (NonEmpty LateDataRule)))
 -> Dataset -> f Dataset)
-> ((Maybe (NonEmpty LateDataRule)
     -> f (Maybe (NonEmpty LateDataRule)))
    -> Maybe (NonEmpty LateDataRule)
    -> f (Maybe (NonEmpty LateDataRule)))
-> (Maybe (NonEmpty LateDataRule)
    -> f (Maybe (NonEmpty LateDataRule)))
-> Dataset
-> f Dataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty LateDataRule)
  (NonEmpty LateDataRule)
  (NonEmpty LateDataRule)
  (NonEmpty LateDataRule)
-> Iso
     (Maybe (NonEmpty LateDataRule))
     (Maybe (NonEmpty LateDataRule))
     (Maybe (NonEmpty LateDataRule))
     (Maybe (NonEmpty LateDataRule))
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 LateDataRule)
  (NonEmpty LateDataRule)
  (NonEmpty LateDataRule)
  (NonEmpty LateDataRule)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the dataset.
dataset_name :: Lens.Lens' Dataset (Prelude.Maybe Prelude.Text)
dataset_name :: (Maybe Text -> f (Maybe Text)) -> Dataset -> f Dataset
dataset_name = (Dataset -> Maybe Text)
-> (Dataset -> Maybe Text -> Dataset)
-> Lens Dataset Dataset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe Text
name :: Maybe Text
$sel:name:Dataset' :: Dataset -> Maybe Text
name} -> Maybe Text
name) (\s :: Dataset
s@Dataset' {} Maybe Text
a -> Dataset
s {$sel:name:Dataset' :: Maybe Text
name = Maybe Text
a} :: Dataset)

-- | When dataset contents are created they are delivered to destinations
-- specified here.
dataset_contentDeliveryRules :: Lens.Lens' Dataset (Prelude.Maybe [DatasetContentDeliveryRule])
dataset_contentDeliveryRules :: (Maybe [DatasetContentDeliveryRule]
 -> f (Maybe [DatasetContentDeliveryRule]))
-> Dataset -> f Dataset
dataset_contentDeliveryRules = (Dataset -> Maybe [DatasetContentDeliveryRule])
-> (Dataset -> Maybe [DatasetContentDeliveryRule] -> Dataset)
-> Lens
     Dataset
     Dataset
     (Maybe [DatasetContentDeliveryRule])
     (Maybe [DatasetContentDeliveryRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe [DatasetContentDeliveryRule]
contentDeliveryRules :: Maybe [DatasetContentDeliveryRule]
$sel:contentDeliveryRules:Dataset' :: Dataset -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules} -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules) (\s :: Dataset
s@Dataset' {} Maybe [DatasetContentDeliveryRule]
a -> Dataset
s {$sel:contentDeliveryRules:Dataset' :: Maybe [DatasetContentDeliveryRule]
contentDeliveryRules = Maybe [DatasetContentDeliveryRule]
a} :: Dataset) ((Maybe [DatasetContentDeliveryRule]
  -> f (Maybe [DatasetContentDeliveryRule]))
 -> Dataset -> f Dataset)
-> ((Maybe [DatasetContentDeliveryRule]
     -> f (Maybe [DatasetContentDeliveryRule]))
    -> Maybe [DatasetContentDeliveryRule]
    -> f (Maybe [DatasetContentDeliveryRule]))
-> (Maybe [DatasetContentDeliveryRule]
    -> f (Maybe [DatasetContentDeliveryRule]))
-> Dataset
-> f Dataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DatasetContentDeliveryRule]
  [DatasetContentDeliveryRule]
  [DatasetContentDeliveryRule]
  [DatasetContentDeliveryRule]
-> Iso
     (Maybe [DatasetContentDeliveryRule])
     (Maybe [DatasetContentDeliveryRule])
     (Maybe [DatasetContentDeliveryRule])
     (Maybe [DatasetContentDeliveryRule])
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
  [DatasetContentDeliveryRule]
  [DatasetContentDeliveryRule]
  [DatasetContentDeliveryRule]
  [DatasetContentDeliveryRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The last time the dataset was updated.
dataset_lastUpdateTime :: Lens.Lens' Dataset (Prelude.Maybe Prelude.UTCTime)
dataset_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Dataset -> f Dataset
dataset_lastUpdateTime = (Dataset -> Maybe POSIX)
-> (Dataset -> Maybe POSIX -> Dataset)
-> Lens Dataset Dataset (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dataset' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:Dataset' :: Dataset -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: Dataset
s@Dataset' {} Maybe POSIX
a -> Dataset
s {$sel:lastUpdateTime:Dataset' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: Dataset) ((Maybe POSIX -> f (Maybe POSIX)) -> Dataset -> f Dataset)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Dataset
-> f Dataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON Dataset where
  parseJSON :: Value -> Parser Dataset
parseJSON =
    String -> (Object -> Parser Dataset) -> Value -> Parser Dataset
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Dataset"
      ( \Object
x ->
          Maybe POSIX
-> Maybe DatasetStatus
-> Maybe VersioningConfiguration
-> Maybe Text
-> Maybe (NonEmpty DatasetAction)
-> Maybe [DatasetTrigger]
-> Maybe RetentionPeriod
-> Maybe (NonEmpty LateDataRule)
-> Maybe Text
-> Maybe [DatasetContentDeliveryRule]
-> Maybe POSIX
-> Dataset
Dataset'
            (Maybe POSIX
 -> Maybe DatasetStatus
 -> Maybe VersioningConfiguration
 -> Maybe Text
 -> Maybe (NonEmpty DatasetAction)
 -> Maybe [DatasetTrigger]
 -> Maybe RetentionPeriod
 -> Maybe (NonEmpty LateDataRule)
 -> Maybe Text
 -> Maybe [DatasetContentDeliveryRule]
 -> Maybe POSIX
 -> Dataset)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe DatasetStatus
      -> Maybe VersioningConfiguration
      -> Maybe Text
      -> Maybe (NonEmpty DatasetAction)
      -> Maybe [DatasetTrigger]
      -> Maybe RetentionPeriod
      -> Maybe (NonEmpty LateDataRule)
      -> Maybe Text
      -> Maybe [DatasetContentDeliveryRule]
      -> Maybe POSIX
      -> Dataset)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser
  (Maybe DatasetStatus
   -> Maybe VersioningConfiguration
   -> Maybe Text
   -> Maybe (NonEmpty DatasetAction)
   -> Maybe [DatasetTrigger]
   -> Maybe RetentionPeriod
   -> Maybe (NonEmpty LateDataRule)
   -> Maybe Text
   -> Maybe [DatasetContentDeliveryRule]
   -> Maybe POSIX
   -> Dataset)
-> Parser (Maybe DatasetStatus)
-> Parser
     (Maybe VersioningConfiguration
      -> Maybe Text
      -> Maybe (NonEmpty DatasetAction)
      -> Maybe [DatasetTrigger]
      -> Maybe RetentionPeriod
      -> Maybe (NonEmpty LateDataRule)
      -> Maybe Text
      -> Maybe [DatasetContentDeliveryRule]
      -> Maybe POSIX
      -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DatasetStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe VersioningConfiguration
   -> Maybe Text
   -> Maybe (NonEmpty DatasetAction)
   -> Maybe [DatasetTrigger]
   -> Maybe RetentionPeriod
   -> Maybe (NonEmpty LateDataRule)
   -> Maybe Text
   -> Maybe [DatasetContentDeliveryRule]
   -> Maybe POSIX
   -> Dataset)
-> Parser (Maybe VersioningConfiguration)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty DatasetAction)
      -> Maybe [DatasetTrigger]
      -> Maybe RetentionPeriod
      -> Maybe (NonEmpty LateDataRule)
      -> Maybe Text
      -> Maybe [DatasetContentDeliveryRule]
      -> Maybe POSIX
      -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VersioningConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"versioningConfiguration")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty DatasetAction)
   -> Maybe [DatasetTrigger]
   -> Maybe RetentionPeriod
   -> Maybe (NonEmpty LateDataRule)
   -> Maybe Text
   -> Maybe [DatasetContentDeliveryRule]
   -> Maybe POSIX
   -> Dataset)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty DatasetAction)
      -> Maybe [DatasetTrigger]
      -> Maybe RetentionPeriod
      -> Maybe (NonEmpty LateDataRule)
      -> Maybe Text
      -> Maybe [DatasetContentDeliveryRule]
      -> Maybe POSIX
      -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser
  (Maybe (NonEmpty DatasetAction)
   -> Maybe [DatasetTrigger]
   -> Maybe RetentionPeriod
   -> Maybe (NonEmpty LateDataRule)
   -> Maybe Text
   -> Maybe [DatasetContentDeliveryRule]
   -> Maybe POSIX
   -> Dataset)
-> Parser (Maybe (NonEmpty DatasetAction))
-> Parser
     (Maybe [DatasetTrigger]
      -> Maybe RetentionPeriod
      -> Maybe (NonEmpty LateDataRule)
      -> Maybe Text
      -> Maybe [DatasetContentDeliveryRule]
      -> Maybe POSIX
      -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty DatasetAction))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actions")
            Parser
  (Maybe [DatasetTrigger]
   -> Maybe RetentionPeriod
   -> Maybe (NonEmpty LateDataRule)
   -> Maybe Text
   -> Maybe [DatasetContentDeliveryRule]
   -> Maybe POSIX
   -> Dataset)
-> Parser (Maybe [DatasetTrigger])
-> Parser
     (Maybe RetentionPeriod
      -> Maybe (NonEmpty LateDataRule)
      -> Maybe Text
      -> Maybe [DatasetContentDeliveryRule]
      -> Maybe POSIX
      -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [DatasetTrigger]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"triggers" Parser (Maybe (Maybe [DatasetTrigger]))
-> Maybe [DatasetTrigger] -> Parser (Maybe [DatasetTrigger])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DatasetTrigger]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe RetentionPeriod
   -> Maybe (NonEmpty LateDataRule)
   -> Maybe Text
   -> Maybe [DatasetContentDeliveryRule]
   -> Maybe POSIX
   -> Dataset)
-> Parser (Maybe RetentionPeriod)
-> Parser
     (Maybe (NonEmpty LateDataRule)
      -> Maybe Text
      -> Maybe [DatasetContentDeliveryRule]
      -> Maybe POSIX
      -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RetentionPeriod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"retentionPeriod")
            Parser
  (Maybe (NonEmpty LateDataRule)
   -> Maybe Text
   -> Maybe [DatasetContentDeliveryRule]
   -> Maybe POSIX
   -> Dataset)
-> Parser (Maybe (NonEmpty LateDataRule))
-> Parser
     (Maybe Text
      -> Maybe [DatasetContentDeliveryRule] -> Maybe POSIX -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty LateDataRule))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lateDataRules")
            Parser
  (Maybe Text
   -> Maybe [DatasetContentDeliveryRule] -> Maybe POSIX -> Dataset)
-> Parser (Maybe Text)
-> Parser
     (Maybe [DatasetContentDeliveryRule] -> Maybe POSIX -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser
  (Maybe [DatasetContentDeliveryRule] -> Maybe POSIX -> Dataset)
-> Parser (Maybe [DatasetContentDeliveryRule])
-> Parser (Maybe POSIX -> Dataset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [DatasetContentDeliveryRule]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"contentDeliveryRules"
                            Parser (Maybe (Maybe [DatasetContentDeliveryRule]))
-> Maybe [DatasetContentDeliveryRule]
-> Parser (Maybe [DatasetContentDeliveryRule])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DatasetContentDeliveryRule]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe POSIX -> Dataset)
-> Parser (Maybe POSIX) -> Parser Dataset
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdateTime")
      )

instance Prelude.Hashable Dataset

instance Prelude.NFData Dataset