{-# 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.MemoryDb.Types.ShardDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.ShardConfiguration
import qualified Amazonka.Prelude as Prelude
data ShardDetail = ShardDetail'
{
ShardDetail -> Maybe Text
size :: Prelude.Maybe Prelude.Text,
ShardDetail -> Maybe POSIX
snapshotCreationTime :: Prelude.Maybe Core.POSIX,
ShardDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ShardDetail -> Maybe ShardConfiguration
configuration :: Prelude.Maybe ShardConfiguration
}
deriving (ShardDetail -> ShardDetail -> Bool
(ShardDetail -> ShardDetail -> Bool)
-> (ShardDetail -> ShardDetail -> Bool) -> Eq ShardDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShardDetail -> ShardDetail -> Bool
$c/= :: ShardDetail -> ShardDetail -> Bool
== :: ShardDetail -> ShardDetail -> Bool
$c== :: ShardDetail -> ShardDetail -> Bool
Prelude.Eq, ReadPrec [ShardDetail]
ReadPrec ShardDetail
Int -> ReadS ShardDetail
ReadS [ShardDetail]
(Int -> ReadS ShardDetail)
-> ReadS [ShardDetail]
-> ReadPrec ShardDetail
-> ReadPrec [ShardDetail]
-> Read ShardDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShardDetail]
$creadListPrec :: ReadPrec [ShardDetail]
readPrec :: ReadPrec ShardDetail
$creadPrec :: ReadPrec ShardDetail
readList :: ReadS [ShardDetail]
$creadList :: ReadS [ShardDetail]
readsPrec :: Int -> ReadS ShardDetail
$creadsPrec :: Int -> ReadS ShardDetail
Prelude.Read, Int -> ShardDetail -> ShowS
[ShardDetail] -> ShowS
ShardDetail -> String
(Int -> ShardDetail -> ShowS)
-> (ShardDetail -> String)
-> ([ShardDetail] -> ShowS)
-> Show ShardDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShardDetail] -> ShowS
$cshowList :: [ShardDetail] -> ShowS
show :: ShardDetail -> String
$cshow :: ShardDetail -> String
showsPrec :: Int -> ShardDetail -> ShowS
$cshowsPrec :: Int -> ShardDetail -> ShowS
Prelude.Show, (forall x. ShardDetail -> Rep ShardDetail x)
-> (forall x. Rep ShardDetail x -> ShardDetail)
-> Generic ShardDetail
forall x. Rep ShardDetail x -> ShardDetail
forall x. ShardDetail -> Rep ShardDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShardDetail x -> ShardDetail
$cfrom :: forall x. ShardDetail -> Rep ShardDetail x
Prelude.Generic)
newShardDetail ::
ShardDetail
newShardDetail :: ShardDetail
newShardDetail =
ShardDetail' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ShardConfiguration
-> ShardDetail
ShardDetail'
{ $sel:size:ShardDetail' :: Maybe Text
size = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotCreationTime:ShardDetail' :: Maybe POSIX
snapshotCreationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:ShardDetail' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:ShardDetail' :: Maybe ShardConfiguration
configuration = Maybe ShardConfiguration
forall a. Maybe a
Prelude.Nothing
}
shardDetail_size :: Lens.Lens' ShardDetail (Prelude.Maybe Prelude.Text)
shardDetail_size :: (Maybe Text -> f (Maybe Text)) -> ShardDetail -> f ShardDetail
shardDetail_size = (ShardDetail -> Maybe Text)
-> (ShardDetail -> Maybe Text -> ShardDetail)
-> Lens ShardDetail ShardDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShardDetail' {Maybe Text
size :: Maybe Text
$sel:size:ShardDetail' :: ShardDetail -> Maybe Text
size} -> Maybe Text
size) (\s :: ShardDetail
s@ShardDetail' {} Maybe Text
a -> ShardDetail
s {$sel:size:ShardDetail' :: Maybe Text
size = Maybe Text
a} :: ShardDetail)
shardDetail_snapshotCreationTime :: Lens.Lens' ShardDetail (Prelude.Maybe Prelude.UTCTime)
shardDetail_snapshotCreationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ShardDetail -> f ShardDetail
shardDetail_snapshotCreationTime = (ShardDetail -> Maybe POSIX)
-> (ShardDetail -> Maybe POSIX -> ShardDetail)
-> Lens ShardDetail ShardDetail (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShardDetail' {Maybe POSIX
snapshotCreationTime :: Maybe POSIX
$sel:snapshotCreationTime:ShardDetail' :: ShardDetail -> Maybe POSIX
snapshotCreationTime} -> Maybe POSIX
snapshotCreationTime) (\s :: ShardDetail
s@ShardDetail' {} Maybe POSIX
a -> ShardDetail
s {$sel:snapshotCreationTime:ShardDetail' :: Maybe POSIX
snapshotCreationTime = Maybe POSIX
a} :: ShardDetail) ((Maybe POSIX -> f (Maybe POSIX)) -> ShardDetail -> f ShardDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ShardDetail
-> f ShardDetail
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
shardDetail_name :: Lens.Lens' ShardDetail (Prelude.Maybe Prelude.Text)
shardDetail_name :: (Maybe Text -> f (Maybe Text)) -> ShardDetail -> f ShardDetail
shardDetail_name = (ShardDetail -> Maybe Text)
-> (ShardDetail -> Maybe Text -> ShardDetail)
-> Lens ShardDetail ShardDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShardDetail' {Maybe Text
name :: Maybe Text
$sel:name:ShardDetail' :: ShardDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: ShardDetail
s@ShardDetail' {} Maybe Text
a -> ShardDetail
s {$sel:name:ShardDetail' :: Maybe Text
name = Maybe Text
a} :: ShardDetail)
shardDetail_configuration :: Lens.Lens' ShardDetail (Prelude.Maybe ShardConfiguration)
shardDetail_configuration :: (Maybe ShardConfiguration -> f (Maybe ShardConfiguration))
-> ShardDetail -> f ShardDetail
shardDetail_configuration = (ShardDetail -> Maybe ShardConfiguration)
-> (ShardDetail -> Maybe ShardConfiguration -> ShardDetail)
-> Lens
ShardDetail
ShardDetail
(Maybe ShardConfiguration)
(Maybe ShardConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShardDetail' {Maybe ShardConfiguration
configuration :: Maybe ShardConfiguration
$sel:configuration:ShardDetail' :: ShardDetail -> Maybe ShardConfiguration
configuration} -> Maybe ShardConfiguration
configuration) (\s :: ShardDetail
s@ShardDetail' {} Maybe ShardConfiguration
a -> ShardDetail
s {$sel:configuration:ShardDetail' :: Maybe ShardConfiguration
configuration = Maybe ShardConfiguration
a} :: ShardDetail)
instance Core.FromJSON ShardDetail where
parseJSON :: Value -> Parser ShardDetail
parseJSON =
String
-> (Object -> Parser ShardDetail) -> Value -> Parser ShardDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ShardDetail"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ShardConfiguration
-> ShardDetail
ShardDetail'
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ShardConfiguration
-> ShardDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe ShardConfiguration -> ShardDetail)
forall (f :: * -> *) a b. Functor 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
"Size")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe ShardConfiguration -> ShardDetail)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe ShardConfiguration -> ShardDetail)
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
"SnapshotCreationTime")
Parser (Maybe Text -> Maybe ShardConfiguration -> ShardDetail)
-> Parser (Maybe Text)
-> Parser (Maybe ShardConfiguration -> ShardDetail)
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 ShardConfiguration -> ShardDetail)
-> Parser (Maybe ShardConfiguration) -> Parser ShardDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ShardConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configuration")
)
instance Prelude.Hashable ShardDetail
instance Prelude.NFData ShardDetail