{-# 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.Athena.Types.EngineVersion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EngineVersion = EngineVersion'
{
EngineVersion -> Maybe Text
effectiveEngineVersion :: Prelude.Maybe Prelude.Text,
EngineVersion -> Maybe Text
selectedEngineVersion :: Prelude.Maybe Prelude.Text
}
deriving (EngineVersion -> EngineVersion -> Bool
(EngineVersion -> EngineVersion -> Bool)
-> (EngineVersion -> EngineVersion -> Bool) -> Eq EngineVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EngineVersion -> EngineVersion -> Bool
$c/= :: EngineVersion -> EngineVersion -> Bool
== :: EngineVersion -> EngineVersion -> Bool
$c== :: EngineVersion -> EngineVersion -> Bool
Prelude.Eq, ReadPrec [EngineVersion]
ReadPrec EngineVersion
Int -> ReadS EngineVersion
ReadS [EngineVersion]
(Int -> ReadS EngineVersion)
-> ReadS [EngineVersion]
-> ReadPrec EngineVersion
-> ReadPrec [EngineVersion]
-> Read EngineVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EngineVersion]
$creadListPrec :: ReadPrec [EngineVersion]
readPrec :: ReadPrec EngineVersion
$creadPrec :: ReadPrec EngineVersion
readList :: ReadS [EngineVersion]
$creadList :: ReadS [EngineVersion]
readsPrec :: Int -> ReadS EngineVersion
$creadsPrec :: Int -> ReadS EngineVersion
Prelude.Read, Int -> EngineVersion -> ShowS
[EngineVersion] -> ShowS
EngineVersion -> String
(Int -> EngineVersion -> ShowS)
-> (EngineVersion -> String)
-> ([EngineVersion] -> ShowS)
-> Show EngineVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EngineVersion] -> ShowS
$cshowList :: [EngineVersion] -> ShowS
show :: EngineVersion -> String
$cshow :: EngineVersion -> String
showsPrec :: Int -> EngineVersion -> ShowS
$cshowsPrec :: Int -> EngineVersion -> ShowS
Prelude.Show, (forall x. EngineVersion -> Rep EngineVersion x)
-> (forall x. Rep EngineVersion x -> EngineVersion)
-> Generic EngineVersion
forall x. Rep EngineVersion x -> EngineVersion
forall x. EngineVersion -> Rep EngineVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EngineVersion x -> EngineVersion
$cfrom :: forall x. EngineVersion -> Rep EngineVersion x
Prelude.Generic)
newEngineVersion ::
EngineVersion
newEngineVersion :: EngineVersion
newEngineVersion =
EngineVersion' :: Maybe Text -> Maybe Text -> EngineVersion
EngineVersion'
{ $sel:effectiveEngineVersion:EngineVersion' :: Maybe Text
effectiveEngineVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:selectedEngineVersion:EngineVersion' :: Maybe Text
selectedEngineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
engineVersion_effectiveEngineVersion :: Lens.Lens' EngineVersion (Prelude.Maybe Prelude.Text)
engineVersion_effectiveEngineVersion :: (Maybe Text -> f (Maybe Text)) -> EngineVersion -> f EngineVersion
engineVersion_effectiveEngineVersion = (EngineVersion -> Maybe Text)
-> (EngineVersion -> Maybe Text -> EngineVersion)
-> Lens EngineVersion EngineVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineVersion' {Maybe Text
effectiveEngineVersion :: Maybe Text
$sel:effectiveEngineVersion:EngineVersion' :: EngineVersion -> Maybe Text
effectiveEngineVersion} -> Maybe Text
effectiveEngineVersion) (\s :: EngineVersion
s@EngineVersion' {} Maybe Text
a -> EngineVersion
s {$sel:effectiveEngineVersion:EngineVersion' :: Maybe Text
effectiveEngineVersion = Maybe Text
a} :: EngineVersion)
engineVersion_selectedEngineVersion :: Lens.Lens' EngineVersion (Prelude.Maybe Prelude.Text)
engineVersion_selectedEngineVersion :: (Maybe Text -> f (Maybe Text)) -> EngineVersion -> f EngineVersion
engineVersion_selectedEngineVersion = (EngineVersion -> Maybe Text)
-> (EngineVersion -> Maybe Text -> EngineVersion)
-> Lens EngineVersion EngineVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineVersion' {Maybe Text
selectedEngineVersion :: Maybe Text
$sel:selectedEngineVersion:EngineVersion' :: EngineVersion -> Maybe Text
selectedEngineVersion} -> Maybe Text
selectedEngineVersion) (\s :: EngineVersion
s@EngineVersion' {} Maybe Text
a -> EngineVersion
s {$sel:selectedEngineVersion:EngineVersion' :: Maybe Text
selectedEngineVersion = Maybe Text
a} :: EngineVersion)
instance Core.FromJSON EngineVersion where
parseJSON :: Value -> Parser EngineVersion
parseJSON =
String
-> (Object -> Parser EngineVersion)
-> Value
-> Parser EngineVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EngineVersion"
( \Object
x ->
Maybe Text -> Maybe Text -> EngineVersion
EngineVersion'
(Maybe Text -> Maybe Text -> EngineVersion)
-> Parser (Maybe Text) -> Parser (Maybe Text -> EngineVersion)
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
"EffectiveEngineVersion")
Parser (Maybe Text -> EngineVersion)
-> Parser (Maybe Text) -> Parser EngineVersion
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
"SelectedEngineVersion")
)
instance Prelude.Hashable EngineVersion
instance Prelude.NFData EngineVersion
instance Core.ToJSON EngineVersion where
toJSON :: EngineVersion -> Value
toJSON EngineVersion' {Maybe Text
selectedEngineVersion :: Maybe Text
effectiveEngineVersion :: Maybe Text
$sel:selectedEngineVersion:EngineVersion' :: EngineVersion -> Maybe Text
$sel:effectiveEngineVersion:EngineVersion' :: EngineVersion -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EffectiveEngineVersion" 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
effectiveEngineVersion,
(Text
"SelectedEngineVersion" 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
selectedEngineVersion
]
)