{-# 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.DatastoreStorage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTAnalytics.Types.CustomerManagedDatastoreS3Storage
import Amazonka.IoTAnalytics.Types.DatastoreIotSiteWiseMultiLayerStorage
import Amazonka.IoTAnalytics.Types.ServiceManagedDatastoreS3Storage
import qualified Amazonka.Prelude as Prelude
data DatastoreStorage = DatastoreStorage'
{
DatastoreStorage -> Maybe CustomerManagedDatastoreS3Storage
customerManagedS3 :: Prelude.Maybe CustomerManagedDatastoreS3Storage,
DatastoreStorage -> Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage :: Prelude.Maybe DatastoreIotSiteWiseMultiLayerStorage,
DatastoreStorage -> Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3 :: Prelude.Maybe ServiceManagedDatastoreS3Storage
}
deriving (DatastoreStorage -> DatastoreStorage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatastoreStorage -> DatastoreStorage -> Bool
$c/= :: DatastoreStorage -> DatastoreStorage -> Bool
== :: DatastoreStorage -> DatastoreStorage -> Bool
$c== :: DatastoreStorage -> DatastoreStorage -> Bool
Prelude.Eq, ReadPrec [DatastoreStorage]
ReadPrec DatastoreStorage
Int -> ReadS DatastoreStorage
ReadS [DatastoreStorage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatastoreStorage]
$creadListPrec :: ReadPrec [DatastoreStorage]
readPrec :: ReadPrec DatastoreStorage
$creadPrec :: ReadPrec DatastoreStorage
readList :: ReadS [DatastoreStorage]
$creadList :: ReadS [DatastoreStorage]
readsPrec :: Int -> ReadS DatastoreStorage
$creadsPrec :: Int -> ReadS DatastoreStorage
Prelude.Read, Int -> DatastoreStorage -> ShowS
[DatastoreStorage] -> ShowS
DatastoreStorage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatastoreStorage] -> ShowS
$cshowList :: [DatastoreStorage] -> ShowS
show :: DatastoreStorage -> String
$cshow :: DatastoreStorage -> String
showsPrec :: Int -> DatastoreStorage -> ShowS
$cshowsPrec :: Int -> DatastoreStorage -> ShowS
Prelude.Show, forall x. Rep DatastoreStorage x -> DatastoreStorage
forall x. DatastoreStorage -> Rep DatastoreStorage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatastoreStorage x -> DatastoreStorage
$cfrom :: forall x. DatastoreStorage -> Rep DatastoreStorage x
Prelude.Generic)
newDatastoreStorage ::
DatastoreStorage
newDatastoreStorage :: DatastoreStorage
newDatastoreStorage =
DatastoreStorage'
{ $sel:customerManagedS3:DatastoreStorage' :: Maybe CustomerManagedDatastoreS3Storage
customerManagedS3 =
forall a. Maybe a
Prelude.Nothing,
$sel:iotSiteWiseMultiLayerStorage:DatastoreStorage' :: Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage = forall a. Maybe a
Prelude.Nothing,
$sel:serviceManagedS3:DatastoreStorage' :: Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3 = forall a. Maybe a
Prelude.Nothing
}
datastoreStorage_customerManagedS3 :: Lens.Lens' DatastoreStorage (Prelude.Maybe CustomerManagedDatastoreS3Storage)
datastoreStorage_customerManagedS3 :: Lens' DatastoreStorage (Maybe CustomerManagedDatastoreS3Storage)
datastoreStorage_customerManagedS3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatastoreStorage' {Maybe CustomerManagedDatastoreS3Storage
customerManagedS3 :: Maybe CustomerManagedDatastoreS3Storage
$sel:customerManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe CustomerManagedDatastoreS3Storage
customerManagedS3} -> Maybe CustomerManagedDatastoreS3Storage
customerManagedS3) (\s :: DatastoreStorage
s@DatastoreStorage' {} Maybe CustomerManagedDatastoreS3Storage
a -> DatastoreStorage
s {$sel:customerManagedS3:DatastoreStorage' :: Maybe CustomerManagedDatastoreS3Storage
customerManagedS3 = Maybe CustomerManagedDatastoreS3Storage
a} :: DatastoreStorage)
datastoreStorage_iotSiteWiseMultiLayerStorage :: Lens.Lens' DatastoreStorage (Prelude.Maybe DatastoreIotSiteWiseMultiLayerStorage)
datastoreStorage_iotSiteWiseMultiLayerStorage :: Lens'
DatastoreStorage (Maybe DatastoreIotSiteWiseMultiLayerStorage)
datastoreStorage_iotSiteWiseMultiLayerStorage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatastoreStorage' {Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage :: Maybe DatastoreIotSiteWiseMultiLayerStorage
$sel:iotSiteWiseMultiLayerStorage:DatastoreStorage' :: DatastoreStorage -> Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage} -> Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage) (\s :: DatastoreStorage
s@DatastoreStorage' {} Maybe DatastoreIotSiteWiseMultiLayerStorage
a -> DatastoreStorage
s {$sel:iotSiteWiseMultiLayerStorage:DatastoreStorage' :: Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage = Maybe DatastoreIotSiteWiseMultiLayerStorage
a} :: DatastoreStorage)
datastoreStorage_serviceManagedS3 :: Lens.Lens' DatastoreStorage (Prelude.Maybe ServiceManagedDatastoreS3Storage)
datastoreStorage_serviceManagedS3 :: Lens' DatastoreStorage (Maybe ServiceManagedDatastoreS3Storage)
datastoreStorage_serviceManagedS3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatastoreStorage' {Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3 :: Maybe ServiceManagedDatastoreS3Storage
$sel:serviceManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3} -> Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3) (\s :: DatastoreStorage
s@DatastoreStorage' {} Maybe ServiceManagedDatastoreS3Storage
a -> DatastoreStorage
s {$sel:serviceManagedS3:DatastoreStorage' :: Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3 = Maybe ServiceManagedDatastoreS3Storage
a} :: DatastoreStorage)
instance Data.FromJSON DatastoreStorage where
parseJSON :: Value -> Parser DatastoreStorage
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DatastoreStorage"
( \Object
x ->
Maybe CustomerManagedDatastoreS3Storage
-> Maybe DatastoreIotSiteWiseMultiLayerStorage
-> Maybe ServiceManagedDatastoreS3Storage
-> DatastoreStorage
DatastoreStorage'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"customerManagedS3")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"iotSiteWiseMultiLayerStorage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"serviceManagedS3")
)
instance Prelude.Hashable DatastoreStorage where
hashWithSalt :: Int -> DatastoreStorage -> Int
hashWithSalt Int
_salt DatastoreStorage' {Maybe CustomerManagedDatastoreS3Storage
Maybe DatastoreIotSiteWiseMultiLayerStorage
Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3 :: Maybe ServiceManagedDatastoreS3Storage
iotSiteWiseMultiLayerStorage :: Maybe DatastoreIotSiteWiseMultiLayerStorage
customerManagedS3 :: Maybe CustomerManagedDatastoreS3Storage
$sel:serviceManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe ServiceManagedDatastoreS3Storage
$sel:iotSiteWiseMultiLayerStorage:DatastoreStorage' :: DatastoreStorage -> Maybe DatastoreIotSiteWiseMultiLayerStorage
$sel:customerManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe CustomerManagedDatastoreS3Storage
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomerManagedDatastoreS3Storage
customerManagedS3
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3
instance Prelude.NFData DatastoreStorage where
rnf :: DatastoreStorage -> ()
rnf DatastoreStorage' {Maybe CustomerManagedDatastoreS3Storage
Maybe DatastoreIotSiteWiseMultiLayerStorage
Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3 :: Maybe ServiceManagedDatastoreS3Storage
iotSiteWiseMultiLayerStorage :: Maybe DatastoreIotSiteWiseMultiLayerStorage
customerManagedS3 :: Maybe CustomerManagedDatastoreS3Storage
$sel:serviceManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe ServiceManagedDatastoreS3Storage
$sel:iotSiteWiseMultiLayerStorage:DatastoreStorage' :: DatastoreStorage -> Maybe DatastoreIotSiteWiseMultiLayerStorage
$sel:customerManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe CustomerManagedDatastoreS3Storage
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomerManagedDatastoreS3Storage
customerManagedS3
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3
instance Data.ToJSON DatastoreStorage where
toJSON :: DatastoreStorage -> Value
toJSON DatastoreStorage' {Maybe CustomerManagedDatastoreS3Storage
Maybe DatastoreIotSiteWiseMultiLayerStorage
Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3 :: Maybe ServiceManagedDatastoreS3Storage
iotSiteWiseMultiLayerStorage :: Maybe DatastoreIotSiteWiseMultiLayerStorage
customerManagedS3 :: Maybe CustomerManagedDatastoreS3Storage
$sel:serviceManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe ServiceManagedDatastoreS3Storage
$sel:iotSiteWiseMultiLayerStorage:DatastoreStorage' :: DatastoreStorage -> Maybe DatastoreIotSiteWiseMultiLayerStorage
$sel:customerManagedS3:DatastoreStorage' :: DatastoreStorage -> Maybe CustomerManagedDatastoreS3Storage
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"customerManagedS3" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomerManagedDatastoreS3Storage
customerManagedS3,
(Key
"iotSiteWiseMultiLayerStorage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DatastoreIotSiteWiseMultiLayerStorage
iotSiteWiseMultiLayerStorage,
(Key
"serviceManagedS3" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceManagedDatastoreS3Storage
serviceManagedS3
]
)