{-# 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 #-}
module Amazonka.ElasticSearch.Types.ZoneAwarenessConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ZoneAwarenessConfig = ZoneAwarenessConfig'
{
ZoneAwarenessConfig -> Maybe Int
availabilityZoneCount :: Prelude.Maybe Prelude.Int
}
deriving (ZoneAwarenessConfig -> ZoneAwarenessConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ZoneAwarenessConfig -> ZoneAwarenessConfig -> Bool
$c/= :: ZoneAwarenessConfig -> ZoneAwarenessConfig -> Bool
== :: ZoneAwarenessConfig -> ZoneAwarenessConfig -> Bool
$c== :: ZoneAwarenessConfig -> ZoneAwarenessConfig -> Bool
Prelude.Eq, ReadPrec [ZoneAwarenessConfig]
ReadPrec ZoneAwarenessConfig
Int -> ReadS ZoneAwarenessConfig
ReadS [ZoneAwarenessConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ZoneAwarenessConfig]
$creadListPrec :: ReadPrec [ZoneAwarenessConfig]
readPrec :: ReadPrec ZoneAwarenessConfig
$creadPrec :: ReadPrec ZoneAwarenessConfig
readList :: ReadS [ZoneAwarenessConfig]
$creadList :: ReadS [ZoneAwarenessConfig]
readsPrec :: Int -> ReadS ZoneAwarenessConfig
$creadsPrec :: Int -> ReadS ZoneAwarenessConfig
Prelude.Read, Int -> ZoneAwarenessConfig -> ShowS
[ZoneAwarenessConfig] -> ShowS
ZoneAwarenessConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ZoneAwarenessConfig] -> ShowS
$cshowList :: [ZoneAwarenessConfig] -> ShowS
show :: ZoneAwarenessConfig -> String
$cshow :: ZoneAwarenessConfig -> String
showsPrec :: Int -> ZoneAwarenessConfig -> ShowS
$cshowsPrec :: Int -> ZoneAwarenessConfig -> ShowS
Prelude.Show, forall x. Rep ZoneAwarenessConfig x -> ZoneAwarenessConfig
forall x. ZoneAwarenessConfig -> Rep ZoneAwarenessConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ZoneAwarenessConfig x -> ZoneAwarenessConfig
$cfrom :: forall x. ZoneAwarenessConfig -> Rep ZoneAwarenessConfig x
Prelude.Generic)
newZoneAwarenessConfig ::
ZoneAwarenessConfig
newZoneAwarenessConfig :: ZoneAwarenessConfig
newZoneAwarenessConfig =
ZoneAwarenessConfig'
{ $sel:availabilityZoneCount:ZoneAwarenessConfig' :: Maybe Int
availabilityZoneCount =
forall a. Maybe a
Prelude.Nothing
}
zoneAwarenessConfig_availabilityZoneCount :: Lens.Lens' ZoneAwarenessConfig (Prelude.Maybe Prelude.Int)
zoneAwarenessConfig_availabilityZoneCount :: Lens' ZoneAwarenessConfig (Maybe Int)
zoneAwarenessConfig_availabilityZoneCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ZoneAwarenessConfig' {Maybe Int
availabilityZoneCount :: Maybe Int
$sel:availabilityZoneCount:ZoneAwarenessConfig' :: ZoneAwarenessConfig -> Maybe Int
availabilityZoneCount} -> Maybe Int
availabilityZoneCount) (\s :: ZoneAwarenessConfig
s@ZoneAwarenessConfig' {} Maybe Int
a -> ZoneAwarenessConfig
s {$sel:availabilityZoneCount:ZoneAwarenessConfig' :: Maybe Int
availabilityZoneCount = Maybe Int
a} :: ZoneAwarenessConfig)
instance Data.FromJSON ZoneAwarenessConfig where
parseJSON :: Value -> Parser ZoneAwarenessConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ZoneAwarenessConfig"
( \Object
x ->
Maybe Int -> ZoneAwarenessConfig
ZoneAwarenessConfig'
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
"AvailabilityZoneCount")
)
instance Prelude.Hashable ZoneAwarenessConfig where
hashWithSalt :: Int -> ZoneAwarenessConfig -> Int
hashWithSalt Int
_salt ZoneAwarenessConfig' {Maybe Int
availabilityZoneCount :: Maybe Int
$sel:availabilityZoneCount:ZoneAwarenessConfig' :: ZoneAwarenessConfig -> Maybe Int
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
availabilityZoneCount
instance Prelude.NFData ZoneAwarenessConfig where
rnf :: ZoneAwarenessConfig -> ()
rnf ZoneAwarenessConfig' {Maybe Int
availabilityZoneCount :: Maybe Int
$sel:availabilityZoneCount:ZoneAwarenessConfig' :: ZoneAwarenessConfig -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
availabilityZoneCount
instance Data.ToJSON ZoneAwarenessConfig where
toJSON :: ZoneAwarenessConfig -> Value
toJSON ZoneAwarenessConfig' {Maybe Int
availabilityZoneCount :: Maybe Int
$sel:availabilityZoneCount:ZoneAwarenessConfig' :: ZoneAwarenessConfig -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AvailabilityZoneCount" 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
availabilityZoneCount
]
)