{-# 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.DatastoreStorageSummary
-- 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.DatastoreStorageSummary where

import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.CustomerManagedDatastoreS3StorageSummary
import Amazonka.IoTAnalytics.Types.DatastoreIotSiteWiseMultiLayerStorageSummary
import Amazonka.IoTAnalytics.Types.ServiceManagedDatastoreS3StorageSummary
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about your data store.
--
-- /See:/ 'newDatastoreStorageSummary' smart constructor.
data DatastoreStorageSummary = DatastoreStorageSummary'
  { -- | Used to store data in an Amazon S3 bucket managed by IoT Analytics.
    DatastoreStorageSummary
-> Maybe ServiceManagedDatastoreS3StorageSummary
serviceManagedS3 :: Prelude.Maybe ServiceManagedDatastoreS3StorageSummary,
    -- | Used to store data in an Amazon S3 bucket managed by IoT Analytics.
    DatastoreStorageSummary
-> Maybe CustomerManagedDatastoreS3StorageSummary
customerManagedS3 :: Prelude.Maybe CustomerManagedDatastoreS3StorageSummary,
    -- | Used to store data used by IoT SiteWise in an Amazon S3 bucket that you
    -- manage.
    DatastoreStorageSummary
-> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
iotSiteWiseMultiLayerStorage :: Prelude.Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
  }
  deriving (DatastoreStorageSummary -> DatastoreStorageSummary -> Bool
(DatastoreStorageSummary -> DatastoreStorageSummary -> Bool)
-> (DatastoreStorageSummary -> DatastoreStorageSummary -> Bool)
-> Eq DatastoreStorageSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatastoreStorageSummary -> DatastoreStorageSummary -> Bool
$c/= :: DatastoreStorageSummary -> DatastoreStorageSummary -> Bool
== :: DatastoreStorageSummary -> DatastoreStorageSummary -> Bool
$c== :: DatastoreStorageSummary -> DatastoreStorageSummary -> Bool
Prelude.Eq, ReadPrec [DatastoreStorageSummary]
ReadPrec DatastoreStorageSummary
Int -> ReadS DatastoreStorageSummary
ReadS [DatastoreStorageSummary]
(Int -> ReadS DatastoreStorageSummary)
-> ReadS [DatastoreStorageSummary]
-> ReadPrec DatastoreStorageSummary
-> ReadPrec [DatastoreStorageSummary]
-> Read DatastoreStorageSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatastoreStorageSummary]
$creadListPrec :: ReadPrec [DatastoreStorageSummary]
readPrec :: ReadPrec DatastoreStorageSummary
$creadPrec :: ReadPrec DatastoreStorageSummary
readList :: ReadS [DatastoreStorageSummary]
$creadList :: ReadS [DatastoreStorageSummary]
readsPrec :: Int -> ReadS DatastoreStorageSummary
$creadsPrec :: Int -> ReadS DatastoreStorageSummary
Prelude.Read, Int -> DatastoreStorageSummary -> ShowS
[DatastoreStorageSummary] -> ShowS
DatastoreStorageSummary -> String
(Int -> DatastoreStorageSummary -> ShowS)
-> (DatastoreStorageSummary -> String)
-> ([DatastoreStorageSummary] -> ShowS)
-> Show DatastoreStorageSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatastoreStorageSummary] -> ShowS
$cshowList :: [DatastoreStorageSummary] -> ShowS
show :: DatastoreStorageSummary -> String
$cshow :: DatastoreStorageSummary -> String
showsPrec :: Int -> DatastoreStorageSummary -> ShowS
$cshowsPrec :: Int -> DatastoreStorageSummary -> ShowS
Prelude.Show, (forall x.
 DatastoreStorageSummary -> Rep DatastoreStorageSummary x)
-> (forall x.
    Rep DatastoreStorageSummary x -> DatastoreStorageSummary)
-> Generic DatastoreStorageSummary
forall x. Rep DatastoreStorageSummary x -> DatastoreStorageSummary
forall x. DatastoreStorageSummary -> Rep DatastoreStorageSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatastoreStorageSummary x -> DatastoreStorageSummary
$cfrom :: forall x. DatastoreStorageSummary -> Rep DatastoreStorageSummary x
Prelude.Generic)

