{-# 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.InstanceCountLimits where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceCountLimits = InstanceCountLimits'
{ InstanceCountLimits -> Maybe Int
maximumInstanceCount :: Prelude.Maybe Prelude.Int,
InstanceCountLimits -> Maybe Int
minimumInstanceCount :: Prelude.Maybe Prelude.Int
}
deriving (InstanceCountLimits -> InstanceCountLimits -> Bool
(InstanceCountLimits -> InstanceCountLimits -> Bool)
-> (InstanceCountLimits -> InstanceCountLimits -> Bool)
-> Eq InstanceCountLimits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceCountLimits -> InstanceCountLimits -> Bool
$c/= :: InstanceCountLimits -> InstanceCountLimits -> Bool
== :: InstanceCountLimits -> InstanceCountLimits -> Bool
$c== :: InstanceCountLimits -> InstanceCountLimits -> Bool
Prelude.Eq, ReadPrec [InstanceCountLimits]
ReadPrec InstanceCountLimits
Int -> ReadS InstanceCountLimits
ReadS [InstanceCountLimits]
(Int -> ReadS InstanceCountLimits)
-> ReadS [InstanceCountLimits]
-> ReadPrec InstanceCountLimits
-> ReadPrec [InstanceCountLimits]
-> Read InstanceCountLimits
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceCountLimits]
$creadListPrec :: ReadPrec [InstanceCountLimits]
readPrec :: ReadPrec InstanceCountLimits
$creadPrec :: ReadPrec InstanceCountLimits
readList :: ReadS [InstanceCountLimits]
$creadList :: ReadS [InstanceCountLimits]
readsPrec :: Int -> ReadS InstanceCountLimits
$creadsPrec :: Int -> ReadS InstanceCountLimits
Prelude.Read, Int -> InstanceCountLimits -> ShowS
[InstanceCountLimits] -> ShowS
InstanceCountLimits -> String
(Int -> InstanceCountLimits -> ShowS)
-> (InstanceCountLimits -> String)
-> ([InstanceCountLimits] -> ShowS)
-> Show InstanceCountLimits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceCountLimits] -> ShowS
$cshowList :: [InstanceCountLimits] -> ShowS
show :: InstanceCountLimits -> String
$cshow :: InstanceCountLimits -> String
showsPrec :: Int -> InstanceCountLimits -> ShowS
$cshowsPrec :: Int -> InstanceCountLimits -> ShowS
Prelude.Show, (forall x. InstanceCountLimits -> Rep InstanceCountLimits x)
-> (forall x. Rep InstanceCountLimits x -> InstanceCountLimits)
-> Generic InstanceCountLimits
forall x. Rep InstanceCountLimits x -> InstanceCountLimits
forall x. InstanceCountLimits -> Rep InstanceCountLimits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceCountLimits x -> InstanceCountLimits
$cfrom :: forall x. InstanceCountLimits -> Rep InstanceCountLimits x
Prelude.Generic)
newInstanceCountLimits ::
InstanceCountLimits
newInstanceCountLimits :: InstanceCountLimits
newInstanceCountLimits =
InstanceCountLimits' :: Maybe Int -> Maybe Int -> InstanceCountLimits
InstanceCountLimits'
{ $sel:maximumInstanceCount:InstanceCountLimits' :: Maybe Int
maximumInstanceCount =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:minimumInstanceCount:InstanceCountLimits' :: Maybe Int
minimumInstanceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
instanceCountLimits_maximumInstanceCount :: Lens.Lens' InstanceCountLimits (Prelude.Maybe Prelude.Int)
instanceCountLimits_maximumInstanceCount :: (Maybe Int -> f (Maybe Int))
-> InstanceCountLimits -> f InstanceCountLimits
instanceCountLimits_maximumInstanceCount = (InstanceCountLimits -> Maybe Int)
-> (InstanceCountLimits -> Maybe Int -> InstanceCountLimits)
-> Lens
InstanceCountLimits InstanceCountLimits (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceCountLimits' {Maybe Int
maximumInstanceCount :: Maybe Int
$sel:maximumInstanceCount:InstanceCountLimits' :: InstanceCountLimits -> Maybe Int
maximumInstanceCount} -> Maybe Int
maximumInstanceCount) (\s :: InstanceCountLimits
s@InstanceCountLimits' {} Maybe Int
a -> InstanceCountLimits
s {$sel:maximumInstanceCount:InstanceCountLimits' :: Maybe Int
maximumInstanceCount = Maybe Int
a} :: InstanceCountLimits)
instanceCountLimits_minimumInstanceCount :: Lens.Lens' InstanceCountLimits (Prelude.Maybe Prelude.Int)
instanceCountLimits_minimumInstanceCount :: (Maybe Int -> f (Maybe Int))
-> InstanceCountLimits -> f InstanceCountLimits
instanceCountLimits_minimumInstanceCount = (InstanceCountLimits -> Maybe Int)
-> (InstanceCountLimits -> Maybe Int -> InstanceCountLimits)
-> Lens
InstanceCountLimits InstanceCountLimits (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceCountLimits' {Maybe Int
minimumInstanceCount :: Maybe Int
$sel:minimumInstanceCount:InstanceCountLimits' :: InstanceCountLimits -> Maybe Int
minimumInstanceCount} -> Maybe Int
minimumInstanceCount) (\s :: InstanceCountLimits
s@InstanceCountLimits' {} Maybe Int
a -> InstanceCountLimits
s {$sel:minimumInstanceCount:InstanceCountLimits' :: Maybe Int
minimumInstanceCount = Maybe Int
a} :: InstanceCountLimits)
instance Core.FromJSON InstanceCountLimits where
parseJSON :: Value -> Parser InstanceCountLimits
parseJSON =
String
-> (Object -> Parser InstanceCountLimits)
-> Value
-> Parser InstanceCountLimits
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceCountLimits"
( \Object
x ->
Maybe Int -> Maybe Int -> InstanceCountLimits
InstanceCountLimits'
(Maybe Int -> Maybe Int -> InstanceCountLimits)
-> Parser (Maybe Int) -> Parser (Maybe Int -> InstanceCountLimits)
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
"MaximumInstanceCount")
Parser (Maybe Int -> InstanceCountLimits)
-> Parser (Maybe Int) -> Parser InstanceCountLimits
forall (f :: * -> *) a b. Applicative f => 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
"MinimumInstanceCount")
)
instance Prelude.Hashable InstanceCountLimits
instance Prelude.NFData InstanceCountLimits