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

import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.DatastorePartitions
import Amazonka.IoTAnalytics.Types.DatastoreStatus
import Amazonka.IoTAnalytics.Types.DatastoreStorage
import Amazonka.IoTAnalytics.Types.FileFormatConfiguration
import Amazonka.IoTAnalytics.Types.RetentionPeriod
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a data store.
--
-- /See:/ 'newDatastore' smart constructor.
data Datastore = Datastore'
  { -- | When the data store was created.
    Datastore -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of a data store:
    --
    -- [CREATING]
    --     The data store is being created.
    --
    -- [ACTIVE]
    --     The data store has been created and can be used.
    --
    -- [DELETING]
    --     The data store is being deleted.
    Datastore -> Maybe DatastoreStatus
status :: Prelude.Maybe DatastoreStatus,
    -- | The last time when a new message arrived in the data store.
    --
    -- IoT Analytics updates this value at most once per minute for Amazon
    -- Simple Storage Service one data store. Hence, the
    -- @lastMessageArrivalTime@ value is an approximation.
    --
    -- This feature only applies to messages that arrived in the data store
    -- after October 23, 2020.
    Datastore -> Maybe POSIX
lastMessageArrivalTime :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the data store.
    Datastore -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Contains the configuration information of file formats. IoT Analytics
    -- data stores support JSON and <https://parquet.apache.org/ Parquet>.
    --
    -- The default file format is JSON. You can specify only one format.
    --
    -- You can\'t change the file format after you create the data store.
    Datastore -> Maybe FileFormatConfiguration
fileFormatConfiguration :: Prelude.Maybe FileFormatConfiguration,
    -- | Contains information about the partition dimensions in a data store.
    Datastore -> Maybe DatastorePartitions
datastorePartitions :: Prelude.Maybe DatastorePartitions,
    -- | Where data in a data store is stored.. You can choose @serviceManagedS3@
    -- storage, @customerManagedS3@ storage, or @iotSiteWiseMultiLayerStorage@
    -- storage. The default is @serviceManagedS3@. You can\'t change the choice
    -- of Amazon S3 storage after your data store is created.
    Datastore -> Maybe DatastoreStorage
storage :: Prelude.Maybe DatastoreStorage,
    -- | How long, in days, message data is kept for the data store. When
    -- @customerManagedS3@ storage is selected, this parameter is ignored.
    Datastore -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
    -- | The name of the data store.
    Datastore -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The last time the data store was updated.
    Datastore -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX
  }
  deriving (Datastore -> Datastore -> Bool
(Datastore -> Datastore -> Bool)
-> (Datastore -> Datastore -> Bool) -> Eq Datastore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Datastore -> Datastore -> Bool
$c/= :: Datastore -> Datastore -> Bool
== :: Datastore -> Datastore -> Bool
$c== :: Datastore -> Datastore -> Bool
Prelude.Eq, ReadPrec [Datastore]
ReadPrec Datastore
Int -> ReadS Datastore
ReadS [Datastore]
(Int -> ReadS Datastore)
-> ReadS [Datastore]
-> ReadPrec Datastore
-> ReadPrec [Datastore]
-> Read Datastore
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Datastore]
$creadListPrec :: ReadPrec [Datastore]
readPrec :: ReadPrec Datastore
$creadPrec :: ReadPrec Datastore
readList :: ReadS [Datastore]
$creadList :: ReadS [Datastore]
readsPrec :: Int -> ReadS Datastore
$creadsPrec :: Int -> ReadS Datastore
Prelude.Read, Int -> Datastore -> ShowS
[Datastore] -> ShowS
Datastore -> String
(Int -> Datastore -> ShowS)
-> (Datastore -> String)
-> ([Datastore] -> ShowS)
-> Show Datastore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Datastore] -> ShowS
$cshowList :: [Datastore] -> ShowS
show :: Datastore -> String
$cshow :: Datastore -> String
showsPrec :: Int -> Datastore -> ShowS
$cshowsPrec :: Int -> Datastore -> ShowS
Prelude.Show, (forall x. Datastore -> Rep Datastore x)
-> (forall x. Rep Datastore x -> Datastore) -> Generic Datastore
forall x. Rep Datastore x -> Datastore
forall x. Datastore -> Rep Datastore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Datastore x -> Datastore
$cfrom :: forall x. Datastore -> Rep Datastore x
Prelude.Generic)

