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