{-# 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.IoTAnalytics.UpdateDataset
-- 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)
--
-- Updates the settings of a dataset.
module Amazonka.IoTAnalytics.UpdateDataset
  ( -- * Creating a Request
    UpdateDataset (..),
    newUpdateDataset,

    -- * Request Lenses
    updateDataset_versioningConfiguration,
    updateDataset_triggers,
    updateDataset_retentionPeriod,
    updateDataset_lateDataRules,
    updateDataset_contentDeliveryRules,
    updateDataset_datasetName,
    updateDataset_actions,

    -- * Destructuring the Response
    UpdateDatasetResponse (..),
    newUpdateDatasetResponse,
  )
where

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

-- | /See:/ 'newUpdateDataset' smart constructor.
data UpdateDataset = UpdateDataset'
  { -- | 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/.
    UpdateDataset -> Maybe VersioningConfiguration
versioningConfiguration :: Prelude.Maybe VersioningConfiguration,
    -- | A list of @DatasetTrigger@ objects. The list can be empty or can contain
    -- up to five @DatasetTrigger@ objects.
    UpdateDataset -> Maybe [DatasetTrigger]
triggers :: Prelude.Maybe [DatasetTrigger],
    -- | How long, in days, dataset contents are kept for the dataset.
    UpdateDataset -> 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.
    UpdateDataset -> Maybe (NonEmpty LateDataRule)
lateDataRules :: Prelude.Maybe (Prelude.NonEmpty LateDataRule),
    -- | When dataset contents are created, they are delivered to destinations
    -- specified here.
    UpdateDataset -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules :: Prelude.Maybe [DatasetContentDeliveryRule],
    -- | The name of the dataset to update.
    UpdateDataset -> Text
datasetName :: Prelude.Text,
    -- | A list of @DatasetAction@ objects.
    UpdateDataset -> NonEmpty DatasetAction
actions :: Prelude.NonEmpty DatasetAction
  }
  deriving (UpdateDataset -> UpdateDataset -> Bool
(UpdateDataset -> UpdateDataset -> Bool)
-> (UpdateDataset -> UpdateDataset -> Bool) -> Eq UpdateDataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDataset -> UpdateDataset -> Bool
$c/= :: UpdateDataset -> UpdateDataset -> Bool
== :: UpdateDataset -> UpdateDataset -> Bool
$c== :: UpdateDataset -> UpdateDataset -> Bool
Prelude.Eq, ReadPrec [UpdateDataset]
ReadPrec UpdateDataset
Int -> ReadS UpdateDataset
ReadS [UpdateDataset]
(Int -> ReadS UpdateDataset)
-> ReadS [UpdateDataset]
-> ReadPrec UpdateDataset
-> ReadPrec [UpdateDataset]
-> Read UpdateDataset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDataset]
$creadListPrec :: ReadPrec [UpdateDataset]
readPrec :: ReadPrec UpdateDataset
$creadPrec :: ReadPrec UpdateDataset
readList :: ReadS [UpdateDataset]
$creadList :: ReadS [UpdateDataset]
readsPrec :: Int -> ReadS UpdateDataset
$creadsPrec :: Int -> ReadS UpdateDataset
Prelude.Read, Int -> UpdateDataset -> ShowS
[UpdateDataset] -> ShowS
UpdateDataset -> String
(Int -> UpdateDataset -> ShowS)
-> (UpdateDataset -> String)
-> ([UpdateDataset] -> ShowS)
-> Show UpdateDataset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDataset] -> ShowS
$cshowList :: [UpdateDataset] -> ShowS
show :: UpdateDataset -> String
$cshow :: UpdateDataset -> String
showsPrec :: Int -> UpdateDataset -> ShowS
$cshowsPrec :: Int -> UpdateDataset -> ShowS
Prelude.Show, (forall x. UpdateDataset -> Rep UpdateDataset x)
-> (forall x. Rep UpdateDataset x -> UpdateDataset)
-> Generic UpdateDataset
forall x. Rep UpdateDataset x -> UpdateDataset
forall x. UpdateDataset -> Rep UpdateDataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDataset x -> UpdateDataset
$cfrom :: forall x. UpdateDataset -> Rep UpdateDataset x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDataset' 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:
--
-- 'versioningConfiguration', 'updateDataset_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/.
--
-- 'triggers', 'updateDataset_triggers' - A list of @DatasetTrigger@ objects. The list can be empty or can contain
-- up to five @DatasetTrigger@ objects.
--
-- 'retentionPeriod', 'updateDataset_retentionPeriod' - How long, in days, dataset contents are kept for the dataset.
--
-- 'lateDataRules', 'updateDataset_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.
--
-- 'contentDeliveryRules', 'updateDataset_contentDeliveryRules' - When dataset contents are created, they are delivered to destinations
-- specified here.
--
-- 'datasetName', 'updateDataset_datasetName' - The name of the dataset to update.
--
-- 'actions', 'updateDataset_actions' - A list of @DatasetAction@ objects.
newUpdateDataset ::
  -- | 'datasetName'
  Prelude.Text ->
  -- | 'actions'
  Prelude.NonEmpty DatasetAction ->
  UpdateDataset
