{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticSearch.Types.AutoTuneDetails
import Amazonka.ElasticSearch.Types.AutoTuneType
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
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]
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
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. 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'
{ $sel:autoTuneDetails:AutoTune' :: Maybe AutoTuneDetails
autoTuneDetails = forall a. Maybe a
Prelude.Nothing,
$sel:autoTuneType:AutoTune' :: Maybe AutoTuneType
autoTuneType = forall a. Maybe a
Prelude.Nothing
}
autoTune_autoTuneDetails :: Lens.Lens' AutoTune (Prelude.Maybe AutoTuneDetails)
autoTune_autoTuneDetails :: Lens' AutoTune (Maybe AutoTuneDetails)
autoTune_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 :: Lens' AutoTune (Maybe AutoTuneType)
autoTune_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 Data.FromJSON AutoTune where
parseJSON :: Value -> Parser AutoTune
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutoTune"
( \Object
x ->
Maybe AutoTuneDetails -> Maybe AutoTuneType -> AutoTune
AutoTune'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AutoTuneDetails")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AutoTuneType")
)
instance Prelude.Hashable AutoTune where
hashWithSalt :: Int -> AutoTune -> Int
hashWithSalt Int
_salt AutoTune' {Maybe AutoTuneType
Maybe AutoTuneDetails
autoTuneType :: Maybe AutoTuneType
autoTuneDetails :: Maybe AutoTuneDetails
$sel:autoTuneType:AutoTune' :: AutoTune -> Maybe AutoTuneType
$sel:autoTuneDetails:AutoTune' :: AutoTune -> Maybe AutoTuneDetails
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoTuneDetails
autoTuneDetails
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoTuneType
autoTuneType
instance Prelude.NFData AutoTune where
rnf :: AutoTune -> ()
rnf AutoTune' {Maybe AutoTuneType
Maybe AutoTuneDetails
autoTuneType :: Maybe AutoTuneType
autoTuneDetails :: Maybe AutoTuneDetails
$sel:autoTuneType:AutoTune' :: AutoTune -> Maybe AutoTuneType
$sel:autoTuneDetails:AutoTune' :: AutoTune -> Maybe AutoTuneDetails
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoTuneDetails
autoTuneDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoTuneType
autoTuneType