{-# 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.ClusterConfig
-- 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.OpenSearch.Types.ClusterConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearch.Types.ColdStorageOptions
import Amazonka.OpenSearch.Types.OpenSearchPartitionInstanceType
import Amazonka.OpenSearch.Types.OpenSearchWarmPartitionInstanceType
import Amazonka.OpenSearch.Types.ZoneAwarenessConfig
import qualified Amazonka.Prelude as Prelude

-- | Container for the cluster configuration of an OpenSearch Service domain.
-- For more information, see
-- <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html Creating and managing Amazon OpenSearch Service domains>.
--
-- /See:/ 'newClusterConfig' smart constructor.
data ClusterConfig = ClusterConfig'
  { -- | Container for cold storage configuration options.
    ClusterConfig -> Maybe ColdStorageOptions
coldStorageOptions :: Prelude.Maybe ColdStorageOptions,
    -- | Number of dedicated master nodes in the cluster. This number must be
    -- greater than 1, otherwise you receive a validation exception.
    ClusterConfig -> Maybe Int
dedicatedMasterCount :: Prelude.Maybe Prelude.Int,
    -- | Indicates whether dedicated master nodes are enabled for the
    -- cluster.@True@ if the cluster will use a dedicated master node.@False@
    -- if the cluster will not.
    ClusterConfig -> Maybe Bool
dedicatedMasterEnabled :: Prelude.Maybe Prelude.Bool,
    -- | OpenSearch Service instance type of the dedicated master nodes in the
    -- cluster.
    ClusterConfig -> Maybe OpenSearchPartitionInstanceType
dedicatedMasterType :: Prelude.Maybe OpenSearchPartitionInstanceType,
    -- | Number of dedicated master nodes in the cluster. This number must be
    -- greater than 1, otherwise you receive a validation exception.
    ClusterConfig -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | Instance type of data nodes in the cluster.
    ClusterConfig -> Maybe OpenSearchPartitionInstanceType
instanceType :: Prelude.Maybe OpenSearchPartitionInstanceType,
    -- | The number of warm nodes in the cluster.
    ClusterConfig -> Maybe Int
warmCount :: Prelude.Maybe Prelude.Int,
    -- | Whether to enable warm storage for the cluster.
    ClusterConfig -> Maybe Bool
warmEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The instance type for the cluster\'s warm nodes.
    ClusterConfig -> Maybe OpenSearchWarmPartitionInstanceType
warmType :: Prelude.Maybe OpenSearchWarmPartitionInstanceType,
    -- | Container for zone awareness configuration options. Only required if
    -- @ZoneAwarenessEnabled@ is @true@.
    ClusterConfig -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig :: Prelude.Maybe ZoneAwarenessConfig,
    -- | Indicates whether multiple Availability Zones are enabled. For more
    -- information, see
    -- <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html Configuring a multi-AZ domain in Amazon OpenSearch Service>.
    ClusterConfig -> Maybe Bool
zoneAwarenessEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (ClusterConfig -> ClusterConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterConfig -> ClusterConfig -> Bool
$c/= :: ClusterConfig -> ClusterConfig -> Bool
== :: ClusterConfig -> ClusterConfig -> Bool
$c== :: ClusterConfig -> ClusterConfig -> Bool
Prelude.Eq, ReadPrec [ClusterConfig]
ReadPrec ClusterConfig
Int -> ReadS ClusterConfig
ReadS [ClusterConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterConfig]
$creadListPrec :: ReadPrec [ClusterConfig]
readPrec :: ReadPrec ClusterConfig
$creadPrec :: ReadPrec ClusterConfig
readList :: ReadS [ClusterConfig]
$creadList :: ReadS [ClusterConfig]
readsPrec :: Int -> ReadS ClusterConfig
$creadsPrec :: Int -> ReadS ClusterConfig
Prelude.Read, Int -> ClusterConfig -> ShowS
[ClusterConfig] -> ShowS
ClusterConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterConfig] -> ShowS
$cshowList :: [ClusterConfig] -> ShowS
show :: ClusterConfig -> String
$cshow :: ClusterConfig -> String
showsPrec :: Int -> ClusterConfig -> ShowS
$cshowsPrec :: Int -> ClusterConfig -> ShowS
Prelude.Show, forall x. Rep ClusterConfig x -> ClusterConfig
forall x. ClusterConfig -> Rep ClusterConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterConfig x -> ClusterConfig
$cfrom :: forall x. ClusterConfig -> Rep ClusterConfig x
Prelude.Generic)

-- |
-- Create a value of 'ClusterConfig' 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', 'clusterConfig_coldStorageOptions' - Container for cold storage configuration options.
--
-- 'dedicatedMasterCount', 'clusterConfig_dedicatedMasterCount' - Number of dedicated master nodes in the cluster. This number must be
-- greater than 1, otherwise you receive a validation exception.
--
-- 'dedicatedMasterEnabled', 'clusterConfig_dedicatedMasterEnabled' - Indicates whether dedicated master nodes are enabled for the
-- cluster.@True@ if the cluster will use a dedicated master node.@False@
-- if the cluster will not.
--
-- 'dedicatedMasterType', 'clusterConfig_dedicatedMasterType' - OpenSearch Service instance type of the dedicated master nodes in the
-- cluster.
--
-- 'instanceCount', 'clusterConfig_instanceCount' - Number of dedicated master nodes in the cluster. This number must be
-- greater than 1, otherwise you receive a validation exception.
--
-- 'instanceType', 'clusterConfig_instanceType' - Instance type of data nodes in the cluster.
--
-- 'warmCount', 'clusterConfig_warmCount' - The number of warm nodes in the cluster.
--
-- 'warmEnabled', 'clusterConfig_warmEnabled' - Whether to enable warm storage for the cluster.
--
-- 'warmType', 'clusterConfig_warmType' - The instance type for the cluster\'s warm nodes.
--
-- 'zoneAwarenessConfig', 'clusterConfig_zoneAwarenessConfig' - Container for zone awareness configuration options. Only required if
-- @ZoneAwarenessEnabled@ is @true@.
--
-- 'zoneAwarenessEnabled', 'clusterConfig_zoneAwarenessEnabled' - Indicates whether multiple Availability Zones are enabled. For more
-- information, see
-- <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html Configuring a multi-AZ domain in Amazon OpenSearch Service>.
newClusterConfig ::
  ClusterConfig
newClusterConfig :: ClusterConfig
newClusterConfig =
  ClusterConfig'
    { $sel:coldStorageOptions:ClusterConfig' :: Maybe ColdStorageOptions
coldStorageOptions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterCount:ClusterConfig' :: Maybe Int
dedicatedMasterCount = forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterEnabled:ClusterConfig' :: Maybe Bool
dedicatedMasterEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterType:ClusterConfig' :: Maybe OpenSearchPartitionInstanceType
dedicatedMasterType = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceCount:ClusterConfig' :: Maybe Int
instanceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ClusterConfig' :: Maybe OpenSearchPartitionInstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:warmCount:ClusterConfig' :: Maybe Int
warmCount = forall a. Maybe a
Prelude.Nothing,
      $sel:warmEnabled:ClusterConfig' :: Maybe Bool
warmEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:warmType:ClusterConfig' :: Maybe OpenSearchWarmPartitionInstanceType
warmType = forall a. Maybe a
Prelude.Nothing,
      $sel:zoneAwarenessConfig:ClusterConfig' :: Maybe ZoneAwarenessConfig
zoneAwarenessConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:zoneAwarenessEnabled:ClusterConfig' :: Maybe Bool
zoneAwarenessEnabled = forall a. Maybe a
Prelude.Nothing
    }

-- | Container for cold storage configuration options.
clusterConfig_coldStorageOptions :: Lens.Lens' ClusterConfig (Prelude.Maybe ColdStorageOptions)
clusterConfig_coldStorageOptions :: Lens' ClusterConfig (Maybe ColdStorageOptions)
clusterConfig_coldStorageOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe ColdStorageOptions
coldStorageOptions :: Maybe ColdStorageOptions
$sel:coldStorageOptions:ClusterConfig' :: ClusterConfig -> Maybe ColdStorageOptions
coldStorageOptions} -> Maybe ColdStorageOptions
coldStorageOptions) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe ColdStorageOptions
a -> ClusterConfig
s {$sel:coldStorageOptions:ClusterConfig' :: Maybe ColdStorageOptions
coldStorageOptions = Maybe ColdStorageOptions
a} :: ClusterConfig)