-- |
-- Create a value of 'DatastoreStorageSummary' 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:
--
-- 'serviceManagedS3', 'datastoreStorageSummary_serviceManagedS3' - Used to store data in an Amazon S3 bucket managed by IoT Analytics.
--
-- 'customerManagedS3', 'datastoreStorageSummary_customerManagedS3' - Used to store data in an Amazon S3 bucket managed by IoT Analytics.
--
-- 'iotSiteWiseMultiLayerStorage', 'datastoreStorageSummary_iotSiteWiseMultiLayerStorage' - Used to store data used by IoT SiteWise in an Amazon S3 bucket that you
-- manage.
newDatastoreStorageSummary ::
  DatastoreStorageSummary
newDatastoreStorageSummary :: DatastoreStorageSummary
newDatastoreStorageSummary =
  DatastoreStorageSummary' :: Maybe ServiceManagedDatastoreS3StorageSummary
-> Maybe CustomerManagedDatastoreS3StorageSummary
-> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
-> DatastoreStorageSummary
DatastoreStorageSummary'
    { $sel:serviceManagedS3:DatastoreStorageSummary' :: Maybe ServiceManagedDatastoreS3StorageSummary
serviceManagedS3 =
        Maybe ServiceManagedDatastoreS3StorageSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:customerManagedS3:DatastoreStorageSummary' :: Maybe CustomerManagedDatastoreS3StorageSummary
customerManagedS3 = Maybe CustomerManagedDatastoreS3StorageSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:iotSiteWiseMultiLayerStorage:DatastoreStorageSummary' :: Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
iotSiteWiseMultiLayerStorage = Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
forall a. Maybe a
Prelude.Nothing
    }

-- | Used to store data in an Amazon S3 bucket managed by IoT Analytics.
datastoreStorageSummary_serviceManagedS3 :: Lens.Lens' DatastoreStorageSummary (Prelude.Maybe ServiceManagedDatastoreS3StorageSummary)
datastoreStorageSummary_serviceManagedS3 :: (Maybe ServiceManagedDatastoreS3StorageSummary
 -> f (Maybe ServiceManagedDatastoreS3StorageSummary))
-> DatastoreStorageSummary -> f DatastoreStorageSummary
datastoreStorageSummary_serviceManagedS3 = (DatastoreStorageSummary
 -> Maybe ServiceManagedDatastoreS3StorageSummary)
-> (DatastoreStorageSummary
    -> Maybe ServiceManagedDatastoreS3StorageSummary
    -> DatastoreStorageSummary)
-> Lens
     DatastoreStorageSummary
     DatastoreStorageSummary
     (Maybe ServiceManagedDatastoreS3StorageSummary)
     (Maybe ServiceManagedDatastoreS3StorageSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatastoreStorageSummary' {Maybe ServiceManagedDatastoreS3StorageSummary
serviceManagedS3 :: Maybe ServiceManagedDatastoreS3StorageSummary
$sel:serviceManagedS3:DatastoreStorageSummary' :: DatastoreStorageSummary
-> Maybe ServiceManagedDatastoreS3StorageSummary
serviceManagedS3} -> Maybe ServiceManagedDatastoreS3StorageSummary
serviceManagedS3) (\s :: DatastoreStorageSummary
s@DatastoreStorageSummary' {} Maybe ServiceManagedDatastoreS3StorageSummary
a -> DatastoreStorageSummary
s {$sel:serviceManagedS3:DatastoreStorageSummary' :: Maybe ServiceManagedDatastoreS3StorageSummary
serviceManagedS3 = Maybe ServiceManagedDatastoreS3StorageSummary
a} :: DatastoreStorageSummary)

-- | Used to store data in an Amazon S3 bucket managed by IoT Analytics.
datastoreStorageSummary_customerManagedS3 :: Lens.Lens' DatastoreStorageSummary (Prelude.Maybe CustomerManagedDatastoreS3StorageSummary)
datastoreStorageSummary_customerManagedS3 :: (Maybe CustomerManagedDatastoreS3StorageSummary
 -> f (Maybe CustomerManagedDatastoreS3StorageSummary))
-> DatastoreStorageSummary -> f DatastoreStorageSummary
datastoreStorageSummary_customerManagedS3 = (DatastoreStorageSummary
 -> Maybe CustomerManagedDatastoreS3StorageSummary)
-> (DatastoreStorageSummary
    -> Maybe CustomerManagedDatastoreS3StorageSummary
    -> DatastoreStorageSummary)