newUpdateDataset :: Text -> NonEmpty DatasetAction -> UpdateDataset
newUpdateDataset Text
pDatasetName_ NonEmpty DatasetAction
pActions_ =
  UpdateDataset' :: Maybe VersioningConfiguration
-> Maybe [DatasetTrigger]
-> Maybe RetentionPeriod
-> Maybe (NonEmpty LateDataRule)
-> Maybe [DatasetContentDeliveryRule]
-> Text
-> NonEmpty DatasetAction
-> UpdateDataset
UpdateDataset'
    { $sel:versioningConfiguration:UpdateDataset' :: Maybe VersioningConfiguration
versioningConfiguration =
        Maybe VersioningConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:triggers:UpdateDataset' :: Maybe [DatasetTrigger]
triggers = Maybe [DatasetTrigger]
forall a. Maybe a
Prelude.Nothing,
      $sel:retentionPeriod:UpdateDataset' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:lateDataRules:UpdateDataset' :: Maybe (NonEmpty LateDataRule)
lateDataRules = Maybe (NonEmpty LateDataRule)
forall a. Maybe a
Prelude.Nothing,
      $sel:contentDeliveryRules:UpdateDataset' :: Maybe [DatasetContentDeliveryRule]
contentDeliveryRules = Maybe [DatasetContentDeliveryRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetName:UpdateDataset' :: Text
datasetName = Text
pDatasetName_,
      $sel:actions:UpdateDataset' :: NonEmpty DatasetAction
actions = Tagged (NonEmpty DatasetAction) (Identity (NonEmpty DatasetAction))
-> Tagged
     (NonEmpty DatasetAction) (Identity (NonEmpty DatasetAction))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty DatasetAction) (Identity (NonEmpty DatasetAction))
 -> Tagged
      (NonEmpty DatasetAction) (Identity (NonEmpty DatasetAction)))
-> NonEmpty DatasetAction -> NonEmpty DatasetAction
forall t b. AReview t b -> b -> t
Lens.# NonEmpty DatasetAction
pActions_
    }

-- | 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/.
updateDataset_versioningConfiguration :: Lens.Lens' UpdateDataset (Prelude.Maybe VersioningConfiguration)
updateDataset_versioningConfiguration :: (Maybe VersioningConfiguration
 -> f (Maybe VersioningConfiguration))
-> UpdateDataset -> f UpdateDataset
updateDataset_versioningConfiguration = (UpdateDataset -> Maybe VersioningConfiguration)
-> (UpdateDataset
    -> Maybe VersioningConfiguration -> UpdateDataset)
-> Lens
     UpdateDataset
     UpdateDataset
     (Maybe VersioningConfiguration)
     (Maybe VersioningConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataset' {Maybe VersioningConfiguration
versioningConfiguration :: Maybe VersioningConfiguration
$sel:versioningConfiguration:UpdateDataset' :: UpdateDataset -> Maybe VersioningConfiguration
versioningConfiguration} -> Maybe VersioningConfiguration
versioningConfiguration) (\s :: UpdateDataset
s@UpdateDataset' {} Maybe VersioningConfiguration
a -> UpdateDataset
s {$sel:versioningConfiguration:UpdateDataset' :: Maybe VersioningConfiguration
versioningConfiguration = Maybe VersioningConfiguration
a} :: UpdateDataset)