-- | Number of dedicated master nodes in the cluster. This number must be
-- greater than 1, otherwise you receive a validation exception.
clusterConfig_dedicatedMasterCount :: Lens.Lens' ClusterConfig (Prelude.Maybe Prelude.Int)
clusterConfig_dedicatedMasterCount :: Lens' ClusterConfig (Maybe Int)
clusterConfig_dedicatedMasterCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe Int
dedicatedMasterCount :: Maybe Int
$sel:dedicatedMasterCount:ClusterConfig' :: ClusterConfig -> Maybe Int
dedicatedMasterCount} -> Maybe Int
dedicatedMasterCount) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe Int
a -> ClusterConfig
s {$sel:dedicatedMasterCount:ClusterConfig' :: Maybe Int
dedicatedMasterCount = Maybe Int
a} :: ClusterConfig)

-- | Indicates whether dedicated master nodes are enabled for the
-- cluster.@True@ if the cluster will use a dedicated master node.@False@
-- if the cluster will not.
clusterConfig_dedicatedMasterEnabled :: Lens.Lens' ClusterConfig (Prelude.Maybe Prelude.Bool)
clusterConfig_dedicatedMasterEnabled :: Lens' ClusterConfig (Maybe Bool)
clusterConfig_dedicatedMasterEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe Bool
dedicatedMasterEnabled :: Maybe Bool
$sel:dedicatedMasterEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
dedicatedMasterEnabled} -> Maybe Bool
dedicatedMasterEnabled) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe Bool
a -> ClusterConfig
s {$sel:dedicatedMasterEnabled:ClusterConfig' :: Maybe Bool
dedicatedMasterEnabled = Maybe Bool
a} :: ClusterConfig)

