{-# 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.ClusterConfigStatus
-- 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.ClusterConfigStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.ClusterConfig
import Amazonka.OpenSearch.Types.OptionStatus
import qualified Amazonka.Prelude as Prelude

-- | The configuration status for the specified domain.
--
-- /See:/ 'newClusterConfigStatus' smart constructor.
data ClusterConfigStatus = ClusterConfigStatus'
  { -- | The cluster configuration for the specified domain.
    ClusterConfigStatus -> ClusterConfig
options :: ClusterConfig,
    -- | The cluster configuration status for the specified domain.
    ClusterConfigStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (ClusterConfigStatus -> ClusterConfigStatus -> Bool
(ClusterConfigStatus -> ClusterConfigStatus -> Bool)
-> (ClusterConfigStatus -> ClusterConfigStatus -> Bool)
-> Eq ClusterConfigStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterConfigStatus -> ClusterConfigStatus -> Bool
$c/= :: ClusterConfigStatus -> ClusterConfigStatus -> Bool
== :: ClusterConfigStatus -> ClusterConfigStatus -> Bool
$c== :: ClusterConfigStatus -> ClusterConfigStatus -> Bool
Prelude.Eq, ReadPrec [ClusterConfigStatus]
ReadPrec ClusterConfigStatus
Int -> ReadS ClusterConfigStatus
ReadS [ClusterConfigStatus]
(Int -> ReadS ClusterConfigStatus)
-> ReadS [ClusterConfigStatus]
-> ReadPrec ClusterConfigStatus
-> ReadPrec [ClusterConfigStatus]
-> Read ClusterConfigStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterConfigStatus]
$creadListPrec :: ReadPrec [ClusterConfigStatus]
readPrec :: ReadPrec ClusterConfigStatus
$creadPrec :: ReadPrec ClusterConfigStatus
readList :: ReadS [ClusterConfigStatus]
$creadList :: ReadS [ClusterConfigStatus]
readsPrec :: Int -> ReadS ClusterConfigStatus
$creadsPrec :: Int -> ReadS ClusterConfigStatus
Prelude.Read, Int -> ClusterConfigStatus -> ShowS
[ClusterConfigStatus] -> ShowS
ClusterConfigStatus -> String
(Int -> ClusterConfigStatus -> ShowS)
-> (ClusterConfigStatus -> String)
-> ([ClusterConfigStatus] -> ShowS)
-> Show ClusterConfigStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterConfigStatus] -> ShowS
$cshowList :: [ClusterConfigStatus] -> ShowS
show :: ClusterConfigStatus -> String
$cshow :: ClusterConfigStatus -> String
showsPrec :: Int -> ClusterConfigStatus -> ShowS
$cshowsPrec :: Int -> ClusterConfigStatus -> ShowS
Prelude.Show, (forall x. ClusterConfigStatus -> Rep ClusterConfigStatus x)
-> (forall x. Rep ClusterConfigStatus x -> ClusterConfigStatus)
-> Generic ClusterConfigStatus
forall x. Rep ClusterConfigStatus x -> ClusterConfigStatus
forall x. ClusterConfigStatus -> Rep ClusterConfigStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterConfigStatus x -> ClusterConfigStatus
$cfrom :: forall x. ClusterConfigStatus -> Rep ClusterConfigStatus x
Prelude.Generic)

-- |
-- Create a value of 'ClusterConfigStatus' 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:
--
-- 'options', 'clusterConfigStatus_options' - The cluster configuration for the specified domain.
--
-- 'status', 'clusterConfigStatus_status' - The cluster configuration status for the specified domain.
newClusterConfigStatus ::
  -- | 'options'
  ClusterConfig ->
  -- | 'status'
  OptionStatus ->
  ClusterConfigStatus
newClusterConfigStatus :: ClusterConfig -> OptionStatus -> ClusterConfigStatus
newClusterConfigStatus ClusterConfig
pOptions_ OptionStatus
pStatus_ =
  ClusterConfigStatus' :: ClusterConfig -> OptionStatus -> ClusterConfigStatus
ClusterConfigStatus'
    { $sel:options:ClusterConfigStatus' :: ClusterConfig
options = ClusterConfig
pOptions_,
      $sel:status:ClusterConfigStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | The cluster configuration for the specified domain.
clusterConfigStatus_options :: Lens.Lens' ClusterConfigStatus ClusterConfig
clusterConfigStatus_options :: (ClusterConfig -> f ClusterConfig)
-> ClusterConfigStatus -> f ClusterConfigStatus
clusterConfigStatus_options = (ClusterConfigStatus -> ClusterConfig)
-> (ClusterConfigStatus -> ClusterConfig -> ClusterConfigStatus)
-> Lens
     ClusterConfigStatus ClusterConfigStatus ClusterConfig ClusterConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfigStatus' {ClusterConfig
options :: ClusterConfig
$sel:options:ClusterConfigStatus' :: ClusterConfigStatus -> ClusterConfig
options} -> ClusterConfig
options) (\s :: ClusterConfigStatus
s@ClusterConfigStatus' {} ClusterConfig
a -> ClusterConfigStatus
s {$sel:options:ClusterConfigStatus' :: ClusterConfig
options = ClusterConfig
a} :: ClusterConfigStatus)

-- | The cluster configuration status for the specified domain.
clusterConfigStatus_status :: Lens.Lens' ClusterConfigStatus OptionStatus
clusterConfigStatus_status :: (OptionStatus -> f OptionStatus)
-> ClusterConfigStatus -> f ClusterConfigStatus
clusterConfigStatus_status = (ClusterConfigStatus -> OptionStatus)
-> (ClusterConfigStatus -> OptionStatus -> ClusterConfigStatus)
-> Lens
     ClusterConfigStatus ClusterConfigStatus OptionStatus OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfigStatus' {OptionStatus
status :: OptionStatus
$sel:status:ClusterConfigStatus' :: ClusterConfigStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: ClusterConfigStatus
s@ClusterConfigStatus' {} OptionStatus
a -> ClusterConfigStatus
s {$sel:status:ClusterConfigStatus' :: OptionStatus
status = OptionStatus
a} :: ClusterConfigStatus)

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

instance Prelude.Hashable ClusterConfigStatus

instance Prelude.NFData ClusterConfigStatus