{-# 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 #-}
module Amazonka.IoTAnalytics.Types.DatasetContentDeliveryDestination where
import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.IotEventsDestinationConfiguration
import Amazonka.IoTAnalytics.Types.S3DestinationConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DatasetContentDeliveryDestination = DatasetContentDeliveryDestination'
{
DatasetContentDeliveryDestination
-> Maybe S3DestinationConfiguration
s3DestinationConfiguration :: Prelude.Maybe S3DestinationConfiguration,
DatasetContentDeliveryDestination
-> Maybe IotEventsDestinationConfiguration
iotEventsDestinationConfiguration :: Prelude.Maybe IotEventsDestinationConfiguration
}
deriving (DatasetContentDeliveryDestination
-> DatasetContentDeliveryDestination -> Bool
(DatasetContentDeliveryDestination
-> DatasetContentDeliveryDestination -> Bool)
-> (DatasetContentDeliveryDestination
-> DatasetContentDeliveryDestination -> Bool)
-> Eq DatasetContentDeliveryDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetContentDeliveryDestination
-> DatasetContentDeliveryDestination -> Bool
$c/= :: DatasetContentDeliveryDestination
-> DatasetContentDeliveryDestination -> Bool
== :: DatasetContentDeliveryDestination
-> DatasetContentDeliveryDestination -> Bool
$c== :: DatasetContentDeliveryDestination
-> DatasetContentDeliveryDestination -> Bool
Prelude.Eq, ReadPrec [DatasetContentDeliveryDestination]
ReadPrec DatasetContentDeliveryDestination
Int -> ReadS DatasetContentDeliveryDestination
ReadS [DatasetContentDeliveryDestination]
(Int -> ReadS DatasetContentDeliveryDestination)
-> ReadS [DatasetContentDeliveryDestination]
-> ReadPrec DatasetContentDeliveryDestination
-> ReadPrec [DatasetContentDeliveryDestination]
-> Read DatasetContentDeliveryDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetContentDeliveryDestination]
$creadListPrec :: ReadPrec [DatasetContentDeliveryDestination]
readPrec :: ReadPrec DatasetContentDeliveryDestination
$creadPrec :: ReadPrec DatasetContentDeliveryDestination
readList :: ReadS [DatasetContentDeliveryDestination]
$creadList :: ReadS [DatasetContentDeliveryDestination]
readsPrec :: Int -> ReadS DatasetContentDeliveryDestination
$creadsPrec :: Int -> ReadS DatasetContentDeliveryDestination
Prelude.Read, Int -> DatasetContentDeliveryDestination -> ShowS
[DatasetContentDeliveryDestination] -> ShowS
DatasetContentDeliveryDestination -> String
(Int -> DatasetContentDeliveryDestination -> ShowS)
-> (DatasetContentDeliveryDestination -> String)
-> ([DatasetContentDeliveryDestination] -> ShowS)
-> Show DatasetContentDeliveryDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetContentDeliveryDestination] -> ShowS
$cshowList :: [DatasetContentDeliveryDestination] -> ShowS
show :: DatasetContentDeliveryDestination -> String
$cshow :: DatasetContentDeliveryDestination -> String
showsPrec :: Int -> DatasetContentDeliveryDestination -> ShowS
$cshowsPrec :: Int -> DatasetContentDeliveryDestination -> ShowS
Prelude.Show, (forall x.
DatasetContentDeliveryDestination
-> Rep DatasetContentDeliveryDestination x)
-> (forall x.
Rep DatasetContentDeliveryDestination x
-> DatasetContentDeliveryDestination)
-> Generic DatasetContentDeliveryDestination
forall x.
Rep DatasetContentDeliveryDestination x
-> DatasetContentDeliveryDestination
forall x.
DatasetContentDeliveryDestination
-> Rep DatasetContentDeliveryDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DatasetContentDeliveryDestination x
-> DatasetContentDeliveryDestination
$cfrom :: forall x.
DatasetContentDeliveryDestination
-> Rep DatasetContentDeliveryDestination x
Prelude.Generic)
newDatasetContentDeliveryDestination ::
DatasetContentDeliveryDestination
newDatasetContentDeliveryDestination :: DatasetContentDeliveryDestination
newDatasetContentDeliveryDestination =
DatasetContentDeliveryDestination' :: Maybe S3DestinationConfiguration
-> Maybe IotEventsDestinationConfiguration
-> DatasetContentDeliveryDestination
DatasetContentDeliveryDestination'
{ $sel:s3DestinationConfiguration:DatasetContentDeliveryDestination' :: Maybe S3DestinationConfiguration
s3DestinationConfiguration =
Maybe S3DestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:iotEventsDestinationConfiguration:DatasetContentDeliveryDestination' :: Maybe IotEventsDestinationConfiguration
iotEventsDestinationConfiguration =
Maybe IotEventsDestinationConfiguration
forall a. Maybe a
Prelude.Nothing
}
datasetContentDeliveryDestination_s3DestinationConfiguration :: Lens.Lens' DatasetContentDeliveryDestination (Prelude.Maybe S3DestinationConfiguration)
datasetContentDeliveryDestination_s3DestinationConfiguration :: (Maybe S3DestinationConfiguration
-> f (Maybe S3DestinationConfiguration))
-> DatasetContentDeliveryDestination
-> f DatasetContentDeliveryDestination
datasetContentDeliveryDestination_s3DestinationConfiguration = (DatasetContentDeliveryDestination
-> Maybe S3DestinationConfiguration)
-> (DatasetContentDeliveryDestination
-> Maybe S3DestinationConfiguration
-> DatasetContentDeliveryDestination)
-> Lens
DatasetContentDeliveryDestination
DatasetContentDeliveryDestination
(Maybe S3DestinationConfiguration)
(Maybe S3DestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetContentDeliveryDestination' {Maybe S3DestinationConfiguration
s3DestinationConfiguration :: Maybe S3DestinationConfiguration
$sel:s3DestinationConfiguration:DatasetContentDeliveryDestination' :: DatasetContentDeliveryDestination
-> Maybe S3DestinationConfiguration
s3DestinationConfiguration} -> Maybe S3DestinationConfiguration
s3DestinationConfiguration) (\s :: DatasetContentDeliveryDestination
s@DatasetContentDeliveryDestination' {} Maybe S3DestinationConfiguration
a -> DatasetContentDeliveryDestination
s {$sel:s3DestinationConfiguration:DatasetContentDeliveryDestination' :: Maybe S3DestinationConfiguration
s3DestinationConfiguration = Maybe S3DestinationConfiguration
a} :: DatasetContentDeliveryDestination)
datasetContentDeliveryDestination_iotEventsDestinationConfiguration :: Lens.Lens' DatasetContentDeliveryDestination (Prelude.Maybe IotEventsDestinationConfiguration)
datasetContentDeliveryDestination_iotEventsDestinationConfiguration :: (Maybe IotEventsDestinationConfiguration
-> f (Maybe IotEventsDestinationConfiguration))
-> DatasetContentDeliveryDestination
-> f DatasetContentDeliveryDestination
datasetContentDeliveryDestination_iotEventsDestinationConfiguration = (DatasetContentDeliveryDestination
-> Maybe IotEventsDestinationConfiguration)
-> (DatasetContentDeliveryDestination
-> Maybe IotEventsDestinationConfiguration
-> DatasetContentDeliveryDestination)
-> Lens
DatasetContentDeliveryDestination
DatasetContentDeliveryDestination
(Maybe IotEventsDestinationConfiguration)
(Maybe IotEventsDestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetContentDeliveryDestination' {Maybe IotEventsDestinationConfiguration
iotEventsDestinationConfiguration :: Maybe IotEventsDestinationConfiguration
$sel:iotEventsDestinationConfiguration:DatasetContentDeliveryDestination' :: DatasetContentDeliveryDestination
-> Maybe IotEventsDestinationConfiguration
iotEventsDestinationConfiguration} -> Maybe IotEventsDestinationConfiguration
iotEventsDestinationConfiguration) (\s :: DatasetContentDeliveryDestination
s@DatasetContentDeliveryDestination' {} Maybe IotEventsDestinationConfiguration
a -> DatasetContentDeliveryDestination
s {$sel:iotEventsDestinationConfiguration:DatasetContentDeliveryDestination' :: Maybe IotEventsDestinationConfiguration
iotEventsDestinationConfiguration = Maybe IotEventsDestinationConfiguration
a} :: DatasetContentDeliveryDestination)
instance
Core.FromJSON
DatasetContentDeliveryDestination
where
parseJSON :: Value -> Parser DatasetContentDeliveryDestination
parseJSON =
String
-> (Object -> Parser DatasetContentDeliveryDestination)
-> Value
-> Parser DatasetContentDeliveryDestination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DatasetContentDeliveryDestination"
( \Object
x ->
Maybe S3DestinationConfiguration
-> Maybe IotEventsDestinationConfiguration
-> DatasetContentDeliveryDestination
DatasetContentDeliveryDestination'
(Maybe S3DestinationConfiguration
-> Maybe IotEventsDestinationConfiguration
-> DatasetContentDeliveryDestination)
-> Parser (Maybe S3DestinationConfiguration)
-> Parser
(Maybe IotEventsDestinationConfiguration
-> DatasetContentDeliveryDestination)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3DestinationConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3DestinationConfiguration")
Parser
(Maybe IotEventsDestinationConfiguration
-> DatasetContentDeliveryDestination)
-> Parser (Maybe IotEventsDestinationConfiguration)
-> Parser DatasetContentDeliveryDestination
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IotEventsDestinationConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iotEventsDestinationConfiguration")
)
instance
Prelude.Hashable
DatasetContentDeliveryDestination
instance
Prelude.NFData
DatasetContentDeliveryDestination
instance
Core.ToJSON
DatasetContentDeliveryDestination
where
toJSON :: DatasetContentDeliveryDestination -> Value
toJSON DatasetContentDeliveryDestination' {Maybe IotEventsDestinationConfiguration
Maybe S3DestinationConfiguration
iotEventsDestinationConfiguration :: Maybe IotEventsDestinationConfiguration
s3DestinationConfiguration :: Maybe S3DestinationConfiguration
$sel:iotEventsDestinationConfiguration:DatasetContentDeliveryDestination' :: DatasetContentDeliveryDestination
-> Maybe IotEventsDestinationConfiguration
$sel:s3DestinationConfiguration:DatasetContentDeliveryDestination' :: DatasetContentDeliveryDestination
-> Maybe S3DestinationConfiguration
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"s3DestinationConfiguration" Text -> S3DestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(S3DestinationConfiguration -> Pair)
-> Maybe S3DestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3DestinationConfiguration
s3DestinationConfiguration,
(Text
"iotEventsDestinationConfiguration" Text -> IotEventsDestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(IotEventsDestinationConfiguration -> Pair)
-> Maybe IotEventsDestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IotEventsDestinationConfiguration
iotEventsDestinationConfiguration
]
)