{-# 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.OpenSearch.Types.AutoTuneOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearch.Types.AutoTuneDesiredState
import Amazonka.OpenSearch.Types.AutoTuneMaintenanceSchedule
import Amazonka.OpenSearch.Types.RollbackOnDisable
import qualified Amazonka.Prelude as Prelude
data AutoTuneOptions = AutoTuneOptions'
{
AutoTuneOptions -> Maybe AutoTuneDesiredState
desiredState :: Prelude.Maybe AutoTuneDesiredState,
AutoTuneOptions -> Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules :: Prelude.Maybe [AutoTuneMaintenanceSchedule],
AutoTuneOptions -> Maybe RollbackOnDisable
rollbackOnDisable :: Prelude.Maybe RollbackOnDisable
}
deriving (AutoTuneOptions -> AutoTuneOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoTuneOptions -> AutoTuneOptions -> Bool
$c/= :: AutoTuneOptions -> AutoTuneOptions -> Bool
== :: AutoTuneOptions -> AutoTuneOptions -> Bool
$c== :: AutoTuneOptions -> AutoTuneOptions -> Bool
Prelude.Eq, ReadPrec [AutoTuneOptions]
ReadPrec AutoTuneOptions
Int -> ReadS AutoTuneOptions
ReadS [AutoTuneOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoTuneOptions]
$creadListPrec :: ReadPrec [AutoTuneOptions]
readPrec :: ReadPrec AutoTuneOptions
$creadPrec :: ReadPrec AutoTuneOptions
readList :: ReadS [AutoTuneOptions]
$creadList :: ReadS [AutoTuneOptions]
readsPrec :: Int -> ReadS AutoTuneOptions
$creadsPrec :: Int -> ReadS AutoTuneOptions
Prelude.Read, Int -> AutoTuneOptions -> ShowS
[AutoTuneOptions] -> ShowS
AutoTuneOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoTuneOptions] -> ShowS
$cshowList :: [AutoTuneOptions] -> ShowS
show :: AutoTuneOptions -> String
$cshow :: AutoTuneOptions -> String
showsPrec :: Int -> AutoTuneOptions -> ShowS
$cshowsPrec :: Int -> AutoTuneOptions -> ShowS
Prelude.Show, forall x. Rep AutoTuneOptions x -> AutoTuneOptions
forall x. AutoTuneOptions -> Rep AutoTuneOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoTuneOptions x -> AutoTuneOptions
$cfrom :: forall x. AutoTuneOptions -> Rep AutoTuneOptions x
Prelude.Generic)
newAutoTuneOptions ::
AutoTuneOptions
newAutoTuneOptions :: AutoTuneOptions
newAutoTuneOptions =
AutoTuneOptions'
{ $sel:desiredState:AutoTuneOptions' :: Maybe AutoTuneDesiredState
desiredState = forall a. Maybe a
Prelude.Nothing,
$sel:maintenanceSchedules:AutoTuneOptions' :: Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules = forall a. Maybe a
Prelude.Nothing,
$sel:rollbackOnDisable:AutoTuneOptions' :: Maybe RollbackOnDisable
rollbackOnDisable = forall a. Maybe a
Prelude.Nothing
}
autoTuneOptions_desiredState :: Lens.Lens' AutoTuneOptions (Prelude.Maybe AutoTuneDesiredState)
autoTuneOptions_desiredState :: Lens' AutoTuneOptions (Maybe AutoTuneDesiredState)
autoTuneOptions_desiredState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneOptions' {Maybe AutoTuneDesiredState
desiredState :: Maybe AutoTuneDesiredState
$sel:desiredState:AutoTuneOptions' :: AutoTuneOptions -> Maybe AutoTuneDesiredState
desiredState} -> Maybe AutoTuneDesiredState
desiredState) (\s :: AutoTuneOptions
s@AutoTuneOptions' {} Maybe AutoTuneDesiredState
a -> AutoTuneOptions
s {$sel:desiredState:AutoTuneOptions' :: Maybe AutoTuneDesiredState
desiredState = Maybe AutoTuneDesiredState
a} :: AutoTuneOptions)
autoTuneOptions_maintenanceSchedules :: Lens.Lens' AutoTuneOptions (Prelude.Maybe [AutoTuneMaintenanceSchedule])
autoTuneOptions_maintenanceSchedules :: Lens' AutoTuneOptions (Maybe [AutoTuneMaintenanceSchedule])
autoTuneOptions_maintenanceSchedules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneOptions' {Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules :: Maybe [AutoTuneMaintenanceSchedule]
$sel:maintenanceSchedules:AutoTuneOptions' :: AutoTuneOptions -> Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules} -> Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules) (\s :: AutoTuneOptions
s@AutoTuneOptions' {} Maybe [AutoTuneMaintenanceSchedule]
a -> AutoTuneOptions
s {$sel:maintenanceSchedules:AutoTuneOptions' :: Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules = Maybe [AutoTuneMaintenanceSchedule]
a} :: AutoTuneOptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
autoTuneOptions_rollbackOnDisable :: Lens.Lens' AutoTuneOptions (Prelude.Maybe RollbackOnDisable)
autoTuneOptions_rollbackOnDisable :: Lens' AutoTuneOptions (Maybe RollbackOnDisable)
autoTuneOptions_rollbackOnDisable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneOptions' {Maybe RollbackOnDisable
rollbackOnDisable :: Maybe RollbackOnDisable
$sel:rollbackOnDisable:AutoTuneOptions' :: AutoTuneOptions -> Maybe RollbackOnDisable
rollbackOnDisable} -> Maybe RollbackOnDisable
rollbackOnDisable) (\s :: AutoTuneOptions
s@AutoTuneOptions' {} Maybe RollbackOnDisable
a -> AutoTuneOptions
s {$sel:rollbackOnDisable:AutoTuneOptions' :: Maybe RollbackOnDisable
rollbackOnDisable = Maybe RollbackOnDisable
a} :: AutoTuneOptions)
instance Data.FromJSON AutoTuneOptions where
parseJSON :: Value -> Parser AutoTuneOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutoTuneOptions"
( \Object
x ->
Maybe AutoTuneDesiredState
-> Maybe [AutoTuneMaintenanceSchedule]
-> Maybe RollbackOnDisable
-> AutoTuneOptions
AutoTuneOptions'
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
"DesiredState")
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
"MaintenanceSchedules"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"RollbackOnDisable")
)
instance Prelude.Hashable AutoTuneOptions where
hashWithSalt :: Int -> AutoTuneOptions -> Int
hashWithSalt Int
_salt AutoTuneOptions' {Maybe [AutoTuneMaintenanceSchedule]
Maybe AutoTuneDesiredState
Maybe RollbackOnDisable
rollbackOnDisable :: Maybe RollbackOnDisable
maintenanceSchedules :: Maybe [AutoTuneMaintenanceSchedule]
desiredState :: Maybe AutoTuneDesiredState
$sel:rollbackOnDisable:AutoTuneOptions' :: AutoTuneOptions -> Maybe RollbackOnDisable
$sel:maintenanceSchedules:AutoTuneOptions' :: AutoTuneOptions -> Maybe [AutoTuneMaintenanceSchedule]
$sel:desiredState:AutoTuneOptions' :: AutoTuneOptions -> Maybe AutoTuneDesiredState
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoTuneDesiredState
desiredState
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RollbackOnDisable
rollbackOnDisable
instance Prelude.NFData AutoTuneOptions where
rnf :: AutoTuneOptions -> ()
rnf AutoTuneOptions' {Maybe [AutoTuneMaintenanceSchedule]
Maybe AutoTuneDesiredState
Maybe RollbackOnDisable
rollbackOnDisable :: Maybe RollbackOnDisable
maintenanceSchedules :: Maybe [AutoTuneMaintenanceSchedule]
desiredState :: Maybe AutoTuneDesiredState
$sel:rollbackOnDisable:AutoTuneOptions' :: AutoTuneOptions -> Maybe RollbackOnDisable
$sel:maintenanceSchedules:AutoTuneOptions' :: AutoTuneOptions -> Maybe [AutoTuneMaintenanceSchedule]
$sel:desiredState:AutoTuneOptions' :: AutoTuneOptions -> Maybe AutoTuneDesiredState
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoTuneDesiredState
desiredState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RollbackOnDisable
rollbackOnDisable
instance Data.ToJSON AutoTuneOptions where
toJSON :: AutoTuneOptions -> Value
toJSON AutoTuneOptions' {Maybe [AutoTuneMaintenanceSchedule]
Maybe AutoTuneDesiredState
Maybe RollbackOnDisable
rollbackOnDisable :: Maybe RollbackOnDisable
maintenanceSchedules :: Maybe [AutoTuneMaintenanceSchedule]
desiredState :: Maybe AutoTuneDesiredState
$sel:rollbackOnDisable:AutoTuneOptions' :: AutoTuneOptions -> Maybe RollbackOnDisable
$sel:maintenanceSchedules:AutoTuneOptions' :: AutoTuneOptions -> Maybe [AutoTuneMaintenanceSchedule]
$sel:desiredState:AutoTuneOptions' :: AutoTuneOptions -> Maybe AutoTuneDesiredState
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DesiredState" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoTuneDesiredState
desiredState,
(Key
"MaintenanceSchedules" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AutoTuneMaintenanceSchedule]
maintenanceSchedules,
(Key
"RollbackOnDisable" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RollbackOnDisable
rollbackOnDisable
]
)