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

import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.IotSiteWiseCustomerManagedDatastoreS3Storage
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Used to store data used by IoT SiteWise in an Amazon S3 bucket that you
-- manage. You can\'t change the choice of Amazon S3 storage after your
-- data store is created.
--
-- /See:/ 'newDatastoreIotSiteWiseMultiLayerStorage' smart constructor.
data DatastoreIotSiteWiseMultiLayerStorage = DatastoreIotSiteWiseMultiLayerStorage'
  { -- | Used to store data used by IoT SiteWise in an Amazon S3 bucket that you
    -- manage.
    DatastoreIotSiteWiseMultiLayerStorage
-> IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage :: IotSiteWiseCustomerManagedDatastoreS3Storage
  }
  deriving (DatastoreIotSiteWiseMultiLayerStorage
-> DatastoreIotSiteWiseMultiLayerStorage -> Bool
(DatastoreIotSiteWiseMultiLayerStorage
 -> DatastoreIotSiteWiseMultiLayerStorage -> Bool)
-> (DatastoreIotSiteWiseMultiLayerStorage
    -> DatastoreIotSiteWiseMultiLayerStorage -> Bool)
-> Eq DatastoreIotSiteWiseMultiLayerStorage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatastoreIotSiteWiseMultiLayerStorage
-> DatastoreIotSiteWiseMultiLayerStorage -> Bool
$c/= :: DatastoreIotSiteWiseMultiLayerStorage
-> DatastoreIotSiteWiseMultiLayerStorage -> Bool
== :: DatastoreIotSiteWiseMultiLayerStorage
-> DatastoreIotSiteWiseMultiLayerStorage -> Bool
$c== :: DatastoreIotSiteWiseMultiLayerStorage
-> DatastoreIotSiteWiseMultiLayerStorage -> Bool
Prelude.Eq, ReadPrec [DatastoreIotSiteWiseMultiLayerStorage]
ReadPrec DatastoreIotSiteWiseMultiLayerStorage
Int -> ReadS DatastoreIotSiteWiseMultiLayerStorage
ReadS [DatastoreIotSiteWiseMultiLayerStorage]
(Int -> ReadS DatastoreIotSiteWiseMultiLayerStorage)
-> ReadS [DatastoreIotSiteWiseMultiLayerStorage]
-> ReadPrec DatastoreIotSiteWiseMultiLayerStorage
-> ReadPrec [DatastoreIotSiteWiseMultiLayerStorage]
-> Read DatastoreIotSiteWiseMultiLayerStorage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatastoreIotSiteWiseMultiLayerStorage]
$creadListPrec :: ReadPrec [DatastoreIotSiteWiseMultiLayerStorage]
readPrec :: ReadPrec DatastoreIotSiteWiseMultiLayerStorage
$creadPrec :: ReadPrec DatastoreIotSiteWiseMultiLayerStorage
readList :: ReadS [DatastoreIotSiteWiseMultiLayerStorage]
$creadList :: ReadS [DatastoreIotSiteWiseMultiLayerStorage]
readsPrec :: Int -> ReadS DatastoreIotSiteWiseMultiLayerStorage
$creadsPrec :: Int -> ReadS DatastoreIotSiteWiseMultiLayerStorage
Prelude.Read, Int -> DatastoreIotSiteWiseMultiLayerStorage -> ShowS
[DatastoreIotSiteWiseMultiLayerStorage] -> ShowS
DatastoreIotSiteWiseMultiLayerStorage -> String
(Int -> DatastoreIotSiteWiseMultiLayerStorage -> ShowS)
-> (DatastoreIotSiteWiseMultiLayerStorage -> String)
-> ([DatastoreIotSiteWiseMultiLayerStorage] -> ShowS)
-> Show DatastoreIotSiteWiseMultiLayerStorage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatastoreIotSiteWiseMultiLayerStorage] -> ShowS
$cshowList :: [DatastoreIotSiteWiseMultiLayerStorage] -> ShowS
show :: DatastoreIotSiteWiseMultiLayerStorage -> String
$cshow :: DatastoreIotSiteWiseMultiLayerStorage -> String
showsPrec :: Int -> DatastoreIotSiteWiseMultiLayerStorage -> ShowS
$cshowsPrec :: Int -> DatastoreIotSiteWiseMultiLayerStorage -> ShowS
Prelude.Show, (forall x.
 DatastoreIotSiteWiseMultiLayerStorage
 -> Rep DatastoreIotSiteWiseMultiLayerStorage x)
-> (forall x.
    Rep DatastoreIotSiteWiseMultiLayerStorage x
    -> DatastoreIotSiteWiseMultiLayerStorage)
-> Generic DatastoreIotSiteWiseMultiLayerStorage
forall x.
Rep DatastoreIotSiteWiseMultiLayerStorage x
-> DatastoreIotSiteWiseMultiLayerStorage
forall x.
DatastoreIotSiteWiseMultiLayerStorage
-> Rep DatastoreIotSiteWiseMultiLayerStorage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DatastoreIotSiteWiseMultiLayerStorage x
-> DatastoreIotSiteWiseMultiLayerStorage
$cfrom :: forall x.
DatastoreIotSiteWiseMultiLayerStorage
-> Rep DatastoreIotSiteWiseMultiLayerStorage x
Prelude.Generic)