-- | OpenSearch Service instance type of the dedicated master nodes in the
-- cluster.
clusterConfig_dedicatedMasterType :: Lens.Lens' ClusterConfig (Prelude.Maybe OpenSearchPartitionInstanceType)
clusterConfig_dedicatedMasterType :: Lens' ClusterConfig (Maybe OpenSearchPartitionInstanceType)
clusterConfig_dedicatedMasterType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe OpenSearchPartitionInstanceType
dedicatedMasterType :: Maybe OpenSearchPartitionInstanceType
$sel:dedicatedMasterType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
dedicatedMasterType} -> Maybe OpenSearchPartitionInstanceType
dedicatedMasterType) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe OpenSearchPartitionInstanceType
a -> ClusterConfig
s {$sel:dedicatedMasterType:ClusterConfig' :: Maybe OpenSearchPartitionInstanceType
dedicatedMasterType = Maybe OpenSearchPartitionInstanceType
a} :: ClusterConfig)

-- | Number of dedicated master nodes in the cluster. This number must be
-- greater than 1, otherwise you receive a validation exception.
clusterConfig_instanceCount :: Lens.Lens' ClusterConfig (Prelude.Maybe Prelude.Int)
clusterConfig_instanceCount :: Lens' ClusterConfig (Maybe Int)
clusterConfig_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ClusterConfig' :: ClusterConfig -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe Int
a -> ClusterConfig
s {$sel:instanceCount:ClusterConfig' :: Maybe Int
instanceCount = Maybe Int
a} :: ClusterConfig)

-- | Instance type of data nodes in the cluster.
clusterConfig_instanceType :: Lens.Lens' ClusterConfig (Prelude.Maybe OpenSearchPartitionInstanceType)
clusterConfig_instanceType :: Lens' ClusterConfig (Maybe OpenSearchPartitionInstanceType)
clusterConfig_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe OpenSearchPartitionInstanceType
instanceType :: Maybe OpenSearchPartitionInstanceType
$sel:instanceType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
instanceType} -> Maybe OpenSearchPartitionInstanceType
instanceType) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe OpenSearchPartitionInstanceType
a -> ClusterConfig
s {$sel:instanceType:ClusterConfig' :: Maybe OpenSearchPartitionInstanceType
instanceType = Maybe OpenSearchPartitionInstanceType
a} :: ClusterConfig)

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

