{-# 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.DocumentDB.Types.UpgradeTarget where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UpgradeTarget = UpgradeTarget'
{
UpgradeTarget -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
UpgradeTarget -> Maybe Bool
isMajorVersionUpgrade :: Prelude.Maybe Prelude.Bool,
UpgradeTarget -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
UpgradeTarget -> Maybe Bool
autoUpgrade :: Prelude.Maybe Prelude.Bool,
UpgradeTarget -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (UpgradeTarget -> UpgradeTarget -> Bool
(UpgradeTarget -> UpgradeTarget -> Bool)
-> (UpgradeTarget -> UpgradeTarget -> Bool) -> Eq UpgradeTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpgradeTarget -> UpgradeTarget -> Bool
$c/= :: UpgradeTarget -> UpgradeTarget -> Bool
== :: UpgradeTarget -> UpgradeTarget -> Bool
$c== :: UpgradeTarget -> UpgradeTarget -> Bool
Prelude.Eq, ReadPrec [UpgradeTarget]
ReadPrec UpgradeTarget
Int -> ReadS UpgradeTarget
ReadS [UpgradeTarget]
(Int -> ReadS UpgradeTarget)
-> ReadS [UpgradeTarget]
-> ReadPrec UpgradeTarget
-> ReadPrec [UpgradeTarget]
-> Read UpgradeTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpgradeTarget]
$creadListPrec :: ReadPrec [UpgradeTarget]
readPrec :: ReadPrec UpgradeTarget
$creadPrec :: ReadPrec UpgradeTarget
readList :: ReadS [UpgradeTarget]
$creadList :: ReadS [UpgradeTarget]
readsPrec :: Int -> ReadS UpgradeTarget
$creadsPrec :: Int -> ReadS UpgradeTarget
Prelude.Read, Int -> UpgradeTarget -> ShowS
[UpgradeTarget] -> ShowS
UpgradeTarget -> String
(Int -> UpgradeTarget -> ShowS)
-> (UpgradeTarget -> String)
-> ([UpgradeTarget] -> ShowS)
-> Show UpgradeTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpgradeTarget] -> ShowS
$cshowList :: [UpgradeTarget] -> ShowS
show :: UpgradeTarget -> String
$cshow :: UpgradeTarget -> String
showsPrec :: Int -> UpgradeTarget -> ShowS
$cshowsPrec :: Int -> UpgradeTarget -> ShowS
Prelude.Show, (forall x. UpgradeTarget -> Rep UpgradeTarget x)
-> (forall x. Rep UpgradeTarget x -> UpgradeTarget)
-> Generic UpgradeTarget
forall x. Rep UpgradeTarget x -> UpgradeTarget
forall x. UpgradeTarget -> Rep UpgradeTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpgradeTarget x -> UpgradeTarget
$cfrom :: forall x. UpgradeTarget -> Rep UpgradeTarget x
Prelude.Generic)
newUpgradeTarget ::
UpgradeTarget
newUpgradeTarget :: UpgradeTarget
newUpgradeTarget =
UpgradeTarget' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> UpgradeTarget
UpgradeTarget'
{ $sel:engineVersion:UpgradeTarget' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:isMajorVersionUpgrade:UpgradeTarget' :: Maybe Bool
isMajorVersionUpgrade = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:engine:UpgradeTarget' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoUpgrade:UpgradeTarget' :: Maybe Bool
autoUpgrade = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpgradeTarget' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
upgradeTarget_engineVersion :: Lens.Lens' UpgradeTarget (Prelude.Maybe Prelude.Text)
upgradeTarget_engineVersion :: (Maybe Text -> f (Maybe Text)) -> UpgradeTarget -> f UpgradeTarget
upgradeTarget_engineVersion = (UpgradeTarget -> Maybe Text)
-> (UpgradeTarget -> Maybe Text -> UpgradeTarget)
-> Lens UpgradeTarget UpgradeTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeTarget' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:UpgradeTarget' :: UpgradeTarget -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: UpgradeTarget
s@UpgradeTarget' {} Maybe Text
a -> UpgradeTarget
s {$sel:engineVersion:UpgradeTarget' :: Maybe Text
engineVersion = Maybe Text
a} :: UpgradeTarget)
upgradeTarget_isMajorVersionUpgrade :: Lens.Lens' UpgradeTarget (Prelude.Maybe Prelude.Bool)
upgradeTarget_isMajorVersionUpgrade :: (Maybe Bool -> f (Maybe Bool)) -> UpgradeTarget -> f UpgradeTarget
upgradeTarget_isMajorVersionUpgrade = (UpgradeTarget -> Maybe Bool)
-> (UpgradeTarget -> Maybe Bool -> UpgradeTarget)
-> Lens UpgradeTarget UpgradeTarget (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeTarget' {Maybe Bool
isMajorVersionUpgrade :: Maybe Bool
$sel:isMajorVersionUpgrade:UpgradeTarget' :: UpgradeTarget -> Maybe Bool
isMajorVersionUpgrade} -> Maybe Bool
isMajorVersionUpgrade) (\s :: UpgradeTarget
s@UpgradeTarget' {} Maybe Bool
a -> UpgradeTarget
s {$sel:isMajorVersionUpgrade:UpgradeTarget' :: Maybe Bool
isMajorVersionUpgrade = Maybe Bool
a} :: UpgradeTarget)
upgradeTarget_engine :: Lens.Lens' UpgradeTarget (Prelude.Maybe Prelude.Text)
upgradeTarget_engine :: (Maybe Text -> f (Maybe Text)) -> UpgradeTarget -> f UpgradeTarget
upgradeTarget_engine = (UpgradeTarget -> Maybe Text)
-> (UpgradeTarget -> Maybe Text -> UpgradeTarget)
-> Lens UpgradeTarget UpgradeTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeTarget' {Maybe Text
engine :: Maybe Text
$sel:engine:UpgradeTarget' :: UpgradeTarget -> Maybe Text
engine} -> Maybe Text
engine) (\s :: UpgradeTarget
s@UpgradeTarget' {} Maybe Text
a -> UpgradeTarget
s {$sel:engine:UpgradeTarget' :: Maybe Text
engine = Maybe Text
a} :: UpgradeTarget)
upgradeTarget_autoUpgrade :: Lens.Lens' UpgradeTarget (Prelude.Maybe Prelude.Bool)
upgradeTarget_autoUpgrade :: (Maybe Bool -> f (Maybe Bool)) -> UpgradeTarget -> f UpgradeTarget
upgradeTarget_autoUpgrade = (UpgradeTarget -> Maybe Bool)
-> (UpgradeTarget -> Maybe Bool -> UpgradeTarget)
-> Lens UpgradeTarget UpgradeTarget (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeTarget' {Maybe Bool
autoUpgrade :: Maybe Bool
$sel:autoUpgrade:UpgradeTarget' :: UpgradeTarget -> Maybe Bool
autoUpgrade} -> Maybe Bool
autoUpgrade) (\s :: UpgradeTarget
s@UpgradeTarget' {} Maybe Bool
a -> UpgradeTarget
s {$sel:autoUpgrade:UpgradeTarget' :: Maybe Bool
autoUpgrade = Maybe Bool
a} :: UpgradeTarget)
upgradeTarget_description :: Lens.Lens' UpgradeTarget (Prelude.Maybe Prelude.Text)
upgradeTarget_description :: (Maybe Text -> f (Maybe Text)) -> UpgradeTarget -> f UpgradeTarget
upgradeTarget_description = (UpgradeTarget -> Maybe Text)
-> (UpgradeTarget -> Maybe Text -> UpgradeTarget)
-> Lens UpgradeTarget UpgradeTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeTarget' {Maybe Text
description :: Maybe Text
$sel:description:UpgradeTarget' :: UpgradeTarget -> Maybe Text
description} -> Maybe Text
description) (\s :: UpgradeTarget
s@UpgradeTarget' {} Maybe Text
a -> UpgradeTarget
s {$sel:description:UpgradeTarget' :: Maybe Text
description = Maybe Text
a} :: UpgradeTarget)
instance Core.FromXML UpgradeTarget where
parseXML :: [Node] -> Either String UpgradeTarget
parseXML [Node]
x =
Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> UpgradeTarget
UpgradeTarget'
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> UpgradeTarget)
-> Either String (Maybe Text)
-> Either
String
(Maybe Bool
-> Maybe Text -> Maybe Bool -> Maybe Text -> UpgradeTarget)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EngineVersion")
Either
String
(Maybe Bool
-> Maybe Text -> Maybe Bool -> Maybe Text -> UpgradeTarget)
-> Either String (Maybe Bool)
-> Either
String (Maybe Text -> Maybe Bool -> Maybe Text -> UpgradeTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsMajorVersionUpgrade")
Either
String (Maybe Text -> Maybe Bool -> Maybe Text -> UpgradeTarget)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> Maybe Text -> UpgradeTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Engine")
Either String (Maybe Bool -> Maybe Text -> UpgradeTarget)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> UpgradeTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AutoUpgrade")
Either String (Maybe Text -> UpgradeTarget)
-> Either String (Maybe Text) -> Either String UpgradeTarget
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Description")
instance Prelude.Hashable UpgradeTarget
instance Prelude.NFData UpgradeTarget