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