{-# 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.ElasticsearchClusterConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticSearch.Types.ElasticsearchClusterConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticSearch.Types.ColdStorageOptions
import Amazonka.ElasticSearch.Types.ESPartitionInstanceType
import Amazonka.ElasticSearch.Types.ESWarmPartitionInstanceType
import Amazonka.ElasticSearch.Types.ZoneAwarenessConfig
import qualified Amazonka.Prelude as Prelude

-- | Specifies the configuration for the domain cluster, such as the type and
-- number of instances.
--
-- /See:/ 'newElasticsearchClusterConfig' smart constructor.
data ElasticsearchClusterConfig = ElasticsearchClusterConfig'
  { -- | Specifies the @ColdStorageOptions@ config for Elasticsearch Domain
    ElasticsearchClusterConfig -> Maybe ColdStorageOptions
coldStorageOptions :: Prelude.Maybe ColdStorageOptions,
    -- | Total number of dedicated master nodes, active and on standby, for the
    -- cluster.
    ElasticsearchClusterConfig -> Maybe Int
dedicatedMasterCount :: Prelude.Maybe Prelude.Int,
    -- | A boolean value to indicate whether a dedicated master node is enabled.
    -- See
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-dedicatedmasternodes About Dedicated Master Nodes>
    -- for more information.
    ElasticsearchClusterConfig -> Maybe Bool
dedicatedMasterEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The instance type for a dedicated master node.
    ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
dedicatedMasterType :: Prelude.Maybe ESPartitionInstanceType,
    -- | The number of instances in the specified domain cluster.
    ElasticsearchClusterConfig -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | The instance type for an Elasticsearch cluster. UltraWarm instance types
    -- are not supported for data instances.
    ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
instanceType :: Prelude.Maybe ESPartitionInstanceType,
    -- | The number of warm nodes in the cluster.
    ElasticsearchClusterConfig -> Maybe Int
warmCount :: Prelude.Maybe Prelude.Int,
    -- | True to enable warm storage.
    ElasticsearchClusterConfig -> Maybe Bool
warmEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The instance type for the Elasticsearch cluster\'s warm nodes.
    ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
warmType :: Prelude.Maybe ESWarmPartitionInstanceType,
    -- | Specifies the zone awareness configuration for a domain when zone
    -- awareness is enabled.
    ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig :: Prelude.Maybe ZoneAwarenessConfig,
    -- | A boolean value to indicate whether zone awareness is enabled. See
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness About Zone Awareness>
    -- for more information.
    ElasticsearchClusterConfig -> Maybe Bool
zoneAwarenessEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
$c/= :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
== :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
$c== :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
Prelude.Eq, ReadPrec [ElasticsearchClusterConfig]
ReadPrec ElasticsearchClusterConfig
Int -> ReadS ElasticsearchClusterConfig
ReadS [ElasticsearchClusterConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElasticsearchClusterConfig]
$creadListPrec :: ReadPrec [ElasticsearchClusterConfig]
readPrec :: ReadPrec ElasticsearchClusterConfig
$creadPrec :: ReadPrec ElasticsearchClusterConfig
readList :: ReadS [ElasticsearchClusterConfig]
$creadList :: ReadS [ElasticsearchClusterConfig]
readsPrec :: Int -> ReadS ElasticsearchClusterConfig
$creadsPrec :: Int -> ReadS ElasticsearchClusterConfig
Prelude.Read, Int -> ElasticsearchClusterConfig -> ShowS
[ElasticsearchClusterConfig] -> ShowS
ElasticsearchClusterConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElasticsearchClusterConfig] -> ShowS
$cshowList :: [ElasticsearchClusterConfig] -> ShowS
show :: ElasticsearchClusterConfig -> String
$cshow :: ElasticsearchClusterConfig -> String
showsPrec :: Int -> ElasticsearchClusterConfig -> ShowS
$cshowsPrec :: Int -> ElasticsearchClusterConfig -> ShowS
Prelude.Show, forall x.
Rep ElasticsearchClusterConfig x -> ElasticsearchClusterConfig
forall x.
ElasticsearchClusterConfig -> Rep ElasticsearchClusterConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ElasticsearchClusterConfig x -> ElasticsearchClusterConfig
$cfrom :: forall x.
ElasticsearchClusterConfig -> Rep ElasticsearchClusterConfig x
Prelude.Generic)