-- |
-- Create a value of 'Datastore' 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:
--
-- 'creationTime', 'datastore_creationTime' - When the data store was created.
--
-- 'status', 'datastore_status' - The status of a data store:
--
-- [CREATING]
--     The data store is being created.
--
-- [ACTIVE]
--     The data store has been created and can be used.
--
-- [DELETING]
--     The data store is being deleted.
--
-- 'lastMessageArrivalTime', 'datastore_lastMessageArrivalTime' - The last time when a new message arrived in the data store.
--
-- IoT Analytics updates this value at most once per minute for Amazon
-- Simple Storage Service one data store. Hence, the
-- @lastMessageArrivalTime@ value is an approximation.
--
-- This feature only applies to messages that arrived in the data store
-- after October 23, 2020.
--
-- 'arn', 'datastore_arn' - The ARN of the data store.
--
-- 'fileFormatConfiguration', 'datastore_fileFormatConfiguration' - Contains the configuration information of file formats. IoT Analytics
-- data stores support JSON and <https://parquet.apache.org/ Parquet>.
--
-- The default file format is JSON. You can specify only one format.
--
-- You can\'t change the file format after you create the data store.
--
-- 'datastorePartitions', 'datastore_datastorePartitions' - Contains information about the partition dimensions in a data store.
--
-- 'storage', 'datastore_storage' - Where data in a data store is stored.. You can choose @serviceManagedS3@
-- storage, @customerManagedS3@ storage, or @iotSiteWiseMultiLayerStorage@
-- storage. The default is @serviceManagedS3@. You can\'t change the choice
-- of Amazon S3 storage after your data store is created.
--
-- 'retentionPeriod', 'datastore_retentionPeriod' - How long, in days, message data is kept for the data store. When
-- @customerManagedS3@ storage is selected, this parameter is ignored.
--
-- 'name', 'datastore_name' - The name of the data store.
--
-- 'lastUpdateTime', 'datastore_lastUpdateTime' - The last time the data store was updated.
newDatastore ::
  Datastore
newDatastore :: Datastore
newDatastore =
  Datastore' :: Maybe POSIX