-- | Whether to enable warm storage for the cluster.
clusterConfig_warmEnabled :: Lens.Lens' ClusterConfig (Prelude.Maybe Prelude.Bool)
clusterConfig_warmEnabled :: Lens' ClusterConfig (Maybe Bool)
clusterConfig_warmEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe Bool
warmEnabled :: Maybe Bool
$sel:warmEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
warmEnabled} -> Maybe Bool
warmEnabled) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe Bool
a -> ClusterConfig
s {$sel:warmEnabled:ClusterConfig' :: Maybe Bool
warmEnabled = Maybe Bool
a} :: ClusterConfig)

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

-- | Container for zone awareness configuration options. Only required if
-- @ZoneAwarenessEnabled@ is @true@.
clusterConfig_zoneAwarenessConfig :: Lens.Lens' ClusterConfig (Prelude.Maybe ZoneAwarenessConfig)
clusterConfig_zoneAwarenessConfig :: Lens' ClusterConfig (Maybe ZoneAwarenessConfig)
clusterConfig_zoneAwarenessConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe ZoneAwarenessConfig
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
$sel:zoneAwarenessConfig:ClusterConfig' :: ClusterConfig -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig} -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe ZoneAwarenessConfig
a -> ClusterConfig
s {$sel:zoneAwarenessConfig:ClusterConfig' :: Maybe ZoneAwarenessConfig
zoneAwarenessConfig = Maybe ZoneAwarenessConfig
a} :: ClusterConfig)

-- | Indicates whether multiple Availability Zones are enabled. For more
-- information, see
-- <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html Configuring a multi-AZ domain in Amazon OpenSearch Service>.
clusterConfig_zoneAwarenessEnabled :: Lens.Lens' ClusterConfig (Prelude.Maybe Prelude.Bool)
clusterConfig_zoneAwarenessEnabled :: Lens' ClusterConfig (Maybe Bool)
clusterConfig_zoneAwarenessEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfig' {Maybe Bool
zoneAwarenessEnabled :: Maybe Bool
$sel:zoneAwarenessEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
zoneAwarenessEnabled} -> Maybe Bool
zoneAwarenessEnabled) (\s :: ClusterConfig
s@ClusterConfig' {} Maybe Bool
a -> ClusterConfig
s {$sel:zoneAwarenessEnabled:ClusterConfig' :: Maybe Bool
zoneAwarenessEnabled = Maybe Bool
a} :: ClusterConfig)