-- |
-- Create a value of 'ElasticsearchClusterConfig' 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:
--
-- 'coldStorageOptions', 'elasticsearchClusterConfig_coldStorageOptions' - Specifies the @ColdStorageOptions@ config for Elasticsearch Domain
--
-- 'dedicatedMasterCount', 'elasticsearchClusterConfig_dedicatedMasterCount' - Total number of dedicated master nodes, active and on standby, for the
-- cluster.
--
-- 'dedicatedMasterEnabled', 'elasticsearchClusterConfig_dedicatedMasterEnabled' - A boolean value to indicate whether a dedicated master node is enabled.
-- See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-dedicatedmasternodes About Dedicated Master Nodes>
-- for more information.
--
-- 'dedicatedMasterType', 'elasticsearchClusterConfig_dedicatedMasterType' - The instance type for a dedicated master node.
--
-- 'instanceCount', 'elasticsearchClusterConfig_instanceCount' - The number of instances in the specified domain cluster.
--
-- 'instanceType', 'elasticsearchClusterConfig_instanceType' - The instance type for an Elasticsearch cluster. UltraWarm instance types
-- are not supported for data instances.
--
-- 'warmCount', 'elasticsearchClusterConfig_warmCount' - The number of warm nodes in the cluster.
--
-- 'warmEnabled', 'elasticsearchClusterConfig_warmEnabled' - True to enable warm storage.
--
-- 'warmType', 'elasticsearchClusterConfig_warmType' - The instance type for the Elasticsearch cluster\'s warm nodes.
--
-- 'zoneAwarenessConfig', 'elasticsearchClusterConfig_zoneAwarenessConfig' - Specifies the zone awareness configuration for a domain when zone
-- awareness is enabled.
--
-- 'zoneAwarenessEnabled', 'elasticsearchClusterConfig_zoneAwarenessEnabled' - A boolean value to indicate whether zone awareness is enabled. See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness About Zone Awareness>
-- for more information.
newElasticsearchClusterConfig ::
  ElasticsearchClusterConfig
newElasticsearchClusterConfig :: ElasticsearchClusterConfig
newElasticsearchClusterConfig =
  ElasticsearchClusterConfig'
    { $sel:coldStorageOptions:ElasticsearchClusterConfig' :: Maybe ColdStorageOptions
coldStorageOptions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: Maybe Int
dedicatedMasterCount = forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: Maybe Bool
dedicatedMasterEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
dedicatedMasterType = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceCount:ElasticsearchClusterConfig' :: Maybe Int
instanceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:warmCount:ElasticsearchClusterConfig' :: Maybe Int
warmCount = forall a. Maybe a
Prelude.Nothing,
      $sel:warmEnabled:ElasticsearchClusterConfig' :: Maybe Bool
warmEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:warmType:ElasticsearchClusterConfig' :: Maybe ESWarmPartitionInstanceType
warmType = forall a. Maybe a
Prelude.Nothing,
      $sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: Maybe ZoneAwarenessConfig
zoneAwarenessConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: Maybe Bool
zoneAwarenessEnabled = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the @ColdStorageOptions@ config for Elasticsearch Domain
elasticsearchClusterConfig_coldStorageOptions :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ColdStorageOptions)
elasticsearchClusterConfig_coldStorageOptions :: Lens' ElasticsearchClusterConfig (Maybe ColdStorageOptions)
elasticsearchClusterConfig_coldStorageOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ColdStorageOptions
coldStorageOptions :: Maybe ColdStorageOptions
$sel:coldStorageOptions:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ColdStorageOptions
coldStorageOptions} -> Maybe ColdStorageOptions
coldStorageOptions) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ColdStorageOptions
a -> ElasticsearchClusterConfig
s {$sel:coldStorageOptions:ElasticsearchClusterConfig' :: Maybe ColdStorageOptions
coldStorageOptions = Maybe ColdStorageOptions
a} :: ElasticsearchClusterConfig)

