{-# 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.ElasticSearch.Types.AutoTune where
import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types.AutoTuneDetails
import Amazonka.ElasticSearch.Types.AutoTuneType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoTune = AutoTune'
{
AutoTune -> Maybe AutoTuneDetails
autoTuneDetails :: Prelude.Maybe AutoTuneDetails,
AutoTune -> Maybe AutoTuneType
autoTuneType :: Prelude.Maybe AutoTuneType
}
deriving (AutoTune -> AutoTune -> Bool
(AutoTune -> AutoTune -> Bool)
-> (AutoTune -> AutoTune -> Bool) -> Eq AutoTune
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoTune -> AutoTune -> Bool
$c/= :: AutoTune -> AutoTune -> Bool
== :: AutoTune -> AutoTune -> Bool
$c== :: AutoTune -> AutoTune -> Bool
Prelude.Eq, ReadPrec [AutoTune]
ReadPrec AutoTune
Int -> ReadS AutoTune
ReadS [AutoTune]
(Int -> ReadS AutoTune)
-> ReadS [AutoTune]
-> ReadPrec AutoTune
-> ReadPrec [AutoTune]
-> Read AutoTune
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoTune]
$creadListPrec :: ReadPrec [AutoTune]
readPrec :: ReadPrec AutoTune
$creadPrec :: ReadPrec AutoTune
readList :: ReadS [AutoTune]
$creadList :: ReadS [AutoTune]
readsPrec :: Int -> ReadS AutoTune
$creadsPrec :: Int -> ReadS AutoTune
Prelude.Read, Int -> AutoTune -> ShowS
[AutoTune] -> ShowS
AutoTune -> String
(Int -> AutoTune -> ShowS)
-> (AutoTune -> String) -> ([AutoTune] -> ShowS) -> Show AutoTune
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoTune] -> ShowS
$cshowList :: [AutoTune] -> ShowS
show :: AutoTune -> String
$cshow :: AutoTune -> String
showsPrec :: Int -> AutoTune -> ShowS
$cshowsPrec :: Int -> AutoTune -> ShowS
Prelude.Show, (forall x. AutoTune -> Rep AutoTune x)
-> (forall x. Rep AutoTune x -> AutoTune) -> Generic AutoTune
forall x. Rep AutoTune x -> AutoTune
forall x. AutoTune -> Rep AutoTune x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoTune x -> AutoTune
$cfrom :: forall x. AutoTune -> Rep AutoTune x
Prelude.Generic)
newAutoTune ::
AutoTune
newAutoTune :: AutoTune
newAutoTune =
AutoTune' :: Maybe AutoTuneDetails -> Maybe AutoTuneType -> AutoTune
AutoTune'
{ $sel:autoTuneDetails:AutoTune' :: Maybe AutoTuneDetails
autoTuneDetails = Maybe AutoTuneDetails
forall a. Maybe a
Prelude.Nothing,
$sel:autoTuneType:AutoTune' :: Maybe AutoTuneType
autoTuneType = Maybe AutoTuneType
forall a. Maybe a
Prelude.Nothing
}
autoTune_autoTuneDetails :: Lens.Lens' AutoTune (Prelude.Maybe AutoTuneDetails)
autoTune_autoTuneDetails :: (Maybe AutoTuneDetails -> f (Maybe AutoTuneDetails))
-> AutoTune -> f AutoTune
autoTune_autoTuneDetails = (AutoTune -> Maybe AutoTuneDetails)
-> (AutoTune -> Maybe AutoTuneDetails -> AutoTune)
-> Lens
AutoTune AutoTune (Maybe AutoTuneDetails) (Maybe AutoTuneDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTune' {Maybe AutoTuneDetails
autoTuneDetails :: Maybe AutoTuneDetails
$sel:autoTuneDetails:AutoTune' :: AutoTune -> Maybe AutoTuneDetails
autoTuneDetails} -> Maybe AutoTuneDetails
autoTuneDetails) (\s :: AutoTune
s@AutoTune' {} Maybe AutoTuneDetails
a -> AutoTune
s {$sel:autoTuneDetails:AutoTune' :: Maybe AutoTuneDetails
autoTuneDetails = Maybe AutoTuneDetails
a} :: AutoTune)
autoTune_autoTuneType :: Lens.Lens' AutoTune (Prelude.Maybe AutoTuneType)
autoTune_autoTuneType :: (Maybe AutoTuneType -> f (Maybe AutoTuneType))
-> AutoTune -> f AutoTune
autoTune_autoTuneType = (AutoTune -> Maybe AutoTuneType)
-> (AutoTune -> Maybe AutoTuneType -> AutoTune)
-> Lens AutoTune AutoTune (Maybe AutoTuneType) (Maybe AutoTuneType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTune' {Maybe AutoTuneType
autoTuneType :: Maybe AutoTuneType
$sel:autoTuneType:AutoTune' :: AutoTune -> Maybe AutoTuneType
autoTuneType} -> Maybe AutoTuneType
autoTuneType) (\s :: AutoTune
s@AutoTune' {} Maybe AutoTuneType
a -> AutoTune
s {$sel:autoTuneType:AutoTune' :: Maybe AutoTuneType
autoTuneType = Maybe AutoTuneType
a} :: AutoTune)
instance Core.FromJSON AutoTune where
parseJSON :: Value -> Parser AutoTune
parseJSON =
String -> (Object -> Parser AutoTune) -> Value -> Parser AutoTune
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AutoTune"
( \Object
x ->
Maybe AutoTuneDetails -> Maybe AutoTuneType -> AutoTune
AutoTune'
(Maybe AutoTuneDetails -> Maybe AutoTuneType -> AutoTune)
-> Parser (Maybe AutoTuneDetails)
-> Parser (Maybe AutoTuneType -> AutoTune)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AutoTuneDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AutoTuneDetails")
Parser (Maybe AutoTuneType -> AutoTune)
-> Parser (Maybe AutoTuneType) -> Parser AutoTune
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoTuneType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AutoTuneType")
)
instance Prelude.Hashable AutoTune
instance Prelude.NFData AutoTune