{-# 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.SecurityHub.Types.AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-- 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.SecurityHub.Types.AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Configuration options for zone awareness.
--
-- /See:/ 'newAwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' smart constructor.
data AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails = AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails'
  { -- | he number of Availability Zones that the domain uses. Valid values are 2
    -- and 3. The default is 2.
    AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Maybe Int
availabilityZoneCount :: Prelude.Maybe Prelude.Int
  }
  deriving (AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Bool
(AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
 -> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
 -> Bool)
-> (AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
    -> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
    -> Bool)
-> Eq
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Bool
$c/= :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Bool
== :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Bool
$c== :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
ReadPrec
  AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
Int
-> ReadS
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
ReadS
  [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
(Int
 -> ReadS
      AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails)
-> ReadS
     [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
-> ReadPrec
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> ReadPrec
     [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
-> Read
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
$creadListPrec :: ReadPrec
  [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
readPrec :: ReadPrec
  AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
$creadPrec :: ReadPrec
  AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
readList :: ReadS
  [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
$creadList :: ReadS
  [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
readsPrec :: Int
-> ReadS
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
$creadsPrec :: Int
-> ReadS
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
Prelude.Read, Int
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> ShowS
[AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
-> ShowS
AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> String
(Int
 -> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
 -> ShowS)
-> (AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
    -> String)
-> ([AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
    -> ShowS)
-> Show
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
-> ShowS
$cshowList :: [AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails]
-> ShowS
show :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> String
$cshow :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> String
showsPrec :: Int
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> ShowS
$cshowsPrec :: Int
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> ShowS
Prelude.Show, (forall x.
 AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
 -> Rep
      AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
      x)
-> (forall x.
    Rep
      AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
      x
    -> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails)
-> Generic
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
forall x.
Rep
  AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
  x
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
forall x.
AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Rep
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
     x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep
  AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
  x
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
$cfrom :: forall x.
AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Rep
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
     x
Prelude.Generic)

-- |
-- Create a value of 'AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' 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:
--
-- 'availabilityZoneCount', 'awsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails_availabilityZoneCount' - he number of Availability Zones that the domain uses. Valid values are 2
-- and 3. The default is 2.
newAwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails ::
  AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
newAwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
newAwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails =
  AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' :: Maybe Int
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails'
    { $sel:availabilityZoneCount:AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' :: Maybe Int
availabilityZoneCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | he number of Availability Zones that the domain uses. Valid values are 2
-- and 3. The default is 2.
awsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails_availabilityZoneCount :: Lens.Lens' AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails (Prelude.Maybe Prelude.Int)
awsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails_availabilityZoneCount :: (Maybe Int -> f (Maybe Int))
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> f AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
awsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails_availabilityZoneCount = (AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
 -> Maybe Int)
-> (AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
    -> Maybe Int
    -> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails)
-> Lens
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' {Maybe Int
availabilityZoneCount :: Maybe Int
$sel:availabilityZoneCount:AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Maybe Int
availabilityZoneCount} -> Maybe Int
availabilityZoneCount) (\s :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
s@AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' {} Maybe Int
a -> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
s {$sel:availabilityZoneCount:AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' :: Maybe Int
availabilityZoneCount = Maybe Int
a} :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails)

instance
  Core.FromJSON
    AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
  where
  parseJSON :: Value
-> Parser
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
parseJSON =
    String
-> (Object
    -> Parser
         AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails)
-> Value
-> Parser
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails"
      ( \Object
x ->
          Maybe Int
-> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails'
            (Maybe Int
 -> AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails)
-> Parser (Maybe Int)
-> Parser
     AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AvailabilityZoneCount")
      )

instance
  Prelude.Hashable
    AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails

instance
  Prelude.NFData
    AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails

instance
  Core.ToJSON
    AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
  where
  toJSON :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Value
toJSON
    AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' {Maybe Int
availabilityZoneCount :: Maybe Int
$sel:availabilityZoneCount:AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails' :: AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails
-> Maybe Int
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"AvailabilityZoneCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
availabilityZoneCount
            ]
        )