-- | Total number of dedicated master nodes, active and on standby, for the
-- cluster.
elasticsearchClusterConfig_dedicatedMasterCount :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Int)
elasticsearchClusterConfig_dedicatedMasterCount :: Lens' ElasticsearchClusterConfig (Maybe Int)
elasticsearchClusterConfig_dedicatedMasterCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Int
dedicatedMasterCount :: Maybe Int
$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
dedicatedMasterCount} -> Maybe Int
dedicatedMasterCount) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Int
a -> ElasticsearchClusterConfig
s {$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: Maybe Int
dedicatedMasterCount = Maybe Int
a} :: ElasticsearchClusterConfig)

-- | A boolean value to indicate whether a dedicated master node is enabled.
-- See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-dedicatedmasternodes About Dedicated Master Nodes>
-- for more information.
elasticsearchClusterConfig_dedicatedMasterEnabled :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Bool)
elasticsearchClusterConfig_dedicatedMasterEnabled :: Lens' ElasticsearchClusterConfig (Maybe Bool)
elasticsearchClusterConfig_dedicatedMasterEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Bool
dedicatedMasterEnabled :: Maybe Bool
$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
dedicatedMasterEnabled} -> Maybe Bool
dedicatedMasterEnabled) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Bool
a -> ElasticsearchClusterConfig
s {$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: Maybe Bool
dedicatedMasterEnabled = Maybe Bool
a} :: ElasticsearchClusterConfig)

-- | The instance type for a dedicated master node.
elasticsearchClusterConfig_dedicatedMasterType :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ESPartitionInstanceType)
elasticsearchClusterConfig_dedicatedMasterType :: Lens' ElasticsearchClusterConfig (Maybe ESPartitionInstanceType)
elasticsearchClusterConfig_dedicatedMasterType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ESPartitionInstanceType
dedicatedMasterType :: Maybe ESPartitionInstanceType
$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
dedicatedMasterType} -> Maybe ESPartitionInstanceType
dedicatedMasterType) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ESPartitionInstanceType
a -> ElasticsearchClusterConfig
s {$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
dedicatedMasterType = Maybe ESPartitionInstanceType
a} :: ElasticsearchClusterConfig)

-- | The number of instances in the specified domain cluster.
elasticsearchClusterConfig_instanceCount :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Int)
elasticsearchClusterConfig_instanceCount :: Lens' ElasticsearchClusterConfig (Maybe Int)
elasticsearchClusterConfig_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Int
a -> ElasticsearchClusterConfig
s {$sel:instanceCount:ElasticsearchClusterConfig' :: Maybe Int
instanceCount = Maybe Int
a} :: ElasticsearchClusterConfig)

-- | The instance type for an Elasticsearch cluster. UltraWarm instance types
-- are not supported for data instances.
elasticsearchClusterConfig_instanceType :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ESPartitionInstanceType)
elasticsearchClusterConfig_instanceType :: Lens' ElasticsearchClusterConfig (Maybe ESPartitionInstanceType)
elasticsearchClusterConfig_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ESPartitionInstanceType
instanceType :: Maybe ESPartitionInstanceType
$sel:instanceType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
instanceType} -> Maybe ESPartitionInstanceType
instanceType) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ESPartitionInstanceType
a -> ElasticsearchClusterConfig
s {$sel:instanceType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
instanceType = Maybe ESPartitionInstanceType
a} :: ElasticsearchClusterConfig)

-- | The number of warm nodes in the cluster.
elasticsearchClusterConfig_warmCount :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Int)
elasticsearchClusterConfig_warmCount :: Lens' ElasticsearchClusterConfig (Maybe Int)
elasticsearchClusterConfig_warmCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Int
warmCount :: Maybe Int
$sel:warmCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
warmCount} -> Maybe Int
warmCount) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Int
a -> ElasticsearchClusterConfig
s {$sel:warmCount:ElasticsearchClusterConfig' :: Maybe Int
warmCount = Maybe Int
a} :: ElasticsearchClusterConfig)

-- | True to enable warm storage.
elasticsearchClusterConfig_warmEnabled :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Bool)
elasticsearchClusterConfig_warmEnabled :: Lens' ElasticsearchClusterConfig (Maybe Bool)
elasticsearchClusterConfig_warmEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Bool
warmEnabled :: Maybe Bool
$sel:warmEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
warmEnabled} -> Maybe Bool
warmEnabled) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Bool
a -> ElasticsearchClusterConfig
s {$sel:warmEnabled:ElasticsearchClusterConfig' :: Maybe Bool
warmEnabled = Maybe Bool
a} :: ElasticsearchClusterConfig)