-- | A list of @DatasetTrigger@ objects. The list can be empty or can contain
-- up to five @DatasetTrigger@ objects.
updateDataset_triggers :: Lens.Lens' UpdateDataset (Prelude.Maybe [DatasetTrigger])
updateDataset_triggers :: (Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> UpdateDataset -> f UpdateDataset
updateDataset_triggers = (UpdateDataset -> Maybe [DatasetTrigger])
-> (UpdateDataset -> Maybe [DatasetTrigger] -> UpdateDataset)
-> Lens
     UpdateDataset
     UpdateDataset
     (Maybe [DatasetTrigger])
     (Maybe [DatasetTrigger])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataset' {Maybe [DatasetTrigger]
triggers :: Maybe [DatasetTrigger]
$sel:triggers:UpdateDataset' :: UpdateDataset -> Maybe [DatasetTrigger]
triggers} -> Maybe [DatasetTrigger]
triggers) (\s :: UpdateDataset
s@UpdateDataset' {} Maybe [DatasetTrigger]
a -> UpdateDataset
s {$sel:triggers:UpdateDataset' :: Maybe [DatasetTrigger]
triggers = Maybe [DatasetTrigger]
a} :: UpdateDataset) ((Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
 -> UpdateDataset -> f UpdateDataset)
-> ((Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
    -> Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> (Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> UpdateDataset
-> f UpdateDataset
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

-- | How long, in days, dataset contents are kept for the dataset.
updateDataset_retentionPeriod :: Lens.Lens' UpdateDataset (Prelude.Maybe RetentionPeriod)
updateDataset_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> UpdateDataset -> f UpdateDataset
updateDataset_retentionPeriod = (UpdateDataset -> Maybe RetentionPeriod)
-> (UpdateDataset -> Maybe RetentionPeriod -> UpdateDataset)
-> Lens
     UpdateDataset
     UpdateDataset
     (Maybe RetentionPeriod)
     (Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataset' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:UpdateDataset' :: UpdateDataset -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: UpdateDataset
s@UpdateDataset' {} Maybe RetentionPeriod
a -> UpdateDataset
s {$sel:retentionPeriod:UpdateDataset' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: UpdateDataset)

-- | 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.
updateDataset_lateDataRules :: Lens.Lens' UpdateDataset (Prelude.Maybe (Prelude.NonEmpty LateDataRule))
updateDataset_lateDataRules :: (Maybe (NonEmpty LateDataRule)
 -> f (Maybe (NonEmpty LateDataRule)))
-> UpdateDataset -> f UpdateDataset
updateDataset_lateDataRules = (UpdateDataset -> Maybe (NonEmpty LateDataRule))
-> (UpdateDataset
    -> Maybe (NonEmpty LateDataRule) -> UpdateDataset)
-> Lens
     UpdateDataset
     UpdateDataset
     (Maybe (NonEmpty LateDataRule))
     (Maybe (NonEmpty LateDataRule))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataset' {Maybe (NonEmpty LateDataRule)
lateDataRules :: Maybe (NonEmpty LateDataRule)
$sel:lateDataRules:UpdateDataset' :: UpdateDataset -> Maybe (NonEmpty LateDataRule)
lateDataRules} -> Maybe (NonEmpty LateDataRule)
lateDataRules) (\s :: UpdateDataset
s@UpdateDataset' {} Maybe (NonEmpty LateDataRule)
a -> UpdateDataset
s {$sel:lateDataRules:UpdateDataset' :: Maybe (NonEmpty LateDataRule)
lateDataRules = Maybe (NonEmpty LateDataRule)
a} :: UpdateDataset) ((Maybe (NonEmpty LateDataRule)
  -> f (Maybe (NonEmpty LateDataRule)))
 -> UpdateDataset -> f UpdateDataset)
-> ((Maybe (NonEmpty LateDataRule)
     -> f (Maybe (NonEmpty LateDataRule)))
    -> Maybe (NonEmpty LateDataRule)
    -> f (Maybe (NonEmpty LateDataRule)))
-> (Maybe (NonEmpty LateDataRule)
    -> f (Maybe (NonEmpty LateDataRule)))
-> UpdateDataset
-> f UpdateDataset
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

-- | When dataset contents are created, they are delivered to destinations
-- specified here.
updateDataset_contentDeliveryRules :: Lens.Lens' UpdateDataset (Prelude.Maybe [DatasetContentDeliveryRule])
updateDataset_contentDeliveryRules :: (Maybe [DatasetContentDeliveryRule]
 -> f (Maybe [DatasetContentDeliveryRule]))
-> UpdateDataset -> f UpdateDataset
updateDataset_contentDeliveryRules = (UpdateDataset -> Maybe [DatasetContentDeliveryRule])
-> (UpdateDataset
    -> Maybe [DatasetContentDeliveryRule] -> UpdateDataset)
-> Lens
     UpdateDataset
     UpdateDataset
     (Maybe [DatasetContentDeliveryRule])
     (Maybe [DatasetContentDeliveryRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataset' {Maybe [DatasetContentDeliveryRule]
contentDeliveryRules :: Maybe [DatasetContentDeliveryRule]
$sel:contentDeliveryRules:UpdateDataset' :: UpdateDataset -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules} -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules) (\s :: UpdateDataset
s@UpdateDataset' {} Maybe [DatasetContentDeliveryRule]
a -> UpdateDataset
s {$sel:contentDeliveryRules:UpdateDataset' :: Maybe [DatasetContentDeliveryRule]
contentDeliveryRules = Maybe [DatasetContentDeliveryRule]
a} :: UpdateDataset) ((Maybe [DatasetContentDeliveryRule]
  -> f (Maybe [DatasetContentDeliveryRule]))
 -> UpdateDataset -> f UpdateDataset)
-> ((Maybe [DatasetContentDeliveryRule]
     -> f (Maybe [DatasetContentDeliveryRule]))
    -> Maybe [DatasetContentDeliveryRule]
    -> f (Maybe [DatasetContentDeliveryRule]))
-> (Maybe [DatasetContentDeliveryRule]
    -> f (Maybe [DatasetContentDeliveryRule]))
-> UpdateDataset
-> f UpdateDataset
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 name of the dataset to update.
updateDataset_datasetName :: Lens.Lens' UpdateDataset Prelude.Text
updateDataset_datasetName :: (Text -> f Text) -> UpdateDataset -> f UpdateDataset
updateDataset_datasetName = (UpdateDataset -> Text)
-> (UpdateDataset -> Text -> UpdateDataset)
-> Lens UpdateDataset UpdateDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataset' {Text
datasetName :: Text
$sel:datasetName:UpdateDataset' :: UpdateDataset -> Text
datasetName} -> Text
datasetName) (\s :: UpdateDataset
s@UpdateDataset' {} Text
a -> UpdateDataset
s {$sel:datasetName:UpdateDataset' :: Text
datasetName = Text
a} :: UpdateDataset)

-- | A list of @DatasetAction@ objects.
updateDataset_actions :: Lens.Lens' UpdateDataset (Prelude.NonEmpty DatasetAction)
updateDataset_actions :: (NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> UpdateDataset -> f UpdateDataset
updateDataset_actions = (UpdateDataset -> NonEmpty DatasetAction)
-> (UpdateDataset -> NonEmpty DatasetAction -> UpdateDataset)
-> Lens
     UpdateDataset
     UpdateDataset
     (NonEmpty DatasetAction)
     (NonEmpty DatasetAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataset' {NonEmpty DatasetAction
actions :: NonEmpty DatasetAction
$sel:actions:UpdateDataset' :: UpdateDataset -> NonEmpty DatasetAction
actions} -> NonEmpty DatasetAction
actions) (\s :: UpdateDataset
s@UpdateDataset' {} NonEmpty DatasetAction
a -> UpdateDataset
s {$sel:actions:UpdateDataset' :: NonEmpty DatasetAction
actions = NonEmpty DatasetAction
a} :: UpdateDataset) ((NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
 -> UpdateDataset -> f UpdateDataset)
-> ((NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
    -> NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> (NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> UpdateDataset
-> f UpdateDataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> NonEmpty DatasetAction -> f (NonEmpty DatasetAction)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest UpdateDataset where
  type
    AWSResponse UpdateDataset =
      UpdateDatasetResponse
  request :: UpdateDataset -> Request UpdateDataset
request = Service -> UpdateDataset -> Request UpdateDataset
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDataset)))
response =
    AWSResponse UpdateDataset
-> Logger
-> Service
-> Proxy UpdateDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDataset)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateDataset
UpdateDatasetResponse
UpdateDatasetResponse'

instance Prelude.Hashable UpdateDataset

instance Prelude.NFData UpdateDataset

instance Core.ToHeaders UpdateDataset where
  toHeaders :: UpdateDataset -> [Header]
toHeaders = [Header] -> UpdateDataset -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON UpdateDataset where
  toJSON :: UpdateDataset -> Value
toJSON UpdateDataset' {Maybe [DatasetContentDeliveryRule]
Maybe [DatasetTrigger]
Maybe (NonEmpty LateDataRule)
Maybe RetentionPeriod
Maybe VersioningConfiguration
NonEmpty DatasetAction
Text
actions :: NonEmpty DatasetAction
datasetName :: Text
contentDeliveryRules :: Maybe [DatasetContentDeliveryRule]
lateDataRules :: Maybe (NonEmpty LateDataRule)
retentionPeriod :: Maybe RetentionPeriod
triggers :: Maybe [DatasetTrigger]
versioningConfiguration :: Maybe VersioningConfiguration
$sel:actions:UpdateDataset' :: UpdateDataset -> NonEmpty DatasetAction
$sel:datasetName:UpdateDataset' :: UpdateDataset -> Text
$sel:contentDeliveryRules:UpdateDataset' :: UpdateDataset -> Maybe [DatasetContentDeliveryRule]
$sel:lateDataRules:UpdateDataset' :: UpdateDataset -> Maybe (NonEmpty LateDataRule)
$sel:retentionPeriod:UpdateDataset' :: UpdateDataset -> Maybe RetentionPeriod
$sel:triggers:UpdateDataset' :: UpdateDataset -> Maybe [DatasetTrigger]
$sel:versioningConfiguration:UpdateDataset' :: UpdateDataset -> Maybe VersioningConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"versioningConfiguration" Text -> VersioningConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VersioningConfiguration -> Pair)
-> Maybe VersioningConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VersioningConfiguration
versioningConfiguration,
            (Text
"triggers" Text -> [DatasetTrigger] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([DatasetTrigger] -> Pair) -> Maybe [DatasetTrigger] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DatasetTrigger]
triggers,
            (Text
"retentionPeriod" Text -> RetentionPeriod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RetentionPeriod -> Pair) -> Maybe RetentionPeriod -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RetentionPeriod
retentionPeriod,
            (Text
"lateDataRules" Text -> NonEmpty LateDataRule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty LateDataRule -> Pair)
-> Maybe (NonEmpty LateDataRule) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty LateDataRule)
lateDataRules,
            (Text
"contentDeliveryRules" Text -> [DatasetContentDeliveryRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([DatasetContentDeliveryRule] -> Pair)
-> Maybe [DatasetContentDeliveryRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"actions" Text -> NonEmpty DatasetAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty DatasetAction
actions)
          ]
      )

instance Core.ToPath UpdateDataset where
  toPath :: UpdateDataset -> ByteString
toPath UpdateDataset' {Maybe [DatasetContentDeliveryRule]
Maybe [DatasetTrigger]
Maybe (NonEmpty LateDataRule)
Maybe RetentionPeriod
Maybe VersioningConfiguration
NonEmpty DatasetAction
Text
actions :: NonEmpty DatasetAction
datasetName :: Text
contentDeliveryRules :: Maybe [DatasetContentDeliveryRule]
lateDataRules :: Maybe (NonEmpty LateDataRule)
retentionPeriod :: Maybe RetentionPeriod
triggers :: Maybe [DatasetTrigger]
versioningConfiguration :: Maybe VersioningConfiguration
$sel:actions:UpdateDataset' :: UpdateDataset -> NonEmpty DatasetAction
$sel:datasetName:UpdateDataset' :: UpdateDataset -> Text
$sel:contentDeliveryRules:UpdateDataset' :: UpdateDataset -> Maybe [DatasetContentDeliveryRule]
$sel:lateDataRules:UpdateDataset' :: UpdateDataset -> Maybe (NonEmpty LateDataRule)
$sel:retentionPeriod:UpdateDataset' :: UpdateDataset -> Maybe RetentionPeriod
$sel:triggers:UpdateDataset' :: UpdateDataset -> Maybe [DatasetTrigger]
$sel:versioningConfiguration:UpdateDataset' :: UpdateDataset -> Maybe VersioningConfiguration
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/datasets/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
datasetName]

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

-- | /See:/ 'newUpdateDatasetResponse' smart constructor.
data UpdateDatasetResponse = UpdateDatasetResponse'
  {
  }
  deriving (UpdateDatasetResponse -> UpdateDatasetResponse -> Bool
(UpdateDatasetResponse -> UpdateDatasetResponse -> Bool)
-> (UpdateDatasetResponse -> UpdateDatasetResponse -> Bool)
-> Eq UpdateDatasetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDatasetResponse -> UpdateDatasetResponse -> Bool
$c/= :: UpdateDatasetResponse -> UpdateDatasetResponse -> Bool
== :: UpdateDatasetResponse -> UpdateDatasetResponse -> Bool
$c== :: UpdateDatasetResponse -> UpdateDatasetResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDatasetResponse]
ReadPrec UpdateDatasetResponse
Int -> ReadS UpdateDatasetResponse
ReadS [UpdateDatasetResponse]
(Int -> ReadS UpdateDatasetResponse)
-> ReadS [UpdateDatasetResponse]
-> ReadPrec UpdateDatasetResponse
-> ReadPrec [UpdateDatasetResponse]
-> Read UpdateDatasetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDatasetResponse]
$creadListPrec :: ReadPrec [UpdateDatasetResponse]
readPrec :: ReadPrec UpdateDatasetResponse
$creadPrec :: ReadPrec UpdateDatasetResponse
readList :: ReadS [UpdateDatasetResponse]
$creadList :: ReadS [UpdateDatasetResponse]
readsPrec :: Int -> ReadS UpdateDatasetResponse
$creadsPrec :: Int -> ReadS UpdateDatasetResponse
Prelude.Read, Int -> UpdateDatasetResponse -> ShowS
[UpdateDatasetResponse] -> ShowS
UpdateDatasetResponse -> String
(Int -> UpdateDatasetResponse -> ShowS)
-> (UpdateDatasetResponse -> String)
-> ([UpdateDatasetResponse] -> ShowS)
-> Show UpdateDatasetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDatasetResponse] -> ShowS
$cshowList :: [UpdateDatasetResponse] -> ShowS
show :: UpdateDatasetResponse -> String
$cshow :: UpdateDatasetResponse -> String
showsPrec :: Int -> UpdateDatasetResponse -> ShowS
$cshowsPrec :: Int -> UpdateDatasetResponse -> ShowS
Prelude.Show, (forall x. UpdateDatasetResponse -> Rep UpdateDatasetResponse x)
-> (forall x. Rep UpdateDatasetResponse x -> UpdateDatasetResponse)
-> Generic UpdateDatasetResponse
forall x. Rep UpdateDatasetResponse x -> UpdateDatasetResponse
forall x. UpdateDatasetResponse -> Rep UpdateDatasetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDatasetResponse x -> UpdateDatasetResponse
$cfrom :: forall x. UpdateDatasetResponse -> Rep UpdateDatasetResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDatasetResponse' 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.
newUpdateDatasetResponse ::
  UpdateDatasetResponse
newUpdateDatasetResponse :: UpdateDatasetResponse
newUpdateDatasetResponse = UpdateDatasetResponse
UpdateDatasetResponse'

instance Prelude.NFData UpdateDatasetResponse