-> Maybe DatastoreStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe FileFormatConfiguration
-> Maybe DatastorePartitions
-> Maybe DatastoreStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Datastore
Datastore'
    { $sel:creationTime:Datastore' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:Datastore' :: Maybe DatastoreStatus
status = Maybe DatastoreStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastMessageArrivalTime:Datastore' :: Maybe POSIX
lastMessageArrivalTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Datastore' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fileFormatConfiguration:Datastore' :: Maybe FileFormatConfiguration
fileFormatConfiguration = Maybe FileFormatConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:datastorePartitions:Datastore' :: Maybe DatastorePartitions
datastorePartitions = Maybe DatastorePartitions
forall a. Maybe a
Prelude.Nothing,
      $sel:storage:Datastore' :: Maybe DatastoreStorage
storage = Maybe DatastoreStorage
forall a. Maybe a
Prelude.Nothing,
      $sel:retentionPeriod:Datastore' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Datastore' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:Datastore' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | When the data store was created.
datastore_creationTime :: Lens.Lens' Datastore (Prelude.Maybe Prelude.UTCTime)
datastore_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Datastore -> f Datastore
datastore_creationTime = (Datastore -> Maybe POSIX)
-> (Datastore -> Maybe POSIX -> Datastore)
-> Lens Datastore Datastore (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Datastore' :: Datastore -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Datastore
s@Datastore' {} Maybe POSIX
a -> Datastore
s {$sel:creationTime:Datastore' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Datastore) ((Maybe POSIX -> f (Maybe POSIX)) -> Datastore -> f Datastore)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Datastore
-> f Datastore
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of a data store:
--
-- [CREATING]
--     The data store is being created.
--
-- [ACTIVE]
--     The data store has been created and can be used.
--
-- [DELETING]
--     The data store is being deleted.
datastore_status :: Lens.Lens' Datastore (Prelude.Maybe DatastoreStatus)
datastore_status :: (Maybe DatastoreStatus -> f (Maybe DatastoreStatus))
-> Datastore -> f Datastore
datastore_status = (Datastore -> Maybe DatastoreStatus)
-> (Datastore -> Maybe DatastoreStatus -> Datastore)
-> Lens
     Datastore Datastore (Maybe DatastoreStatus) (Maybe DatastoreStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe DatastoreStatus
status :: Maybe DatastoreStatus
$sel:status:Datastore' :: Datastore -> Maybe DatastoreStatus
status} -> Maybe DatastoreStatus
status) (\s :: Datastore
s@Datastore' {} Maybe DatastoreStatus
a -> Datastore
s {$sel:status:Datastore' :: Maybe DatastoreStatus
status = Maybe DatastoreStatus
a} :: Datastore)

-- | The last time when a new message arrived in the data store.
--
-- IoT Analytics updates this value at most once per minute for Amazon
-- Simple Storage Service one data store. Hence, the
-- @lastMessageArrivalTime@ value is an approximation.
--
-- This feature only applies to messages that arrived in the data store
-- after October 23, 2020.
datastore_lastMessageArrivalTime :: Lens.Lens' Datastore (Prelude.Maybe Prelude.UTCTime)
datastore_lastMessageArrivalTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Datastore -> f Datastore
datastore_lastMessageArrivalTime = (Datastore -> Maybe POSIX)
-> (Datastore -> Maybe POSIX -> Datastore)
-> Lens Datastore Datastore (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe POSIX
lastMessageArrivalTime :: Maybe POSIX
$sel:lastMessageArrivalTime:Datastore' :: Datastore -> Maybe POSIX
lastMessageArrivalTime} -> Maybe POSIX
lastMessageArrivalTime) (\s :: Datastore
s@Datastore' {} Maybe POSIX
a -> Datastore
s {$sel:lastMessageArrivalTime:Datastore' :: Maybe POSIX
lastMessageArrivalTime = Maybe POSIX
a} :: Datastore) ((Maybe POSIX -> f (Maybe POSIX)) -> Datastore -> f Datastore)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Datastore
-> f Datastore
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ARN of the data store.
datastore_arn :: Lens.Lens' Datastore (Prelude.Maybe Prelude.Text)
datastore_arn :: (Maybe Text -> f (Maybe Text)) -> Datastore -> f Datastore
datastore_arn = (Datastore -> Maybe Text)
-> (Datastore -> Maybe Text -> Datastore)
-> Lens Datastore Datastore (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe Text
arn :: Maybe Text
$sel:arn:Datastore' :: Datastore -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Datastore
s@Datastore' {} Maybe Text
a -> Datastore
s {$sel:arn:Datastore' :: Maybe Text
arn = Maybe Text
a} :: Datastore)

-- | Contains the configuration information of file formats. IoT Analytics
-- data stores support JSON and <https://parquet.apache.org/ Parquet>.
--
-- The default file format is JSON. You can specify only one format.
--
-- You can\'t change the file format after you create the data store.
datastore_fileFormatConfiguration :: Lens.Lens' Datastore (Prelude.Maybe FileFormatConfiguration)
datastore_fileFormatConfiguration :: (Maybe FileFormatConfiguration
 -> f (Maybe FileFormatConfiguration))
-> Datastore -> f Datastore
datastore_fileFormatConfiguration = (Datastore -> Maybe FileFormatConfiguration)
-> (Datastore -> Maybe FileFormatConfiguration -> Datastore)
-> Lens
     Datastore
     Datastore
     (Maybe FileFormatConfiguration)
     (Maybe FileFormatConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe FileFormatConfiguration
fileFormatConfiguration :: Maybe FileFormatConfiguration
$sel:fileFormatConfiguration:Datastore' :: Datastore -> Maybe FileFormatConfiguration
fileFormatConfiguration} -> Maybe FileFormatConfiguration
fileFormatConfiguration) (\s :: Datastore
s@Datastore' {} Maybe FileFormatConfiguration
a -> Datastore
s {$sel:fileFormatConfiguration:Datastore' :: Maybe FileFormatConfiguration
fileFormatConfiguration = Maybe FileFormatConfiguration
a} :: Datastore)