instance Data.FromJSON ClusterConfig where
  parseJSON :: Value -> Parser ClusterConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ClusterConfig"
      ( \Object
x ->
          Maybe ColdStorageOptions
-> Maybe Int
-> Maybe Bool
-> Maybe OpenSearchPartitionInstanceType
-> Maybe Int
-> Maybe OpenSearchPartitionInstanceType
-> Maybe Int
-> Maybe Bool
-> Maybe OpenSearchWarmPartitionInstanceType
-> Maybe ZoneAwarenessConfig
-> Maybe Bool
-> ClusterConfig
ClusterConfig'
            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 ClusterConfig where
  hashWithSalt :: Int -> ClusterConfig -> Int
hashWithSalt Int
_salt ClusterConfig' {Maybe Bool
Maybe Int
Maybe ColdStorageOptions
Maybe OpenSearchPartitionInstanceType
Maybe OpenSearchWarmPartitionInstanceType
Maybe ZoneAwarenessConfig
zoneAwarenessEnabled :: Maybe Bool
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
warmType :: Maybe OpenSearchWarmPartitionInstanceType
warmEnabled :: Maybe Bool
warmCount :: Maybe Int
instanceType :: Maybe OpenSearchPartitionInstanceType
instanceCount :: Maybe Int
dedicatedMasterType :: Maybe OpenSearchPartitionInstanceType
dedicatedMasterEnabled :: Maybe Bool
dedicatedMasterCount :: Maybe Int
coldStorageOptions :: Maybe ColdStorageOptions
$sel:zoneAwarenessEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:zoneAwarenessConfig:ClusterConfig' :: ClusterConfig -> Maybe ZoneAwarenessConfig
$sel:warmType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchWarmPartitionInstanceType
$sel:warmEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:warmCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:instanceType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
$sel:instanceCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:dedicatedMasterType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
$sel:dedicatedMasterEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:dedicatedMasterCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:coldStorageOptions:ClusterConfig' :: ClusterConfig -> 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 OpenSearchPartitionInstanceType
dedicatedMasterType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instanceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OpenSearchPartitionInstanceType
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 OpenSearchWarmPartitionInstanceType
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 ClusterConfig where
  rnf :: ClusterConfig -> ()
rnf ClusterConfig' {Maybe Bool
Maybe Int
Maybe ColdStorageOptions
Maybe OpenSearchPartitionInstanceType
Maybe OpenSearchWarmPartitionInstanceType
Maybe ZoneAwarenessConfig
zoneAwarenessEnabled :: Maybe Bool
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
warmType :: Maybe OpenSearchWarmPartitionInstanceType
warmEnabled :: Maybe Bool
warmCount :: Maybe Int
instanceType :: Maybe OpenSearchPartitionInstanceType
instanceCount :: Maybe Int
dedicatedMasterType :: Maybe OpenSearchPartitionInstanceType
dedicatedMasterEnabled :: Maybe Bool
dedicatedMasterCount :: Maybe Int
coldStorageOptions :: Maybe ColdStorageOptions
$sel:zoneAwarenessEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:zoneAwarenessConfig:ClusterConfig' :: ClusterConfig -> Maybe ZoneAwarenessConfig
$sel:warmType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchWarmPartitionInstanceType
$sel:warmEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:warmCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:instanceType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
$sel:instanceCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:dedicatedMasterType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
$sel:dedicatedMasterEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:dedicatedMasterCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:coldStorageOptions:ClusterConfig' :: ClusterConfig -> 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 OpenSearchPartitionInstanceType
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 OpenSearchPartitionInstanceType
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 OpenSearchWarmPartitionInstanceType
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 ClusterConfig where
  toJSON :: ClusterConfig -> Value
toJSON ClusterConfig' {Maybe Bool
Maybe Int
Maybe ColdStorageOptions
Maybe OpenSearchPartitionInstanceType
Maybe OpenSearchWarmPartitionInstanceType
Maybe ZoneAwarenessConfig
zoneAwarenessEnabled :: Maybe Bool
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
warmType :: Maybe OpenSearchWarmPartitionInstanceType
warmEnabled :: Maybe Bool
warmCount :: Maybe Int
instanceType :: Maybe OpenSearchPartitionInstanceType
instanceCount :: Maybe Int
dedicatedMasterType :: Maybe OpenSearchPartitionInstanceType
dedicatedMasterEnabled :: Maybe Bool
dedicatedMasterCount :: Maybe Int
coldStorageOptions :: Maybe ColdStorageOptions
$sel:zoneAwarenessEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:zoneAwarenessConfig:ClusterConfig' :: ClusterConfig -> Maybe ZoneAwarenessConfig
$sel:warmType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchWarmPartitionInstanceType
$sel:warmEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:warmCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:instanceType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
$sel:instanceCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:dedicatedMasterType:ClusterConfig' :: ClusterConfig -> Maybe OpenSearchPartitionInstanceType
$sel:dedicatedMasterEnabled:ClusterConfig' :: ClusterConfig -> Maybe Bool
$sel:dedicatedMasterCount:ClusterConfig' :: ClusterConfig -> Maybe Int
$sel:coldStorageOptions:ClusterConfig' :: ClusterConfig -> 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 OpenSearchPartitionInstanceType
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 OpenSearchPartitionInstanceType
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 OpenSearchWarmPartitionInstanceType
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
          ]
      )