-- |
-- Create a value of 'DatastoreIotSiteWiseMultiLayerStorage' 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:
--
-- 'customerManagedS3Storage', 'datastoreIotSiteWiseMultiLayerStorage_customerManagedS3Storage' - Used to store data used by IoT SiteWise in an Amazon S3 bucket that you
-- manage.
newDatastoreIotSiteWiseMultiLayerStorage ::
  -- | 'customerManagedS3Storage'
  IotSiteWiseCustomerManagedDatastoreS3Storage ->
  DatastoreIotSiteWiseMultiLayerStorage
newDatastoreIotSiteWiseMultiLayerStorage :: IotSiteWiseCustomerManagedDatastoreS3Storage
-> DatastoreIotSiteWiseMultiLayerStorage
newDatastoreIotSiteWiseMultiLayerStorage
  IotSiteWiseCustomerManagedDatastoreS3Storage
pCustomerManagedS3Storage_ =
    DatastoreIotSiteWiseMultiLayerStorage' :: IotSiteWiseCustomerManagedDatastoreS3Storage
-> DatastoreIotSiteWiseMultiLayerStorage
DatastoreIotSiteWiseMultiLayerStorage'
      { $sel:customerManagedS3Storage:DatastoreIotSiteWiseMultiLayerStorage' :: IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage =
          IotSiteWiseCustomerManagedDatastoreS3Storage
pCustomerManagedS3Storage_
      }

-- | Used to store data used by IoT SiteWise in an Amazon S3 bucket that you
-- manage.
datastoreIotSiteWiseMultiLayerStorage_customerManagedS3Storage :: Lens.Lens' DatastoreIotSiteWiseMultiLayerStorage IotSiteWiseCustomerManagedDatastoreS3Storage
datastoreIotSiteWiseMultiLayerStorage_customerManagedS3Storage :: (IotSiteWiseCustomerManagedDatastoreS3Storage
 -> f IotSiteWiseCustomerManagedDatastoreS3Storage)
-> DatastoreIotSiteWiseMultiLayerStorage
-> f DatastoreIotSiteWiseMultiLayerStorage
datastoreIotSiteWiseMultiLayerStorage_customerManagedS3Storage = (DatastoreIotSiteWiseMultiLayerStorage
 -> IotSiteWiseCustomerManagedDatastoreS3Storage)
-> (DatastoreIotSiteWiseMultiLayerStorage
    -> IotSiteWiseCustomerManagedDatastoreS3Storage
    -> DatastoreIotSiteWiseMultiLayerStorage)
-> Lens
     DatastoreIotSiteWiseMultiLayerStorage
     DatastoreIotSiteWiseMultiLayerStorage
     IotSiteWiseCustomerManagedDatastoreS3Storage
     IotSiteWiseCustomerManagedDatastoreS3Storage
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatastoreIotSiteWiseMultiLayerStorage' {IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage :: IotSiteWiseCustomerManagedDatastoreS3Storage
$sel:customerManagedS3Storage:DatastoreIotSiteWiseMultiLayerStorage' :: DatastoreIotSiteWiseMultiLayerStorage
-> IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage} -> IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage) (\s :: DatastoreIotSiteWiseMultiLayerStorage
s@DatastoreIotSiteWiseMultiLayerStorage' {} IotSiteWiseCustomerManagedDatastoreS3Storage
a -> DatastoreIotSiteWiseMultiLayerStorage
s {$sel:customerManagedS3Storage:DatastoreIotSiteWiseMultiLayerStorage' :: IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage = IotSiteWiseCustomerManagedDatastoreS3Storage
a} :: DatastoreIotSiteWiseMultiLayerStorage)

instance
  Core.FromJSON
    DatastoreIotSiteWiseMultiLayerStorage
  where
  parseJSON :: Value -> Parser DatastoreIotSiteWiseMultiLayerStorage
parseJSON =
    String
-> (Object -> Parser DatastoreIotSiteWiseMultiLayerStorage)
-> Value
-> Parser DatastoreIotSiteWiseMultiLayerStorage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatastoreIotSiteWiseMultiLayerStorage"
      ( \Object
x ->
          IotSiteWiseCustomerManagedDatastoreS3Storage
-> DatastoreIotSiteWiseMultiLayerStorage
DatastoreIotSiteWiseMultiLayerStorage'
            (IotSiteWiseCustomerManagedDatastoreS3Storage
 -> DatastoreIotSiteWiseMultiLayerStorage)
-> Parser IotSiteWiseCustomerManagedDatastoreS3Storage
-> Parser DatastoreIotSiteWiseMultiLayerStorage
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser IotSiteWiseCustomerManagedDatastoreS3Storage
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"customerManagedS3Storage")
      )

instance
  Prelude.Hashable
    DatastoreIotSiteWiseMultiLayerStorage

instance
  Prelude.NFData
    DatastoreIotSiteWiseMultiLayerStorage

instance
  Core.ToJSON
    DatastoreIotSiteWiseMultiLayerStorage
  where
  toJSON :: DatastoreIotSiteWiseMultiLayerStorage -> Value
toJSON DatastoreIotSiteWiseMultiLayerStorage' {IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage :: IotSiteWiseCustomerManagedDatastoreS3Storage
$sel:customerManagedS3Storage:DatastoreIotSiteWiseMultiLayerStorage' :: DatastoreIotSiteWiseMultiLayerStorage
-> IotSiteWiseCustomerManagedDatastoreS3Storage
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"customerManagedS3Storage"
                  Text -> IotSiteWiseCustomerManagedDatastoreS3Storage -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= IotSiteWiseCustomerManagedDatastoreS3Storage
customerManagedS3Storage
              )
          ]
      )