{-# 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.Snapshot where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.ClusterConfiguration
import qualified Amazonka.Prelude as Prelude
data Snapshot = Snapshot'
{
Snapshot -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe ClusterConfiguration
clusterConfiguration :: Prelude.Maybe ClusterConfiguration,
Snapshot -> Maybe Text
source :: Prelude.Maybe Prelude.Text
}
deriving (Snapshot -> Snapshot -> Bool
(Snapshot -> Snapshot -> Bool)
-> (Snapshot -> Snapshot -> Bool) -> Eq Snapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Snapshot -> Snapshot -> Bool
$c/= :: Snapshot -> Snapshot -> Bool
== :: Snapshot -> Snapshot -> Bool
$c== :: Snapshot -> Snapshot -> Bool
Prelude.Eq, ReadPrec [Snapshot]
ReadPrec Snapshot
Int -> ReadS Snapshot
ReadS [Snapshot]
(Int -> ReadS Snapshot)
-> ReadS [Snapshot]
-> ReadPrec Snapshot
-> ReadPrec [Snapshot]
-> Read Snapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Snapshot]
$creadListPrec :: ReadPrec [Snapshot]
readPrec :: ReadPrec Snapshot
$creadPrec :: ReadPrec Snapshot
readList :: ReadS [Snapshot]
$creadList :: ReadS [Snapshot]
readsPrec :: Int -> ReadS Snapshot
$creadsPrec :: Int -> ReadS Snapshot
Prelude.Read, Int -> Snapshot -> ShowS
[Snapshot] -> ShowS
Snapshot -> String
(Int -> Snapshot -> ShowS)
-> (Snapshot -> String) -> ([Snapshot] -> ShowS) -> Show Snapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Snapshot] -> ShowS
$cshowList :: [Snapshot] -> ShowS
show :: Snapshot -> String
$cshow :: Snapshot -> String
showsPrec :: Int -> Snapshot -> ShowS
$cshowsPrec :: Int -> Snapshot -> ShowS
Prelude.Show, (forall x. Snapshot -> Rep Snapshot x)
-> (forall x. Rep Snapshot x -> Snapshot) -> Generic Snapshot
forall x. Rep Snapshot x -> Snapshot
forall x. Snapshot -> Rep Snapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Snapshot x -> Snapshot
$cfrom :: forall x. Snapshot -> Rep Snapshot x
Prelude.Generic)
newSnapshot ::
Snapshot
newSnapshot :: Snapshot
newSnapshot =
Snapshot' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ClusterConfiguration
-> Maybe Text
-> Snapshot
Snapshot'
{ $sel:status:Snapshot' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Snapshot' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:Snapshot' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Snapshot' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterConfiguration:Snapshot' :: Maybe ClusterConfiguration
clusterConfiguration = Maybe ClusterConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:source:Snapshot' :: Maybe Text
source = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
snapshot_status :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_status :: (Maybe Text -> f (Maybe Text)) -> Snapshot -> f Snapshot
snapshot_status = (Snapshot -> Maybe Text)
-> (Snapshot -> Maybe Text -> Snapshot)
-> Lens Snapshot Snapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
status :: Maybe Text
$sel:status:Snapshot' :: Snapshot -> Maybe Text
status} -> Maybe Text
status) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:status:Snapshot' :: Maybe Text
status = Maybe Text
a} :: Snapshot)
snapshot_arn :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_arn :: (Maybe Text -> f (Maybe Text)) -> Snapshot -> f Snapshot
snapshot_arn = (Snapshot -> Maybe Text)
-> (Snapshot -> Maybe Text -> Snapshot)
-> Lens Snapshot Snapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
arn :: Maybe Text
$sel:arn:Snapshot' :: Snapshot -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:arn:Snapshot' :: Maybe Text
arn = Maybe Text
a} :: Snapshot)
snapshot_kmsKeyId :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_kmsKeyId :: (Maybe Text -> f (Maybe Text)) -> Snapshot -> f Snapshot
snapshot_kmsKeyId = (Snapshot -> Maybe Text)
-> (Snapshot -> Maybe Text -> Snapshot)
-> Lens Snapshot Snapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:Snapshot' :: Snapshot -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:kmsKeyId:Snapshot' :: Maybe Text
kmsKeyId = Maybe Text
a} :: Snapshot)
snapshot_name :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_name :: (Maybe Text -> f (Maybe Text)) -> Snapshot -> f Snapshot
snapshot_name = (Snapshot -> Maybe Text)
-> (Snapshot -> Maybe Text -> Snapshot)
-> Lens Snapshot Snapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
name :: Maybe Text
$sel:name:Snapshot' :: Snapshot -> Maybe Text
name} -> Maybe Text
name) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:name:Snapshot' :: Maybe Text
name = Maybe Text
a} :: Snapshot)
snapshot_clusterConfiguration :: Lens.Lens' Snapshot (Prelude.Maybe ClusterConfiguration)
snapshot_clusterConfiguration :: (Maybe ClusterConfiguration -> f (Maybe ClusterConfiguration))
-> Snapshot -> f Snapshot
snapshot_clusterConfiguration = (Snapshot -> Maybe ClusterConfiguration)
-> (Snapshot -> Maybe ClusterConfiguration -> Snapshot)
-> Lens
Snapshot
Snapshot
(Maybe ClusterConfiguration)
(Maybe ClusterConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe ClusterConfiguration
clusterConfiguration :: Maybe ClusterConfiguration
$sel:clusterConfiguration:Snapshot' :: Snapshot -> Maybe ClusterConfiguration
clusterConfiguration} -> Maybe ClusterConfiguration
clusterConfiguration) (\s :: Snapshot
s@Snapshot' {} Maybe ClusterConfiguration
a -> Snapshot
s {$sel:clusterConfiguration:Snapshot' :: Maybe ClusterConfiguration
clusterConfiguration = Maybe ClusterConfiguration
a} :: Snapshot)
snapshot_source :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_source :: (Maybe Text -> f (Maybe Text)) -> Snapshot -> f Snapshot
snapshot_source = (Snapshot -> Maybe Text)
-> (Snapshot -> Maybe Text -> Snapshot)
-> Lens Snapshot Snapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
source :: Maybe Text
$sel:source:Snapshot' :: Snapshot -> Maybe Text
source} -> Maybe Text
source) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:source:Snapshot' :: Maybe Text
source = Maybe Text
a} :: Snapshot)
instance Core.FromJSON Snapshot where
parseJSON :: Value -> Parser Snapshot
parseJSON =
String -> (Object -> Parser Snapshot) -> Value -> Parser Snapshot
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Snapshot"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ClusterConfiguration
-> Maybe Text
-> Snapshot
Snapshot'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ClusterConfiguration
-> Maybe Text
-> Snapshot)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ClusterConfiguration
-> Maybe Text
-> Snapshot)
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
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ClusterConfiguration
-> Maybe Text
-> Snapshot)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ClusterConfiguration
-> Maybe Text
-> Snapshot)
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 Text
-> Maybe Text
-> Maybe ClusterConfiguration
-> Maybe Text
-> Snapshot)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ClusterConfiguration -> Maybe Text -> Snapshot)
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
"KmsKeyId")
Parser
(Maybe Text
-> Maybe ClusterConfiguration -> Maybe Text -> Snapshot)
-> Parser (Maybe Text)
-> Parser (Maybe ClusterConfiguration -> Maybe Text -> Snapshot)
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 ClusterConfiguration -> Maybe Text -> Snapshot)
-> Parser (Maybe ClusterConfiguration)
-> Parser (Maybe Text -> Snapshot)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClusterConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClusterConfiguration")
Parser (Maybe Text -> Snapshot)
-> Parser (Maybe Text) -> Parser Snapshot
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
"Source")
)
instance Prelude.Hashable Snapshot
instance Prelude.NFData Snapshot