-- | Contains information about the partition dimensions in a data store.
datastore_datastorePartitions :: Lens.Lens' Datastore (Prelude.Maybe DatastorePartitions)
datastore_datastorePartitions :: (Maybe DatastorePartitions -> f (Maybe DatastorePartitions))
-> Datastore -> f Datastore
datastore_datastorePartitions = (Datastore -> Maybe DatastorePartitions)
-> (Datastore -> Maybe DatastorePartitions -> Datastore)
-> Lens
     Datastore
     Datastore
     (Maybe DatastorePartitions)
     (Maybe DatastorePartitions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe DatastorePartitions
datastorePartitions :: Maybe DatastorePartitions
$sel:datastorePartitions:Datastore' :: Datastore -> Maybe DatastorePartitions
datastorePartitions} -> Maybe DatastorePartitions
datastorePartitions) (\s :: Datastore
s@Datastore' {} Maybe DatastorePartitions
a -> Datastore
s {$sel:datastorePartitions:Datastore' :: Maybe DatastorePartitions
datastorePartitions = Maybe DatastorePartitions
a} :: Datastore)

-- | Where data in a data store is stored.. You can choose @serviceManagedS3@
-- storage, @customerManagedS3@ storage, or @iotSiteWiseMultiLayerStorage@
-- storage. The default is @serviceManagedS3@. You can\'t change the choice
-- of Amazon S3 storage after your data store is created.
datastore_storage :: Lens.Lens' Datastore (Prelude.Maybe DatastoreStorage)
datastore_storage :: (Maybe DatastoreStorage -> f (Maybe DatastoreStorage))
-> Datastore -> f Datastore
datastore_storage = (Datastore -> Maybe DatastoreStorage)
-> (Datastore -> Maybe DatastoreStorage -> Datastore)
-> Lens
     Datastore
     Datastore
     (Maybe DatastoreStorage)
     (Maybe DatastoreStorage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe DatastoreStorage
storage :: Maybe DatastoreStorage
$sel:storage:Datastore' :: Datastore -> Maybe DatastoreStorage
storage} -> Maybe DatastoreStorage
storage) (\s :: Datastore
s@Datastore' {} Maybe DatastoreStorage
a -> Datastore
s {$sel:storage:Datastore' :: Maybe DatastoreStorage
storage = Maybe DatastoreStorage
a} :: Datastore)

