{-# 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.ElasticSearch.Types.ElasticsearchClusterConfigStatus
-- 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.ElasticSearch.Types.ElasticsearchClusterConfigStatus where

import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types.ElasticsearchClusterConfig
import Amazonka.ElasticSearch.Types.OptionStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'ElasticsearchClusterConfigStatus' 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', 'elasticsearchClusterConfigStatus_options' - Specifies the cluster configuration for the specified Elasticsearch
-- domain.
--
-- 'status', 'elasticsearchClusterConfigStatus_status' - Specifies the status of the configuration for the specified
-- Elasticsearch domain.
newElasticsearchClusterConfigStatus ::
  -- | 'options'
  ElasticsearchClusterConfig ->
  -- | 'status'
  OptionStatus ->
  ElasticsearchClusterConfigStatus
newElasticsearchClusterConfigStatus :: ElasticsearchClusterConfig
-> OptionStatus -> ElasticsearchClusterConfigStatus
newElasticsearchClusterConfigStatus
  ElasticsearchClusterConfig
pOptions_
  OptionStatus
pStatus_ =
    ElasticsearchClusterConfigStatus' :: ElasticsearchClusterConfig
-> OptionStatus -> ElasticsearchClusterConfigStatus
ElasticsearchClusterConfigStatus'
      { $sel:options:ElasticsearchClusterConfigStatus' :: ElasticsearchClusterConfig
options =
          ElasticsearchClusterConfig
pOptions_,
        $sel:status:ElasticsearchClusterConfigStatus' :: OptionStatus
status = OptionStatus
pStatus_
      }

-- | Specifies the cluster configuration for the specified Elasticsearch
-- domain.
elasticsearchClusterConfigStatus_options :: Lens.Lens' ElasticsearchClusterConfigStatus ElasticsearchClusterConfig
elasticsearchClusterConfigStatus_options :: (ElasticsearchClusterConfig -> f ElasticsearchClusterConfig)
-> ElasticsearchClusterConfigStatus
-> f ElasticsearchClusterConfigStatus
elasticsearchClusterConfigStatus_options = (ElasticsearchClusterConfigStatus -> ElasticsearchClusterConfig)
-> (ElasticsearchClusterConfigStatus
    -> ElasticsearchClusterConfig -> ElasticsearchClusterConfigStatus)
-> Lens
     ElasticsearchClusterConfigStatus
     ElasticsearchClusterConfigStatus
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfigStatus' {ElasticsearchClusterConfig
options :: ElasticsearchClusterConfig
$sel:options:ElasticsearchClusterConfigStatus' :: ElasticsearchClusterConfigStatus -> ElasticsearchClusterConfig
options} -> ElasticsearchClusterConfig
options) (\s :: ElasticsearchClusterConfigStatus
s@ElasticsearchClusterConfigStatus' {} ElasticsearchClusterConfig
a -> ElasticsearchClusterConfigStatus
s {$sel:options:ElasticsearchClusterConfigStatus' :: ElasticsearchClusterConfig
options = ElasticsearchClusterConfig
a} :: ElasticsearchClusterConfigStatus)

-- | Specifies the status of the configuration for the specified
-- Elasticsearch domain.
elasticsearchClusterConfigStatus_status :: Lens.Lens' ElasticsearchClusterConfigStatus OptionStatus
elasticsearchClusterConfigStatus_status :: (OptionStatus -> f OptionStatus)
-> ElasticsearchClusterConfigStatus
-> f ElasticsearchClusterConfigStatus
elasticsearchClusterConfigStatus_status = (ElasticsearchClusterConfigStatus -> OptionStatus)
-> (ElasticsearchClusterConfigStatus
    -> OptionStatus -> ElasticsearchClusterConfigStatus)
-> Lens
     ElasticsearchClusterConfigStatus
     ElasticsearchClusterConfigStatus
     OptionStatus
     OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfigStatus' {OptionStatus
status :: OptionStatus
$sel:status:ElasticsearchClusterConfigStatus' :: ElasticsearchClusterConfigStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: ElasticsearchClusterConfigStatus
s@ElasticsearchClusterConfigStatus' {} OptionStatus
a -> ElasticsearchClusterConfigStatus
s {$sel:status:ElasticsearchClusterConfigStatus' :: OptionStatus
status = OptionStatus
a} :: ElasticsearchClusterConfigStatus)

instance
  Core.FromJSON
    ElasticsearchClusterConfigStatus
  where
  parseJSON :: Value -> Parser ElasticsearchClusterConfigStatus
parseJSON =
    String
-> (Object -> Parser ElasticsearchClusterConfigStatus)
-> Value
-> Parser ElasticsearchClusterConfigStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ElasticsearchClusterConfigStatus"
      ( \Object
x ->
          ElasticsearchClusterConfig
-> OptionStatus -> ElasticsearchClusterConfigStatus
ElasticsearchClusterConfigStatus'
            (ElasticsearchClusterConfig
 -> OptionStatus -> ElasticsearchClusterConfigStatus)
-> Parser ElasticsearchClusterConfig
-> Parser (OptionStatus -> ElasticsearchClusterConfigStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser ElasticsearchClusterConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Options")
            Parser (OptionStatus -> ElasticsearchClusterConfigStatus)
-> Parser OptionStatus -> Parser ElasticsearchClusterConfigStatus
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
    ElasticsearchClusterConfigStatus

instance
  Prelude.NFData
    ElasticsearchClusterConfigStatus