-- | The instance type for the Elasticsearch cluster\'s warm nodes.
elasticsearchClusterConfig_warmType :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ESWarmPartitionInstanceType)
elasticsearchClusterConfig_warmType :: Lens'
  ElasticsearchClusterConfig (Maybe ESWarmPartitionInstanceType)
elasticsearchClusterConfig_warmType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ESWarmPartitionInstanceType
warmType :: Maybe ESWarmPartitionInstanceType
$sel:warmType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
warmType} -> Maybe ESWarmPartitionInstanceType
warmType) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ESWarmPartitionInstanceType
a -> ElasticsearchClusterConfig
s {$sel:warmType:ElasticsearchClusterConfig' :: Maybe ESWarmPartitionInstanceType
warmType = Maybe ESWarmPartitionInstanceType
a} :: ElasticsearchClusterConfig)

-- | Specifies the zone awareness configuration for a domain when zone
-- awareness is enabled.
elasticsearchClusterConfig_zoneAwarenessConfig :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ZoneAwarenessConfig)
elasticsearchClusterConfig_zoneAwarenessConfig :: Lens' ElasticsearchClusterConfig (Maybe ZoneAwarenessConfig)
elasticsearchClusterConfig_zoneAwarenessConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ZoneAwarenessConfig
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig} -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ZoneAwarenessConfig
a -> ElasticsearchClusterConfig
s {$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: Maybe ZoneAwarenessConfig
zoneAwarenessConfig = Maybe ZoneAwarenessConfig
a} :: ElasticsearchClusterConfig)

-- | A boolean value to indicate whether zone awareness is enabled. See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness About Zone Awareness>
-- for more information.
elasticsearchClusterConfig_zoneAwarenessEnabled :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Bool)
elasticsearchClusterConfig_zoneAwarenessEnabled :: Lens' ElasticsearchClusterConfig (Maybe Bool)
elasticsearchClusterConfig_zoneAwarenessEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Bool
zoneAwarenessEnabled :: Maybe Bool
$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
zoneAwarenessEnabled} -> Maybe Bool
zoneAwarenessEnabled) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Bool
a -> ElasticsearchClusterConfig
s {$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: Maybe Bool
zoneAwarenessEnabled = Maybe Bool
a} :: ElasticsearchClusterConfig)

instance Data.FromJSON ElasticsearchClusterConfig where
  parseJSON :: Value -> Parser ElasticsearchClusterConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ElasticsearchClusterConfig"
      ( \Object
x ->
          Maybe ColdStorageOptions
-> Maybe Int
-> Maybe Bool
-> Maybe ESPartitionInstanceType
-> Maybe Int
-> Maybe ESPartitionInstanceType
-> Maybe Int
-> Maybe Bool
-> Maybe ESWarmPartitionInstanceType
-> Maybe ZoneAwarenessConfig
-> Maybe Bool
-> ElasticsearchClusterConfig
ElasticsearchClusterConfig'
            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
"ColdStorageOptions")
            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
"DedicatedMasterCount")
            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
"DedicatedMasterEnabled")
            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
"DedicatedMasterType")
            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
"InstanceCount")
            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
"InstanceType")
            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
"WarmCount")
            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
"WarmEnabled")
            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
"WarmType")
            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
"ZoneAwarenessConfig")
            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
"ZoneAwarenessEnabled")
      )

instance Prelude.Hashable ElasticsearchClusterConfig where
  hashWithSalt :: Int -> ElasticsearchClusterConfig -> Int