-- | How long, in days, message data is kept for the data store. When
-- @customerManagedS3@ storage is selected, this parameter is ignored.
datastore_retentionPeriod :: Lens.Lens' Datastore (Prelude.Maybe RetentionPeriod)
datastore_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> Datastore -> f Datastore
datastore_retentionPeriod = (Datastore -> Maybe RetentionPeriod)
-> (Datastore -> Maybe RetentionPeriod -> Datastore)
-> Lens
     Datastore Datastore (Maybe RetentionPeriod) (Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:Datastore' :: Datastore -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: Datastore
s@Datastore' {} Maybe RetentionPeriod
a -> Datastore
s {$sel:retentionPeriod:Datastore' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: Datastore)

-- | The name of the data store.
datastore_name :: Lens.Lens' Datastore (Prelude.Maybe Prelude.Text)
datastore_name :: (Maybe Text -> f (Maybe Text)) -> Datastore -> f Datastore
datastore_name = (Datastore -> Maybe Text)
-> (Datastore -> Maybe Text -> Datastore)
-> Lens Datastore Datastore (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe Text
name :: Maybe Text
$sel:name:Datastore' :: Datastore -> Maybe Text
name} -> Maybe Text
name) (\s :: Datastore
s@Datastore' {} Maybe Text
a -> Datastore
s {$sel:name:Datastore' :: Maybe Text
name = Maybe Text
a} :: Datastore)

-- | The last time the data store was updated.
datastore_lastUpdateTime :: Lens.Lens' Datastore (Prelude.Maybe Prelude.UTCTime)
datastore_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Datastore -> f Datastore
datastore_lastUpdateTime = (Datastore -> Maybe POSIX)
-> (Datastore -> Maybe POSIX -> Datastore)
-> Lens Datastore Datastore (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Datastore' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:Datastore' :: Datastore -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: Datastore
s@Datastore' {} Maybe POSIX
a -> Datastore
s {$sel:lastUpdateTime:Datastore' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: Datastore) ((Maybe POSIX -> f (Maybe POSIX)) -> Datastore -> f Datastore)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Datastore
-> f Datastore
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON Datastore where
  parseJSON :: Value -> Parser Datastore
parseJSON =
    String -> (Object -> Parser Datastore) -> Value -> Parser Datastore
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Datastore"
      ( \Object
x ->
          Maybe POSIX
-> Maybe DatastoreStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe FileFormatConfiguration
-> Maybe DatastorePartitions
-> Maybe DatastoreStorage
-> Maybe RetentionPeriod
-> Maybe Text
-> Maybe POSIX
-> Datastore
Datastore'
            (Maybe POSIX
 -> Maybe DatastoreStatus
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe FileFormatConfiguration
 -> Maybe DatastorePartitions
 -> Maybe DatastoreStorage
 -> Maybe RetentionPeriod
 -> Maybe Text
 -> Maybe POSIX
 -> Datastore)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe DatastoreStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe FileFormatConfiguration
      -> Maybe DatastorePartitions
      -> Maybe DatastoreStorage
      -> Maybe RetentionPeriod
      -> Maybe Text
      -> Maybe POSIX
      -> Datastore)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser
  (Maybe DatastoreStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe FileFormatConfiguration
   -> Maybe DatastorePartitions
   -> Maybe DatastoreStorage
   -> Maybe RetentionPeriod
   -> Maybe Text
   -> Maybe POSIX
   -> Datastore)
-> Parser (Maybe DatastoreStatus)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe FileFormatConfiguration
      -> Maybe DatastorePartitions
      -> Maybe DatastoreStorage
      -> Maybe RetentionPeriod
      -> Maybe Text
      -> Maybe POSIX
      -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DatastoreStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe FileFormatConfiguration
   -> Maybe DatastorePartitions
   -> Maybe DatastoreStorage
   -> Maybe RetentionPeriod
   -> Maybe Text
   -> Maybe POSIX
   -> Datastore)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe FileFormatConfiguration
      -> Maybe DatastorePartitions
      -> Maybe DatastoreStorage
      -> Maybe RetentionPeriod
      -> Maybe Text
      -> Maybe POSIX
      -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastMessageArrivalTime")
            Parser
  (Maybe Text
   -> Maybe FileFormatConfiguration
   -> Maybe DatastorePartitions
   -> Maybe DatastoreStorage
   -> Maybe RetentionPeriod
   -> Maybe Text
   -> Maybe POSIX
   -> Datastore)
-> Parser (Maybe Text)
-> Parser
     (Maybe FileFormatConfiguration
      -> Maybe DatastorePartitions
      -> Maybe DatastoreStorage
      -> Maybe RetentionPeriod
      -> Maybe Text
      -> Maybe POSIX
      -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser
  (Maybe FileFormatConfiguration
   -> Maybe DatastorePartitions
   -> Maybe DatastoreStorage
   -> Maybe RetentionPeriod
   -> Maybe Text
   -> Maybe POSIX
   -> Datastore)
-> Parser (Maybe FileFormatConfiguration)
-> Parser
     (Maybe DatastorePartitions
      -> Maybe DatastoreStorage
      -> Maybe RetentionPeriod
      -> Maybe Text
      -> Maybe POSIX
      -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FileFormatConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fileFormatConfiguration")
            Parser
  (Maybe DatastorePartitions
   -> Maybe DatastoreStorage
   -> Maybe RetentionPeriod
   -> Maybe Text
   -> Maybe POSIX
   -> Datastore)
-> Parser (Maybe DatastorePartitions)
-> Parser
     (Maybe DatastoreStorage
      -> Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DatastorePartitions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"datastorePartitions")
            Parser
  (Maybe DatastoreStorage
   -> Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Datastore)
-> Parser (Maybe DatastoreStorage)
-> Parser
     (Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DatastoreStorage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"storage")
            Parser
  (Maybe RetentionPeriod -> Maybe Text -> Maybe POSIX -> Datastore)
-> Parser (Maybe RetentionPeriod)
-> Parser (Maybe Text -> Maybe POSIX -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RetentionPeriod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"retentionPeriod")
            Parser (Maybe Text -> Maybe POSIX -> Datastore)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> Datastore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser (Maybe POSIX -> Datastore)
-> Parser (Maybe POSIX) -> Parser Datastore
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdateTime")
      )

instance Prelude.Hashable Datastore

instance Prelude.NFData Datastore