{-# 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.RDS.Types.OptionVersion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OptionVersion = OptionVersion'
{
OptionVersion -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
OptionVersion -> Maybe Bool
isDefault :: Prelude.Maybe Prelude.Bool
}
deriving (OptionVersion -> OptionVersion -> Bool
(OptionVersion -> OptionVersion -> Bool)
-> (OptionVersion -> OptionVersion -> Bool) -> Eq OptionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OptionVersion -> OptionVersion -> Bool
$c/= :: OptionVersion -> OptionVersion -> Bool
== :: OptionVersion -> OptionVersion -> Bool
$c== :: OptionVersion -> OptionVersion -> Bool
Prelude.Eq, ReadPrec [OptionVersion]
ReadPrec OptionVersion
Int -> ReadS OptionVersion
ReadS [OptionVersion]
(Int -> ReadS OptionVersion)
-> ReadS [OptionVersion]
-> ReadPrec OptionVersion
-> ReadPrec [OptionVersion]
-> Read OptionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OptionVersion]
$creadListPrec :: ReadPrec [OptionVersion]
readPrec :: ReadPrec OptionVersion
$creadPrec :: ReadPrec OptionVersion
readList :: ReadS [OptionVersion]
$creadList :: ReadS [OptionVersion]
readsPrec :: Int -> ReadS OptionVersion
$creadsPrec :: Int -> ReadS OptionVersion
Prelude.Read, Int -> OptionVersion -> ShowS
[OptionVersion] -> ShowS
OptionVersion -> String
(Int -> OptionVersion -> ShowS)
-> (OptionVersion -> String)
-> ([OptionVersion] -> ShowS)
-> Show OptionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OptionVersion] -> ShowS
$cshowList :: [OptionVersion] -> ShowS
show :: OptionVersion -> String
$cshow :: OptionVersion -> String
showsPrec :: Int -> OptionVersion -> ShowS
$cshowsPrec :: Int -> OptionVersion -> ShowS
Prelude.Show, (forall x. OptionVersion -> Rep OptionVersion x)
-> (forall x. Rep OptionVersion x -> OptionVersion)
-> Generic OptionVersion
forall x. Rep OptionVersion x -> OptionVersion
forall x. OptionVersion -> Rep OptionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OptionVersion x -> OptionVersion
$cfrom :: forall x. OptionVersion -> Rep OptionVersion x
Prelude.Generic)
newOptionVersion ::
OptionVersion
newOptionVersion :: OptionVersion
newOptionVersion =
OptionVersion' :: Maybe Text -> Maybe Bool -> OptionVersion
OptionVersion'
{ $sel:version:OptionVersion' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:isDefault:OptionVersion' :: Maybe Bool
isDefault = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
optionVersion_version :: Lens.Lens' OptionVersion (Prelude.Maybe Prelude.Text)
optionVersion_version :: (Maybe Text -> f (Maybe Text)) -> OptionVersion -> f OptionVersion
optionVersion_version = (OptionVersion -> Maybe Text)
-> (OptionVersion -> Maybe Text -> OptionVersion)
-> Lens OptionVersion OptionVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptionVersion' {Maybe Text
version :: Maybe Text
$sel:version:OptionVersion' :: OptionVersion -> Maybe Text
version} -> Maybe Text
version) (\s :: OptionVersion
s@OptionVersion' {} Maybe Text
a -> OptionVersion
s {$sel:version:OptionVersion' :: Maybe Text
version = Maybe Text
a} :: OptionVersion)
optionVersion_isDefault :: Lens.Lens' OptionVersion (Prelude.Maybe Prelude.Bool)
optionVersion_isDefault :: (Maybe Bool -> f (Maybe Bool)) -> OptionVersion -> f OptionVersion
optionVersion_isDefault = (OptionVersion -> Maybe Bool)
-> (OptionVersion -> Maybe Bool -> OptionVersion)
-> Lens OptionVersion OptionVersion (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptionVersion' {Maybe Bool
isDefault :: Maybe Bool
$sel:isDefault:OptionVersion' :: OptionVersion -> Maybe Bool
isDefault} -> Maybe Bool
isDefault) (\s :: OptionVersion
s@OptionVersion' {} Maybe Bool
a -> OptionVersion
s {$sel:isDefault:OptionVersion' :: Maybe Bool
isDefault = Maybe Bool
a} :: OptionVersion)
instance Core.FromXML OptionVersion where
parseXML :: [Node] -> Either String OptionVersion
parseXML [Node]
x =
Maybe Text -> Maybe Bool -> OptionVersion
OptionVersion'
(Maybe Text -> Maybe Bool -> OptionVersion)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> OptionVersion)
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
"Version")
Either String (Maybe Bool -> OptionVersion)
-> Either String (Maybe Bool) -> Either String OptionVersion
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
"IsDefault")
instance Prelude.Hashable OptionVersion
instance Prelude.NFData OptionVersion