{-# 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 #-}
module Amazonka.IoTAnalytics.CreateDataset
(
CreateDataset (..),
newCreateDataset,
createDataset_versioningConfiguration,
createDataset_triggers,
createDataset_retentionPeriod,
createDataset_lateDataRules,
createDataset_contentDeliveryRules,
createDataset_tags,
createDataset_datasetName,
createDataset_actions,
CreateDatasetResponse (..),
newCreateDatasetResponse,
createDatasetResponse_datasetArn,
createDatasetResponse_retentionPeriod,
createDatasetResponse_datasetName,
createDatasetResponse_httpStatus,
)
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
data CreateDataset = CreateDataset'
{
CreateDataset -> Maybe VersioningConfiguration
versioningConfiguration :: Prelude.Maybe VersioningConfiguration,
CreateDataset -> Maybe [DatasetTrigger]
triggers :: Prelude.Maybe [DatasetTrigger],
CreateDataset -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
CreateDataset -> Maybe (NonEmpty LateDataRule)
lateDataRules :: Prelude.Maybe (Prelude.NonEmpty LateDataRule),
CreateDataset -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules :: Prelude.Maybe [DatasetContentDeliveryRule],
CreateDataset -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateDataset -> Text
datasetName :: Prelude.Text,
CreateDataset -> NonEmpty DatasetAction
actions :: Prelude.NonEmpty DatasetAction
}
deriving (CreateDataset -> CreateDataset -> Bool
(CreateDataset -> CreateDataset -> Bool)
-> (CreateDataset -> CreateDataset -> Bool) -> Eq CreateDataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataset -> CreateDataset -> Bool
$c/= :: CreateDataset -> CreateDataset -> Bool
== :: CreateDataset -> CreateDataset -> Bool
$c== :: CreateDataset -> CreateDataset -> Bool
Prelude.Eq, ReadPrec [CreateDataset]
ReadPrec CreateDataset
Int -> ReadS CreateDataset
ReadS [CreateDataset]
(Int -> ReadS CreateDataset)
-> ReadS [CreateDataset]
-> ReadPrec CreateDataset
-> ReadPrec [CreateDataset]
-> Read CreateDataset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDataset]
$creadListPrec :: ReadPrec [CreateDataset]
readPrec :: ReadPrec CreateDataset
$creadPrec :: ReadPrec CreateDataset
readList :: ReadS [CreateDataset]
$creadList :: ReadS [CreateDataset]
readsPrec :: Int -> ReadS CreateDataset
$creadsPrec :: Int -> ReadS CreateDataset
Prelude.Read, Int -> CreateDataset -> ShowS
[CreateDataset] -> ShowS
CreateDataset -> String
(Int -> CreateDataset -> ShowS)
-> (CreateDataset -> String)
-> ([CreateDataset] -> ShowS)
-> Show CreateDataset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataset] -> ShowS
$cshowList :: [CreateDataset] -> ShowS
show :: CreateDataset -> String
$cshow :: CreateDataset -> String
showsPrec :: Int -> CreateDataset -> ShowS
$cshowsPrec :: Int -> CreateDataset -> ShowS
Prelude.Show, (forall x. CreateDataset -> Rep CreateDataset x)
-> (forall x. Rep CreateDataset x -> CreateDataset)
-> Generic CreateDataset
forall x. Rep CreateDataset x -> CreateDataset
forall x. CreateDataset -> Rep CreateDataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDataset x -> CreateDataset
$cfrom :: forall x. CreateDataset -> Rep CreateDataset x
Prelude.Generic)
newCreateDataset ::
Prelude.Text ->
Prelude.NonEmpty DatasetAction ->
CreateDataset
newCreateDataset :: Text -> NonEmpty DatasetAction -> CreateDataset
newCreateDataset Text
pDatasetName_ NonEmpty DatasetAction
pActions_ =
CreateDataset' :: Maybe VersioningConfiguration
-> Maybe [DatasetTrigger]
-> Maybe RetentionPeriod
-> Maybe (NonEmpty LateDataRule)
-> Maybe [DatasetContentDeliveryRule]
-> Maybe (NonEmpty Tag)
-> Text
-> NonEmpty DatasetAction
-> CreateDataset
CreateDataset'
{ $sel:versioningConfiguration:CreateDataset' :: Maybe VersioningConfiguration
versioningConfiguration =
Maybe VersioningConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:triggers:CreateDataset' :: Maybe [DatasetTrigger]
triggers = Maybe [DatasetTrigger]
forall a. Maybe a
Prelude.Nothing,
$sel:retentionPeriod:CreateDataset' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
$sel:lateDataRules:CreateDataset' :: Maybe (NonEmpty LateDataRule)
lateDataRules = Maybe (NonEmpty LateDataRule)
forall a. Maybe a
Prelude.Nothing,
$sel:contentDeliveryRules:CreateDataset' :: Maybe [DatasetContentDeliveryRule]
contentDeliveryRules = Maybe [DatasetContentDeliveryRule]
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDataset' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:datasetName:CreateDataset' :: Text
datasetName = Text
pDatasetName_,
$sel:actions:CreateDataset' :: 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_
}
createDataset_versioningConfiguration :: Lens.Lens' CreateDataset (Prelude.Maybe VersioningConfiguration)
createDataset_versioningConfiguration :: (Maybe VersioningConfiguration
-> f (Maybe VersioningConfiguration))
-> CreateDataset -> f CreateDataset
createDataset_versioningConfiguration = (CreateDataset -> Maybe VersioningConfiguration)
-> (CreateDataset
-> Maybe VersioningConfiguration -> CreateDataset)
-> Lens
CreateDataset
CreateDataset
(Maybe VersioningConfiguration)
(Maybe VersioningConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe VersioningConfiguration
versioningConfiguration :: Maybe VersioningConfiguration
$sel:versioningConfiguration:CreateDataset' :: CreateDataset -> Maybe VersioningConfiguration
versioningConfiguration} -> Maybe VersioningConfiguration
versioningConfiguration) (\s :: CreateDataset
s@CreateDataset' {} Maybe VersioningConfiguration
a -> CreateDataset
s {$sel:versioningConfiguration:CreateDataset' :: Maybe VersioningConfiguration
versioningConfiguration = Maybe VersioningConfiguration
a} :: CreateDataset)
createDataset_triggers :: Lens.Lens' CreateDataset (Prelude.Maybe [DatasetTrigger])
createDataset_triggers :: (Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> CreateDataset -> f CreateDataset
createDataset_triggers = (CreateDataset -> Maybe [DatasetTrigger])
-> (CreateDataset -> Maybe [DatasetTrigger] -> CreateDataset)
-> Lens
CreateDataset
CreateDataset
(Maybe [DatasetTrigger])
(Maybe [DatasetTrigger])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe [DatasetTrigger]
triggers :: Maybe [DatasetTrigger]
$sel:triggers:CreateDataset' :: CreateDataset -> Maybe [DatasetTrigger]
triggers} -> Maybe [DatasetTrigger]
triggers) (\s :: CreateDataset
s@CreateDataset' {} Maybe [DatasetTrigger]
a -> CreateDataset
s {$sel:triggers:CreateDataset' :: Maybe [DatasetTrigger]
triggers = Maybe [DatasetTrigger]
a} :: CreateDataset) ((Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> CreateDataset -> f CreateDataset)
-> ((Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> (Maybe [DatasetTrigger] -> f (Maybe [DatasetTrigger]))
-> CreateDataset
-> f CreateDataset
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
createDataset_retentionPeriod :: Lens.Lens' CreateDataset (Prelude.Maybe RetentionPeriod)
createDataset_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> CreateDataset -> f CreateDataset
createDataset_retentionPeriod = (CreateDataset -> Maybe RetentionPeriod)
-> (CreateDataset -> Maybe RetentionPeriod -> CreateDataset)
-> Lens
CreateDataset
CreateDataset
(Maybe RetentionPeriod)
(Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:CreateDataset' :: CreateDataset -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: CreateDataset
s@CreateDataset' {} Maybe RetentionPeriod
a -> CreateDataset
s {$sel:retentionPeriod:CreateDataset' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: CreateDataset)
createDataset_lateDataRules :: Lens.Lens' CreateDataset (Prelude.Maybe (Prelude.NonEmpty LateDataRule))
createDataset_lateDataRules :: (Maybe (NonEmpty LateDataRule)
-> f (Maybe (NonEmpty LateDataRule)))
-> CreateDataset -> f CreateDataset
createDataset_lateDataRules = (CreateDataset -> Maybe (NonEmpty LateDataRule))
-> (CreateDataset
-> Maybe (NonEmpty LateDataRule) -> CreateDataset)
-> Lens
CreateDataset
CreateDataset
(Maybe (NonEmpty LateDataRule))
(Maybe (NonEmpty LateDataRule))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe (NonEmpty LateDataRule)
lateDataRules :: Maybe (NonEmpty LateDataRule)
$sel:lateDataRules:CreateDataset' :: CreateDataset -> Maybe (NonEmpty LateDataRule)
lateDataRules} -> Maybe (NonEmpty LateDataRule)
lateDataRules) (\s :: CreateDataset
s@CreateDataset' {} Maybe (NonEmpty LateDataRule)
a -> CreateDataset
s {$sel:lateDataRules:CreateDataset' :: Maybe (NonEmpty LateDataRule)
lateDataRules = Maybe (NonEmpty LateDataRule)
a} :: CreateDataset) ((Maybe (NonEmpty LateDataRule)
-> f (Maybe (NonEmpty LateDataRule)))
-> CreateDataset -> f CreateDataset)
-> ((Maybe (NonEmpty LateDataRule)
-> f (Maybe (NonEmpty LateDataRule)))
-> Maybe (NonEmpty LateDataRule)
-> f (Maybe (NonEmpty LateDataRule)))
-> (Maybe (NonEmpty LateDataRule)
-> f (Maybe (NonEmpty LateDataRule)))
-> CreateDataset
-> f CreateDataset
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
createDataset_contentDeliveryRules :: Lens.Lens' CreateDataset (Prelude.Maybe [DatasetContentDeliveryRule])
createDataset_contentDeliveryRules :: (Maybe [DatasetContentDeliveryRule]
-> f (Maybe [DatasetContentDeliveryRule]))
-> CreateDataset -> f CreateDataset
createDataset_contentDeliveryRules = (CreateDataset -> Maybe [DatasetContentDeliveryRule])
-> (CreateDataset
-> Maybe [DatasetContentDeliveryRule] -> CreateDataset)
-> Lens
CreateDataset
CreateDataset
(Maybe [DatasetContentDeliveryRule])
(Maybe [DatasetContentDeliveryRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe [DatasetContentDeliveryRule]
contentDeliveryRules :: Maybe [DatasetContentDeliveryRule]
$sel:contentDeliveryRules:CreateDataset' :: CreateDataset -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules} -> Maybe [DatasetContentDeliveryRule]
contentDeliveryRules) (\s :: CreateDataset
s@CreateDataset' {} Maybe [DatasetContentDeliveryRule]
a -> CreateDataset
s {$sel:contentDeliveryRules:CreateDataset' :: Maybe [DatasetContentDeliveryRule]
contentDeliveryRules = Maybe [DatasetContentDeliveryRule]
a} :: CreateDataset) ((Maybe [DatasetContentDeliveryRule]
-> f (Maybe [DatasetContentDeliveryRule]))
-> CreateDataset -> f CreateDataset)
-> ((Maybe [DatasetContentDeliveryRule]
-> f (Maybe [DatasetContentDeliveryRule]))
-> Maybe [DatasetContentDeliveryRule]
-> f (Maybe [DatasetContentDeliveryRule]))
-> (Maybe [DatasetContentDeliveryRule]
-> f (Maybe [DatasetContentDeliveryRule]))
-> CreateDataset
-> f CreateDataset
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
createDataset_tags :: Lens.Lens' CreateDataset (Prelude.Maybe (Prelude.NonEmpty Tag))
createDataset_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDataset -> f CreateDataset
createDataset_tags = (CreateDataset -> Maybe (NonEmpty Tag))
-> (CreateDataset -> Maybe (NonEmpty Tag) -> CreateDataset)
-> Lens
CreateDataset
CreateDataset
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateDataset' :: CreateDataset -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateDataset
s@CreateDataset' {} Maybe (NonEmpty Tag)
a -> CreateDataset
s {$sel:tags:CreateDataset' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateDataset) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDataset -> f CreateDataset)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDataset
-> f CreateDataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDataset_datasetName :: Lens.Lens' CreateDataset Prelude.Text
createDataset_datasetName :: (Text -> f Text) -> CreateDataset -> f CreateDataset
createDataset_datasetName = (CreateDataset -> Text)
-> (CreateDataset -> Text -> CreateDataset)
-> Lens CreateDataset CreateDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Text
datasetName :: Text
$sel:datasetName:CreateDataset' :: CreateDataset -> Text
datasetName} -> Text
datasetName) (\s :: CreateDataset
s@CreateDataset' {} Text
a -> CreateDataset
s {$sel:datasetName:CreateDataset' :: Text
datasetName = Text
a} :: CreateDataset)
createDataset_actions :: Lens.Lens' CreateDataset (Prelude.NonEmpty DatasetAction)
createDataset_actions :: (NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> CreateDataset -> f CreateDataset
createDataset_actions = (CreateDataset -> NonEmpty DatasetAction)
-> (CreateDataset -> NonEmpty DatasetAction -> CreateDataset)
-> Lens
CreateDataset
CreateDataset
(NonEmpty DatasetAction)
(NonEmpty DatasetAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {NonEmpty DatasetAction
actions :: NonEmpty DatasetAction
$sel:actions:CreateDataset' :: CreateDataset -> NonEmpty DatasetAction
actions} -> NonEmpty DatasetAction
actions) (\s :: CreateDataset
s@CreateDataset' {} NonEmpty DatasetAction
a -> CreateDataset
s {$sel:actions:CreateDataset' :: NonEmpty DatasetAction
actions = NonEmpty DatasetAction
a} :: CreateDataset) ((NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> CreateDataset -> f CreateDataset)
-> ((NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> (NonEmpty DatasetAction -> f (NonEmpty DatasetAction))
-> CreateDataset
-> f CreateDataset
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 CreateDataset where
type
AWSResponse CreateDataset =
CreateDatasetResponse
request :: CreateDataset -> Request CreateDataset
request = Service -> CreateDataset -> Request CreateDataset
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDataset)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDataset))
-> Logger
-> Service
-> Proxy CreateDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDataset)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe RetentionPeriod
-> Maybe Text
-> Int
-> CreateDatasetResponse
CreateDatasetResponse'
(Maybe Text
-> Maybe RetentionPeriod
-> Maybe Text
-> Int
-> CreateDatasetResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe RetentionPeriod
-> Maybe Text -> Int -> CreateDatasetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"datasetArn")
Either
String
(Maybe RetentionPeriod
-> Maybe Text -> Int -> CreateDatasetResponse)
-> Either String (Maybe RetentionPeriod)
-> Either String (Maybe Text -> Int -> CreateDatasetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe RetentionPeriod)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"retentionPeriod")
Either String (Maybe Text -> Int -> CreateDatasetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDatasetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"datasetName")
Either String (Int -> CreateDatasetResponse)
-> Either String Int -> Either String CreateDatasetResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateDataset
instance Prelude.NFData CreateDataset
instance Core.ToHeaders CreateDataset where
toHeaders :: CreateDataset -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateDataset -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON CreateDataset where
toJSON :: CreateDataset -> Value
toJSON CreateDataset' {Maybe [DatasetContentDeliveryRule]
Maybe [DatasetTrigger]
Maybe (NonEmpty LateDataRule)
Maybe (NonEmpty Tag)
Maybe RetentionPeriod
Maybe VersioningConfiguration
NonEmpty DatasetAction
Text
actions :: NonEmpty DatasetAction
datasetName :: Text
tags :: Maybe (NonEmpty Tag)
contentDeliveryRules :: Maybe [DatasetContentDeliveryRule]
lateDataRules :: Maybe (NonEmpty LateDataRule)
retentionPeriod :: Maybe RetentionPeriod
triggers :: Maybe [DatasetTrigger]
versioningConfiguration :: Maybe VersioningConfiguration
$sel:actions:CreateDataset' :: CreateDataset -> NonEmpty DatasetAction
$sel:datasetName:CreateDataset' :: CreateDataset -> Text
$sel:tags:CreateDataset' :: CreateDataset -> Maybe (NonEmpty Tag)
$sel:contentDeliveryRules:CreateDataset' :: CreateDataset -> Maybe [DatasetContentDeliveryRule]
$sel:lateDataRules:CreateDataset' :: CreateDataset -> Maybe (NonEmpty LateDataRule)
$sel:retentionPeriod:CreateDataset' :: CreateDataset -> Maybe RetentionPeriod
$sel:triggers:CreateDataset' :: CreateDataset -> Maybe [DatasetTrigger]
$sel:versioningConfiguration:CreateDataset' :: CreateDataset -> 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,
(Text
"tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"datasetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetName),
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 CreateDataset where
toPath :: CreateDataset -> ByteString
toPath = ByteString -> CreateDataset -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/datasets"
instance Core.ToQuery CreateDataset where
toQuery :: CreateDataset -> QueryString
toQuery = QueryString -> CreateDataset -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDatasetResponse = CreateDatasetResponse'
{
CreateDatasetResponse -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
CreateDatasetResponse -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
CreateDatasetResponse -> Maybe Text
datasetName :: Prelude.Maybe Prelude.Text,
CreateDatasetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDatasetResponse -> CreateDatasetResponse -> Bool
(CreateDatasetResponse -> CreateDatasetResponse -> Bool)
-> (CreateDatasetResponse -> CreateDatasetResponse -> Bool)
-> Eq CreateDatasetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
$c/= :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
== :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
$c== :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
Prelude.Eq, ReadPrec [CreateDatasetResponse]
ReadPrec CreateDatasetResponse
Int -> ReadS CreateDatasetResponse
ReadS [CreateDatasetResponse]
(Int -> ReadS CreateDatasetResponse)
-> ReadS [CreateDatasetResponse]
-> ReadPrec CreateDatasetResponse
-> ReadPrec [CreateDatasetResponse]
-> Read CreateDatasetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDatasetResponse]
$creadListPrec :: ReadPrec [CreateDatasetResponse]
readPrec :: ReadPrec CreateDatasetResponse
$creadPrec :: ReadPrec CreateDatasetResponse
readList :: ReadS [CreateDatasetResponse]
$creadList :: ReadS [CreateDatasetResponse]
readsPrec :: Int -> ReadS CreateDatasetResponse
$creadsPrec :: Int -> ReadS CreateDatasetResponse
Prelude.Read, Int -> CreateDatasetResponse -> ShowS
[CreateDatasetResponse] -> ShowS
CreateDatasetResponse -> String
(Int -> CreateDatasetResponse -> ShowS)
-> (CreateDatasetResponse -> String)
-> ([CreateDatasetResponse] -> ShowS)
-> Show CreateDatasetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDatasetResponse] -> ShowS
$cshowList :: [CreateDatasetResponse] -> ShowS
show :: CreateDatasetResponse -> String
$cshow :: CreateDatasetResponse -> String
showsPrec :: Int -> CreateDatasetResponse -> ShowS
$cshowsPrec :: Int -> CreateDatasetResponse -> ShowS
Prelude.Show, (forall x. CreateDatasetResponse -> Rep CreateDatasetResponse x)
-> (forall x. Rep CreateDatasetResponse x -> CreateDatasetResponse)
-> Generic CreateDatasetResponse
forall x. Rep CreateDatasetResponse x -> CreateDatasetResponse
forall x. CreateDatasetResponse -> Rep CreateDatasetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDatasetResponse x -> CreateDatasetResponse
$cfrom :: forall x. CreateDatasetResponse -> Rep CreateDatasetResponse x
Prelude.Generic)
newCreateDatasetResponse ::
Prelude.Int ->
CreateDatasetResponse
newCreateDatasetResponse :: Int -> CreateDatasetResponse
newCreateDatasetResponse Int
pHttpStatus_ =
CreateDatasetResponse' :: Maybe Text
-> Maybe RetentionPeriod
-> Maybe Text
-> Int
-> CreateDatasetResponse
CreateDatasetResponse'
{ $sel:datasetArn:CreateDatasetResponse' :: Maybe Text
datasetArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:retentionPeriod:CreateDatasetResponse' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
$sel:datasetName:CreateDatasetResponse' :: Maybe Text
datasetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDatasetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createDatasetResponse_datasetArn :: Lens.Lens' CreateDatasetResponse (Prelude.Maybe Prelude.Text)
createDatasetResponse_datasetArn :: (Maybe Text -> f (Maybe Text))
-> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_datasetArn = (CreateDatasetResponse -> Maybe Text)
-> (CreateDatasetResponse -> Maybe Text -> CreateDatasetResponse)
-> Lens
CreateDatasetResponse
CreateDatasetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Maybe Text
datasetArn :: Maybe Text
$sel:datasetArn:CreateDatasetResponse' :: CreateDatasetResponse -> Maybe Text
datasetArn} -> Maybe Text
datasetArn) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Maybe Text
a -> CreateDatasetResponse
s {$sel:datasetArn:CreateDatasetResponse' :: Maybe Text
datasetArn = Maybe Text
a} :: CreateDatasetResponse)
createDatasetResponse_retentionPeriod :: Lens.Lens' CreateDatasetResponse (Prelude.Maybe RetentionPeriod)
createDatasetResponse_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_retentionPeriod = (CreateDatasetResponse -> Maybe RetentionPeriod)
-> (CreateDatasetResponse
-> Maybe RetentionPeriod -> CreateDatasetResponse)
-> Lens
CreateDatasetResponse
CreateDatasetResponse
(Maybe RetentionPeriod)
(Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:CreateDatasetResponse' :: CreateDatasetResponse -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Maybe RetentionPeriod
a -> CreateDatasetResponse
s {$sel:retentionPeriod:CreateDatasetResponse' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: CreateDatasetResponse)
createDatasetResponse_datasetName :: Lens.Lens' CreateDatasetResponse (Prelude.Maybe Prelude.Text)
createDatasetResponse_datasetName :: (Maybe Text -> f (Maybe Text))
-> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_datasetName = (CreateDatasetResponse -> Maybe Text)
-> (CreateDatasetResponse -> Maybe Text -> CreateDatasetResponse)
-> Lens
CreateDatasetResponse
CreateDatasetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Maybe Text
datasetName :: Maybe Text
$sel:datasetName:CreateDatasetResponse' :: CreateDatasetResponse -> Maybe Text
datasetName} -> Maybe Text
datasetName) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Maybe Text
a -> CreateDatasetResponse
s {$sel:datasetName:CreateDatasetResponse' :: Maybe Text
datasetName = Maybe Text
a} :: CreateDatasetResponse)
createDatasetResponse_httpStatus :: Lens.Lens' CreateDatasetResponse Prelude.Int
createDatasetResponse_httpStatus :: (Int -> f Int) -> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_httpStatus = (CreateDatasetResponse -> Int)
-> (CreateDatasetResponse -> Int -> CreateDatasetResponse)
-> Lens CreateDatasetResponse CreateDatasetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDatasetResponse' :: CreateDatasetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Int
a -> CreateDatasetResponse
s {$sel:httpStatus:CreateDatasetResponse' :: Int
httpStatus = Int
a} :: CreateDatasetResponse)
instance Prelude.NFData CreateDatasetResponse