-> Lens
     DatastoreStorageSummary
     DatastoreStorageSummary
     (Maybe CustomerManagedDatastoreS3StorageSummary)
     (Maybe CustomerManagedDatastoreS3StorageSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatastoreStorageSummary' {Maybe CustomerManagedDatastoreS3StorageSummary
customerManagedS3 :: Maybe CustomerManagedDatastoreS3StorageSummary
$sel:customerManagedS3:DatastoreStorageSummary' :: DatastoreStorageSummary
-> Maybe CustomerManagedDatastoreS3StorageSummary
customerManagedS3} -> Maybe CustomerManagedDatastoreS3StorageSummary
customerManagedS3) (\s :: DatastoreStorageSummary
s@DatastoreStorageSummary' {} Maybe CustomerManagedDatastoreS3StorageSummary
a -> DatastoreStorageSummary
s {$sel:customerManagedS3:DatastoreStorageSummary' :: Maybe CustomerManagedDatastoreS3StorageSummary
customerManagedS3 = Maybe CustomerManagedDatastoreS3StorageSummary
a} :: DatastoreStorageSummary)

-- | Used to store data used by IoT SiteWise in an Amazon S3 bucket that you
-- manage.
datastoreStorageSummary_iotSiteWiseMultiLayerStorage :: Lens.Lens' DatastoreStorageSummary (Prelude.Maybe DatastoreIotSiteWiseMultiLayerStorageSummary)
datastoreStorageSummary_iotSiteWiseMultiLayerStorage :: (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
 -> f (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary))
-> DatastoreStorageSummary -> f DatastoreStorageSummary
datastoreStorageSummary_iotSiteWiseMultiLayerStorage = (DatastoreStorageSummary
 -> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary)
-> (DatastoreStorageSummary
    -> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
    -> DatastoreStorageSummary)
-> Lens
     DatastoreStorageSummary
     DatastoreStorageSummary
     (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary)
     (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatastoreStorageSummary' {Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
iotSiteWiseMultiLayerStorage :: Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
$sel:iotSiteWiseMultiLayerStorage:DatastoreStorageSummary' :: DatastoreStorageSummary
-> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
iotSiteWiseMultiLayerStorage} -> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
iotSiteWiseMultiLayerStorage) (\s :: DatastoreStorageSummary
s@DatastoreStorageSummary' {} Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
a -> DatastoreStorageSummary
s {$sel:iotSiteWiseMultiLayerStorage:DatastoreStorageSummary' :: Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
iotSiteWiseMultiLayerStorage = Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
a} :: DatastoreStorageSummary)

instance Core.FromJSON DatastoreStorageSummary where
  parseJSON :: Value -> Parser DatastoreStorageSummary
parseJSON =
    String
-> (Object -> Parser DatastoreStorageSummary)
-> Value
-> Parser DatastoreStorageSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatastoreStorageSummary"
      ( \Object
x ->
          Maybe ServiceManagedDatastoreS3StorageSummary
-> Maybe CustomerManagedDatastoreS3StorageSummary
-> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
-> DatastoreStorageSummary
DatastoreStorageSummary'
            (Maybe ServiceManagedDatastoreS3StorageSummary
 -> Maybe CustomerManagedDatastoreS3StorageSummary
 -> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
 -> DatastoreStorageSummary)
-> Parser (Maybe ServiceManagedDatastoreS3StorageSummary)
-> Parser
     (Maybe CustomerManagedDatastoreS3StorageSummary
      -> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
      -> DatastoreStorageSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe ServiceManagedDatastoreS3StorageSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceManagedS3")
            Parser
  (Maybe CustomerManagedDatastoreS3StorageSummary
   -> Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
   -> DatastoreStorageSummary)
-> Parser (Maybe CustomerManagedDatastoreS3StorageSummary)
-> Parser
     (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
      -> DatastoreStorageSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe CustomerManagedDatastoreS3StorageSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"customerManagedS3")
            Parser
  (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary
   -> DatastoreStorageSummary)
-> Parser (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary)
-> Parser DatastoreStorageSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe DatastoreIotSiteWiseMultiLayerStorageSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iotSiteWiseMultiLayerStorage")
      )

instance Prelude.Hashable DatastoreStorageSummary

instance Prelude.NFData DatastoreStorageSummary