{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.OpenSearch.Types.AutoTuneOptionsStatus
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.OpenSearch.Types.AutoTuneOptionsStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.AutoTuneOptions
import Amazonka.OpenSearch.Types.AutoTuneStatus
import qualified Amazonka.Prelude as Prelude

-- | The Auto-Tune status for the domain.
--
-- /See:/ 'newAutoTuneOptionsStatus' smart constructor.
data AutoTuneOptionsStatus = AutoTuneOptionsStatus'
  { -- | The status of the Auto-Tune options for the domain.
    AutoTuneOptionsStatus -> Maybe AutoTuneStatus
status :: Prelude.Maybe AutoTuneStatus,
    -- | Specifies Auto-Tune options for the domain.
    AutoTuneOptionsStatus -> Maybe AutoTuneOptions
options :: Prelude.Maybe AutoTuneOptions
  }
  deriving (AutoTuneOptionsStatus -> AutoTuneOptionsStatus -> Bool
(AutoTuneOptionsStatus -> AutoTuneOptionsStatus -> Bool)
-> (AutoTuneOptionsStatus -> AutoTuneOptionsStatus -> Bool)
-> Eq AutoTuneOptionsStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoTuneOptionsStatus -> AutoTuneOptionsStatus -> Bool
$c/= :: AutoTuneOptionsStatus -> AutoTuneOptionsStatus -> Bool
== :: AutoTuneOptionsStatus -> AutoTuneOptionsStatus -> Bool
$c== :: AutoTuneOptionsStatus -> AutoTuneOptionsStatus -> Bool
Prelude.Eq, ReadPrec [AutoTuneOptionsStatus]
ReadPrec AutoTuneOptionsStatus
Int -> ReadS AutoTuneOptionsStatus
ReadS [AutoTuneOptionsStatus]
(Int -> ReadS AutoTuneOptionsStatus)
-> ReadS [AutoTuneOptionsStatus]
-> ReadPrec AutoTuneOptionsStatus
-> ReadPrec [AutoTuneOptionsStatus]
-> Read AutoTuneOptionsStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoTuneOptionsStatus]
$creadListPrec :: ReadPrec [AutoTuneOptionsStatus]
readPrec :: ReadPrec AutoTuneOptionsStatus
$creadPrec :: ReadPrec AutoTuneOptionsStatus
readList :: ReadS [AutoTuneOptionsStatus]
$creadList :: ReadS [AutoTuneOptionsStatus]
readsPrec :: Int -> ReadS AutoTuneOptionsStatus
$creadsPrec :: Int -> ReadS AutoTuneOptionsStatus
Prelude.Read, Int -> AutoTuneOptionsStatus -> ShowS
[AutoTuneOptionsStatus] -> ShowS
AutoTuneOptionsStatus -> String
(Int -> AutoTuneOptionsStatus -> ShowS)
-> (AutoTuneOptionsStatus -> String)
-> ([AutoTuneOptionsStatus] -> ShowS)
-> Show AutoTuneOptionsStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoTuneOptionsStatus] -> ShowS
$cshowList :: [AutoTuneOptionsStatus] -> ShowS
show :: AutoTuneOptionsStatus -> String
$cshow :: AutoTuneOptionsStatus -> String
showsPrec :: Int -> AutoTuneOptionsStatus -> ShowS
$cshowsPrec :: Int -> AutoTuneOptionsStatus -> ShowS
Prelude.Show, (forall x. AutoTuneOptionsStatus -> Rep AutoTuneOptionsStatus x)
-> (forall x. Rep AutoTuneOptionsStatus x -> AutoTuneOptionsStatus)
-> Generic AutoTuneOptionsStatus
forall x. Rep AutoTuneOptionsStatus x -> AutoTuneOptionsStatus
forall x. AutoTuneOptionsStatus -> Rep AutoTuneOptionsStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoTuneOptionsStatus x -> AutoTuneOptionsStatus
$cfrom :: forall x. AutoTuneOptionsStatus -> Rep AutoTuneOptionsStatus x
Prelude.Generic)

-- |
-- Create a value of 'AutoTuneOptionsStatus' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'autoTuneOptionsStatus_status' - The status of the Auto-Tune options for the domain.
--
-- 'options', 'autoTuneOptionsStatus_options' - Specifies Auto-Tune options for the domain.
newAutoTuneOptionsStatus ::
  AutoTuneOptionsStatus