hashWithSalt Int
_salt ElasticsearchClusterConfig' {Maybe Bool
Maybe Int
Maybe ColdStorageOptions
Maybe ESPartitionInstanceType
Maybe ESWarmPartitionInstanceType
Maybe ZoneAwarenessConfig
zoneAwarenessEnabled :: Maybe Bool
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
warmType :: Maybe ESWarmPartitionInstanceType
warmEnabled :: Maybe Bool
warmCount :: Maybe Int
instanceType :: Maybe ESPartitionInstanceType
instanceCount :: Maybe Int
dedicatedMasterType :: Maybe ESPartitionInstanceType
dedicatedMasterEnabled :: Maybe Bool
dedicatedMasterCount :: Maybe Int
coldStorageOptions :: Maybe ColdStorageOptions
$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
$sel:warmType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
$sel:warmEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:warmCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:instanceType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:instanceCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:coldStorageOptions:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ColdStorageOptions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ColdStorageOptions
coldStorageOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
dedicatedMasterCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dedicatedMasterEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ESPartitionInstanceType
dedicatedMasterType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instanceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ESPartitionInstanceType
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
warmCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
warmEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ESWarmPartitionInstanceType
warmType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ZoneAwarenessConfig
zoneAwarenessConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
zoneAwarenessEnabled

instance Prelude.NFData ElasticsearchClusterConfig where
  rnf :: ElasticsearchClusterConfig -> ()
rnf ElasticsearchClusterConfig' {Maybe Bool
Maybe Int
Maybe ColdStorageOptions
Maybe ESPartitionInstanceType
Maybe ESWarmPartitionInstanceType
Maybe ZoneAwarenessConfig
zoneAwarenessEnabled :: Maybe Bool
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
warmType :: Maybe ESWarmPartitionInstanceType
warmEnabled :: Maybe Bool
warmCount :: Maybe Int
instanceType :: Maybe ESPartitionInstanceType
instanceCount :: Maybe Int
dedicatedMasterType :: Maybe ESPartitionInstanceType
dedicatedMasterEnabled :: Maybe Bool
dedicatedMasterCount :: Maybe Int
coldStorageOptions :: Maybe ColdStorageOptions
$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
$sel:warmType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
$sel:warmEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:warmCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:instanceType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:instanceCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:coldStorageOptions:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ColdStorageOptions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ColdStorageOptions
coldStorageOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
dedicatedMasterCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dedicatedMasterEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ESPartitionInstanceType
dedicatedMasterType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
instanceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ESPartitionInstanceType
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
warmCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
warmEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ESWarmPartitionInstanceType
warmType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ZoneAwarenessConfig
zoneAwarenessConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
zoneAwarenessEnabled

instance Data.ToJSON ElasticsearchClusterConfig where
  toJSON :: ElasticsearchClusterConfig -> Value
toJSON ElasticsearchClusterConfig' {Maybe Bool
Maybe Int
Maybe ColdStorageOptions
Maybe ESPartitionInstanceType
Maybe ESWarmPartitionInstanceType
Maybe ZoneAwarenessConfig
zoneAwarenessEnabled :: Maybe Bool
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
warmType :: Maybe ESWarmPartitionInstanceType
warmEnabled :: Maybe Bool
warmCount :: Maybe Int
instanceType :: Maybe ESPartitionInstanceType
instanceCount :: Maybe Int
dedicatedMasterType :: Maybe ESPartitionInstanceType
dedicatedMasterEnabled :: Maybe Bool
dedicatedMasterCount :: Maybe Int
coldStorageOptions :: Maybe ColdStorageOptions
$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
$sel:warmType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
$sel:warmEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:warmCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:instanceType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:instanceCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:coldStorageOptions:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ColdStorageOptions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ColdStorageOptions" 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 ColdStorageOptions
coldStorageOptions,
            (Key
"DedicatedMasterCount" 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 Int
dedicatedMasterCount,
            (Key
"DedicatedMasterEnabled" 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 Bool
dedicatedMasterEnabled,
            (Key
"DedicatedMasterType" 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 ESPartitionInstanceType
dedicatedMasterType,
            (Key
"InstanceCount" 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 Int
instanceCount,
            (Key
"InstanceType" 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 ESPartitionInstanceType
instanceType,
            (Key
"WarmCount" 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 Int
warmCount,
            (Key
"WarmEnabled" 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 Bool
warmEnabled,
            (Key
"WarmType" 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 ESWarmPartitionInstanceType
warmType,
            (Key
"ZoneAwarenessConfig" 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 ZoneAwarenessConfig
zoneAwarenessConfig,
            (Key
"ZoneAwarenessEnabled" 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 Bool
zoneAwarenessEnabled
          ]
      )