{-# 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.ElasticSearch.Types.InstanceLimits
-- 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.ElasticSearch.Types.InstanceLimits where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticSearch.Types.InstanceCountLimits
import qualified Amazonka.Prelude as Prelude

-- | InstanceLimits represents the list of instance related attributes that
-- are available for given InstanceType.
--
-- /See:/ 'newInstanceLimits' smart constructor.
data InstanceLimits = InstanceLimits'
  { InstanceLimits -> Maybe InstanceCountLimits
instanceCountLimits :: Prelude.Maybe InstanceCountLimits
  }
  deriving (InstanceLimits -> InstanceLimits -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'InstanceLimits' 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:
--
-- 'instanceCountLimits', 'instanceLimits_instanceCountLimits' - Undocumented member.
newInstanceLimits ::
  InstanceLimits
newInstanceLimits :: InstanceLimits
newInstanceLimits =
  InstanceLimits'
    { $sel:instanceCountLimits:InstanceLimits' :: Maybe InstanceCountLimits
instanceCountLimits =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
instanceLimits_instanceCountLimits :: Lens.Lens' InstanceLimits (Prelude.Maybe InstanceCountLimits)
instanceLimits_instanceCountLimits :: Lens' InstanceLimits (Maybe InstanceCountLimits)
instanceLimits_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 Data.FromJSON InstanceLimits where
  parseJSON :: Value -> Parser InstanceLimits
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InstanceLimits"
      ( \Object
x ->
          Maybe InstanceCountLimits -> InstanceLimits
InstanceLimits'
            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
"InstanceCountLimits")
      )

instance Prelude.Hashable InstanceLimits where
  hashWithSalt :: Int -> InstanceLimits -> Int
hashWithSalt Int
_salt InstanceLimits' {Maybe InstanceCountLimits
instanceCountLimits :: Maybe InstanceCountLimits
$sel:instanceCountLimits:InstanceLimits' :: InstanceLimits -> Maybe InstanceCountLimits
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceCountLimits
instanceCountLimits

instance Prelude.NFData InstanceLimits where
  rnf :: InstanceLimits -> ()
rnf InstanceLimits' {Maybe InstanceCountLimits
instanceCountLimits :: Maybe InstanceCountLimits
$sel:instanceCountLimits:InstanceLimits' :: InstanceLimits -> Maybe InstanceCountLimits
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceCountLimits
instanceCountLimits