newAutoTuneOptionsStatus :: AutoTuneOptionsStatus
newAutoTuneOptionsStatus =
  AutoTuneOptionsStatus' :: Maybe AutoTuneStatus
-> Maybe AutoTuneOptions -> AutoTuneOptionsStatus
AutoTuneOptionsStatus'
    { $sel:status:AutoTuneOptionsStatus' :: Maybe AutoTuneStatus
status = Maybe AutoTuneStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:options:AutoTuneOptionsStatus' :: Maybe AutoTuneOptions
options = Maybe AutoTuneOptions
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the Auto-Tune options for the domain.
autoTuneOptionsStatus_status :: Lens.Lens' AutoTuneOptionsStatus (Prelude.Maybe AutoTuneStatus)
autoTuneOptionsStatus_status :: (Maybe AutoTuneStatus -> f (Maybe AutoTuneStatus))
-> AutoTuneOptionsStatus -> f AutoTuneOptionsStatus
autoTuneOptionsStatus_status = (AutoTuneOptionsStatus -> Maybe AutoTuneStatus)
-> (AutoTuneOptionsStatus
    -> Maybe AutoTuneStatus -> AutoTuneOptionsStatus)
-> Lens
     AutoTuneOptionsStatus
     AutoTuneOptionsStatus
     (Maybe AutoTuneStatus)
     (Maybe AutoTuneStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneOptionsStatus' {Maybe AutoTuneStatus
status :: Maybe AutoTuneStatus
$sel:status:AutoTuneOptionsStatus' :: AutoTuneOptionsStatus -> Maybe AutoTuneStatus
status} -> Maybe AutoTuneStatus
status) (\s :: AutoTuneOptionsStatus
s@AutoTuneOptionsStatus' {} Maybe AutoTuneStatus
a -> AutoTuneOptionsStatus
s {$sel:status:AutoTuneOptionsStatus' :: Maybe AutoTuneStatus
status = Maybe AutoTuneStatus
a} :: AutoTuneOptionsStatus)

-- | Specifies Auto-Tune options for the domain.
autoTuneOptionsStatus_options :: Lens.Lens' AutoTuneOptionsStatus (Prelude.Maybe AutoTuneOptions)
autoTuneOptionsStatus_options :: (Maybe AutoTuneOptions -> f (Maybe AutoTuneOptions))
-> AutoTuneOptionsStatus -> f AutoTuneOptionsStatus
autoTuneOptionsStatus_options = (AutoTuneOptionsStatus -> Maybe AutoTuneOptions)
-> (AutoTuneOptionsStatus
    -> Maybe AutoTuneOptions -> AutoTuneOptionsStatus)
-> Lens
     AutoTuneOptionsStatus
     AutoTuneOptionsStatus
     (Maybe AutoTuneOptions)
     (Maybe AutoTuneOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneOptionsStatus' {Maybe AutoTuneOptions
options :: Maybe AutoTuneOptions
$sel:options:AutoTuneOptionsStatus' :: AutoTuneOptionsStatus -> Maybe AutoTuneOptions
options} -> Maybe AutoTuneOptions
options) (\s :: AutoTuneOptionsStatus
s@AutoTuneOptionsStatus' {} Maybe AutoTuneOptions
a -> AutoTuneOptionsStatus
s {$sel:options:AutoTuneOptionsStatus' :: Maybe AutoTuneOptions
options = Maybe AutoTuneOptions
a} :: AutoTuneOptionsStatus)

instance Core.FromJSON AutoTuneOptionsStatus where
  parseJSON :: Value -> Parser AutoTuneOptionsStatus
parseJSON =
    String
-> (Object -> Parser AutoTuneOptionsStatus)
-> Value
-> Parser AutoTuneOptionsStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutoTuneOptionsStatus"
      ( \Object
x ->
          Maybe AutoTuneStatus
-> Maybe AutoTuneOptions -> AutoTuneOptionsStatus
AutoTuneOptionsStatus'
            (Maybe AutoTuneStatus
 -> Maybe AutoTuneOptions -> AutoTuneOptionsStatus)
-> Parser (Maybe AutoTuneStatus)
-> Parser (Maybe AutoTuneOptions -> AutoTuneOptionsStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AutoTuneStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe AutoTuneOptions -> AutoTuneOptionsStatus)
-> Parser (Maybe AutoTuneOptions) -> Parser AutoTuneOptionsStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoTuneOptions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Options")
      )

instance Prelude.Hashable AutoTuneOptionsStatus

instance Prelude.NFData AutoTuneOptionsStatus