{-# 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.SMS.Types.ServerReplicationParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SMS.Types.LicenseType
data ServerReplicationParameters = ServerReplicationParameters'
{
ServerReplicationParameters -> Maybe Int
frequency :: Prelude.Maybe Prelude.Int,
ServerReplicationParameters -> Maybe Int
numberOfRecentAmisToKeep :: Prelude.Maybe Prelude.Int,
ServerReplicationParameters -> Maybe POSIX
seedTime :: Prelude.Maybe Core.POSIX,
ServerReplicationParameters -> Maybe LicenseType
licenseType :: Prelude.Maybe LicenseType,
ServerReplicationParameters -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
ServerReplicationParameters -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
ServerReplicationParameters -> Maybe Bool
runOnce :: Prelude.Maybe Prelude.Bool
}
deriving (ServerReplicationParameters -> ServerReplicationParameters -> Bool
(ServerReplicationParameters
-> ServerReplicationParameters -> Bool)
-> (ServerReplicationParameters
-> ServerReplicationParameters -> Bool)
-> Eq ServerReplicationParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerReplicationParameters -> ServerReplicationParameters -> Bool
$c/= :: ServerReplicationParameters -> ServerReplicationParameters -> Bool
== :: ServerReplicationParameters -> ServerReplicationParameters -> Bool
$c== :: ServerReplicationParameters -> ServerReplicationParameters -> Bool
Prelude.Eq, ReadPrec [ServerReplicationParameters]
ReadPrec ServerReplicationParameters
Int -> ReadS ServerReplicationParameters
ReadS [ServerReplicationParameters]
(Int -> ReadS ServerReplicationParameters)
-> ReadS [ServerReplicationParameters]
-> ReadPrec ServerReplicationParameters
-> ReadPrec [ServerReplicationParameters]
-> Read ServerReplicationParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServerReplicationParameters]
$creadListPrec :: ReadPrec [ServerReplicationParameters]
readPrec :: ReadPrec ServerReplicationParameters
$creadPrec :: ReadPrec ServerReplicationParameters
readList :: ReadS [ServerReplicationParameters]
$creadList :: ReadS [ServerReplicationParameters]
readsPrec :: Int -> ReadS ServerReplicationParameters
$creadsPrec :: Int -> ReadS ServerReplicationParameters
Prelude.Read, Int -> ServerReplicationParameters -> ShowS
[ServerReplicationParameters] -> ShowS
ServerReplicationParameters -> String
(Int -> ServerReplicationParameters -> ShowS)
-> (ServerReplicationParameters -> String)
-> ([ServerReplicationParameters] -> ShowS)
-> Show ServerReplicationParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServerReplicationParameters] -> ShowS
$cshowList :: [ServerReplicationParameters] -> ShowS
show :: ServerReplicationParameters -> String
$cshow :: ServerReplicationParameters -> String
showsPrec :: Int -> ServerReplicationParameters -> ShowS
$cshowsPrec :: Int -> ServerReplicationParameters -> ShowS
Prelude.Show, (forall x.
ServerReplicationParameters -> Rep ServerReplicationParameters x)
-> (forall x.
Rep ServerReplicationParameters x -> ServerReplicationParameters)
-> Generic ServerReplicationParameters
forall x.
Rep ServerReplicationParameters x -> ServerReplicationParameters
forall x.
ServerReplicationParameters -> Rep ServerReplicationParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ServerReplicationParameters x -> ServerReplicationParameters
$cfrom :: forall x.
ServerReplicationParameters -> Rep ServerReplicationParameters x
Prelude.Generic)
newServerReplicationParameters ::
ServerReplicationParameters
newServerReplicationParameters :: ServerReplicationParameters
newServerReplicationParameters =
ServerReplicationParameters' :: Maybe Int
-> Maybe Int
-> Maybe POSIX
-> Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters
ServerReplicationParameters'
{ $sel:frequency:ServerReplicationParameters' :: Maybe Int
frequency =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfRecentAmisToKeep:ServerReplicationParameters' :: Maybe Int
numberOfRecentAmisToKeep = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:seedTime:ServerReplicationParameters' :: Maybe POSIX
seedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:licenseType:ServerReplicationParameters' :: Maybe LicenseType
licenseType = Maybe LicenseType
forall a. Maybe a
Prelude.Nothing,
$sel:encrypted:ServerReplicationParameters' :: Maybe Bool
encrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:ServerReplicationParameters' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:runOnce:ServerReplicationParameters' :: Maybe Bool
runOnce = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
serverReplicationParameters_frequency :: Lens.Lens' ServerReplicationParameters (Prelude.Maybe Prelude.Int)
serverReplicationParameters_frequency :: (Maybe Int -> f (Maybe Int))
-> ServerReplicationParameters -> f ServerReplicationParameters
serverReplicationParameters_frequency = (ServerReplicationParameters -> Maybe Int)
-> (ServerReplicationParameters
-> Maybe Int -> ServerReplicationParameters)
-> Lens
ServerReplicationParameters
ServerReplicationParameters
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerReplicationParameters' {Maybe Int
frequency :: Maybe Int
$sel:frequency:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Int
frequency} -> Maybe Int
frequency) (\s :: ServerReplicationParameters
s@ServerReplicationParameters' {} Maybe Int
a -> ServerReplicationParameters
s {$sel:frequency:ServerReplicationParameters' :: Maybe Int
frequency = Maybe Int
a} :: ServerReplicationParameters)
serverReplicationParameters_numberOfRecentAmisToKeep :: Lens.Lens' ServerReplicationParameters (Prelude.Maybe Prelude.Int)
serverReplicationParameters_numberOfRecentAmisToKeep :: (Maybe Int -> f (Maybe Int))
-> ServerReplicationParameters -> f ServerReplicationParameters
serverReplicationParameters_numberOfRecentAmisToKeep = (ServerReplicationParameters -> Maybe Int)
-> (ServerReplicationParameters
-> Maybe Int -> ServerReplicationParameters)
-> Lens
ServerReplicationParameters
ServerReplicationParameters
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerReplicationParameters' {Maybe Int
numberOfRecentAmisToKeep :: Maybe Int
$sel:numberOfRecentAmisToKeep:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Int
numberOfRecentAmisToKeep} -> Maybe Int
numberOfRecentAmisToKeep) (\s :: ServerReplicationParameters
s@ServerReplicationParameters' {} Maybe Int
a -> ServerReplicationParameters
s {$sel:numberOfRecentAmisToKeep:ServerReplicationParameters' :: Maybe Int
numberOfRecentAmisToKeep = Maybe Int
a} :: ServerReplicationParameters)
serverReplicationParameters_seedTime :: Lens.Lens' ServerReplicationParameters (Prelude.Maybe Prelude.UTCTime)
serverReplicationParameters_seedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServerReplicationParameters -> f ServerReplicationParameters
serverReplicationParameters_seedTime = (ServerReplicationParameters -> Maybe POSIX)
-> (ServerReplicationParameters
-> Maybe POSIX -> ServerReplicationParameters)
-> Lens
ServerReplicationParameters
ServerReplicationParameters
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerReplicationParameters' {Maybe POSIX
seedTime :: Maybe POSIX
$sel:seedTime:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe POSIX
seedTime} -> Maybe POSIX
seedTime) (\s :: ServerReplicationParameters
s@ServerReplicationParameters' {} Maybe POSIX
a -> ServerReplicationParameters
s {$sel:seedTime:ServerReplicationParameters' :: Maybe POSIX
seedTime = Maybe POSIX
a} :: ServerReplicationParameters) ((Maybe POSIX -> f (Maybe POSIX))
-> ServerReplicationParameters -> f ServerReplicationParameters)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServerReplicationParameters
-> f ServerReplicationParameters
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
serverReplicationParameters_licenseType :: Lens.Lens' ServerReplicationParameters (Prelude.Maybe LicenseType)
serverReplicationParameters_licenseType :: (Maybe LicenseType -> f (Maybe LicenseType))
-> ServerReplicationParameters -> f ServerReplicationParameters
serverReplicationParameters_licenseType = (ServerReplicationParameters -> Maybe LicenseType)
-> (ServerReplicationParameters
-> Maybe LicenseType -> ServerReplicationParameters)
-> Lens
ServerReplicationParameters
ServerReplicationParameters
(Maybe LicenseType)
(Maybe LicenseType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerReplicationParameters' {Maybe LicenseType
licenseType :: Maybe LicenseType
$sel:licenseType:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe LicenseType
licenseType} -> Maybe LicenseType
licenseType) (\s :: ServerReplicationParameters
s@ServerReplicationParameters' {} Maybe LicenseType
a -> ServerReplicationParameters
s {$sel:licenseType:ServerReplicationParameters' :: Maybe LicenseType
licenseType = Maybe LicenseType
a} :: ServerReplicationParameters)
serverReplicationParameters_encrypted :: Lens.Lens' ServerReplicationParameters (Prelude.Maybe Prelude.Bool)
serverReplicationParameters_encrypted :: (Maybe Bool -> f (Maybe Bool))
-> ServerReplicationParameters -> f ServerReplicationParameters
serverReplicationParameters_encrypted = (ServerReplicationParameters -> Maybe Bool)
-> (ServerReplicationParameters
-> Maybe Bool -> ServerReplicationParameters)
-> Lens
ServerReplicationParameters
ServerReplicationParameters
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerReplicationParameters' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: ServerReplicationParameters
s@ServerReplicationParameters' {} Maybe Bool
a -> ServerReplicationParameters
s {$sel:encrypted:ServerReplicationParameters' :: Maybe Bool
encrypted = Maybe Bool
a} :: ServerReplicationParameters)
serverReplicationParameters_kmsKeyId :: Lens.Lens' ServerReplicationParameters (Prelude.Maybe Prelude.Text)
serverReplicationParameters_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> ServerReplicationParameters -> f ServerReplicationParameters
serverReplicationParameters_kmsKeyId = (ServerReplicationParameters -> Maybe Text)
-> (ServerReplicationParameters
-> Maybe Text -> ServerReplicationParameters)
-> Lens
ServerReplicationParameters
ServerReplicationParameters
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerReplicationParameters' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: ServerReplicationParameters
s@ServerReplicationParameters' {} Maybe Text
a -> ServerReplicationParameters
s {$sel:kmsKeyId:ServerReplicationParameters' :: Maybe Text
kmsKeyId = Maybe Text
a} :: ServerReplicationParameters)
serverReplicationParameters_runOnce :: Lens.Lens' ServerReplicationParameters (Prelude.Maybe Prelude.Bool)
serverReplicationParameters_runOnce :: (Maybe Bool -> f (Maybe Bool))
-> ServerReplicationParameters -> f ServerReplicationParameters
serverReplicationParameters_runOnce = (ServerReplicationParameters -> Maybe Bool)
-> (ServerReplicationParameters
-> Maybe Bool -> ServerReplicationParameters)
-> Lens
ServerReplicationParameters
ServerReplicationParameters
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerReplicationParameters' {Maybe Bool
runOnce :: Maybe Bool
$sel:runOnce:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Bool
runOnce} -> Maybe Bool
runOnce) (\s :: ServerReplicationParameters
s@ServerReplicationParameters' {} Maybe Bool
a -> ServerReplicationParameters
s {$sel:runOnce:ServerReplicationParameters' :: Maybe Bool
runOnce = Maybe Bool
a} :: ServerReplicationParameters)
instance Core.FromJSON ServerReplicationParameters where
parseJSON :: Value -> Parser ServerReplicationParameters
parseJSON =
String
-> (Object -> Parser ServerReplicationParameters)
-> Value
-> Parser ServerReplicationParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServerReplicationParameters"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe POSIX
-> Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters
ServerReplicationParameters'
(Maybe Int
-> Maybe Int
-> Maybe POSIX
-> Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe POSIX
-> Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"frequency")
Parser
(Maybe Int
-> Maybe POSIX
-> Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters)
-> Parser (Maybe Int)
-> Parser
(Maybe POSIX
-> Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"numberOfRecentAmisToKeep")
Parser
(Maybe POSIX
-> Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters)
-> Parser (Maybe POSIX)
-> Parser
(Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters)
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
"seedTime")
Parser
(Maybe LicenseType
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> ServerReplicationParameters)
-> Parser (Maybe LicenseType)
-> Parser
(Maybe Bool
-> Maybe Text -> Maybe Bool -> ServerReplicationParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LicenseType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"licenseType")
Parser
(Maybe Bool
-> Maybe Text -> Maybe Bool -> ServerReplicationParameters)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Bool -> ServerReplicationParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encrypted")
Parser (Maybe Text -> Maybe Bool -> ServerReplicationParameters)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> ServerReplicationParameters)
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 Bool -> ServerReplicationParameters)
-> Parser (Maybe Bool) -> Parser ServerReplicationParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"runOnce")
)
instance Prelude.Hashable ServerReplicationParameters
instance Prelude.NFData ServerReplicationParameters
instance Core.ToJSON ServerReplicationParameters where
toJSON :: ServerReplicationParameters -> Value
toJSON ServerReplicationParameters' {Maybe Bool
Maybe Int
Maybe Text
Maybe POSIX
Maybe LicenseType
runOnce :: Maybe Bool
kmsKeyId :: Maybe Text
encrypted :: Maybe Bool
licenseType :: Maybe LicenseType
seedTime :: Maybe POSIX
numberOfRecentAmisToKeep :: Maybe Int
frequency :: Maybe Int
$sel:runOnce:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Bool
$sel:kmsKeyId:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Text
$sel:encrypted:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Bool
$sel:licenseType:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe LicenseType
$sel:seedTime:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe POSIX
$sel:numberOfRecentAmisToKeep:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Int
$sel:frequency:ServerReplicationParameters' :: ServerReplicationParameters -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"frequency" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
frequency,
(Text
"numberOfRecentAmisToKeep" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
numberOfRecentAmisToKeep,
(Text
"seedTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
seedTime,
(Text
"licenseType" Text -> LicenseType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LicenseType -> Pair) -> Maybe LicenseType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LicenseType
licenseType,
(Text
"encrypted" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
encrypted,
(Text
"kmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
(Text
"runOnce" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
runOnce
]
)