{-# 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.AwsDynamoDbTableProvisionedThroughputOverride
-- 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.AwsDynamoDbTableProvisionedThroughputOverride where

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

-- | Replica-specific configuration for the provisioned throughput.
--
-- /See:/ 'newAwsDynamoDbTableProvisionedThroughputOverride' smart constructor.
data AwsDynamoDbTableProvisionedThroughputOverride = AwsDynamoDbTableProvisionedThroughputOverride'
  { -- | The read capacity units for the replica.
    AwsDynamoDbTableProvisionedThroughputOverride -> Maybe Int
readCapacityUnits :: Prelude.Maybe Prelude.Int
  }
  deriving (AwsDynamoDbTableProvisionedThroughputOverride
-> AwsDynamoDbTableProvisionedThroughputOverride -> Bool
(AwsDynamoDbTableProvisionedThroughputOverride
 -> AwsDynamoDbTableProvisionedThroughputOverride -> Bool)
-> (AwsDynamoDbTableProvisionedThroughputOverride
    -> AwsDynamoDbTableProvisionedThroughputOverride -> Bool)
-> Eq AwsDynamoDbTableProvisionedThroughputOverride
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsDynamoDbTableProvisionedThroughputOverride
-> AwsDynamoDbTableProvisionedThroughputOverride -> Bool
$c/= :: AwsDynamoDbTableProvisionedThroughputOverride
-> AwsDynamoDbTableProvisionedThroughputOverride -> Bool
== :: AwsDynamoDbTableProvisionedThroughputOverride
-> AwsDynamoDbTableProvisionedThroughputOverride -> Bool
$c== :: AwsDynamoDbTableProvisionedThroughputOverride
-> AwsDynamoDbTableProvisionedThroughputOverride -> Bool
Prelude.Eq, ReadPrec [AwsDynamoDbTableProvisionedThroughputOverride]
ReadPrec AwsDynamoDbTableProvisionedThroughputOverride
Int -> ReadS AwsDynamoDbTableProvisionedThroughputOverride
ReadS [AwsDynamoDbTableProvisionedThroughputOverride]
(Int -> ReadS AwsDynamoDbTableProvisionedThroughputOverride)
-> ReadS [AwsDynamoDbTableProvisionedThroughputOverride]
-> ReadPrec AwsDynamoDbTableProvisionedThroughputOverride
-> ReadPrec [AwsDynamoDbTableProvisionedThroughputOverride]
-> Read AwsDynamoDbTableProvisionedThroughputOverride
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsDynamoDbTableProvisionedThroughputOverride]
$creadListPrec :: ReadPrec [AwsDynamoDbTableProvisionedThroughputOverride]
readPrec :: ReadPrec AwsDynamoDbTableProvisionedThroughputOverride
$creadPrec :: ReadPrec AwsDynamoDbTableProvisionedThroughputOverride
readList :: ReadS [AwsDynamoDbTableProvisionedThroughputOverride]
$creadList :: ReadS [AwsDynamoDbTableProvisionedThroughputOverride]
readsPrec :: Int -> ReadS AwsDynamoDbTableProvisionedThroughputOverride
$creadsPrec :: Int -> ReadS AwsDynamoDbTableProvisionedThroughputOverride
Prelude.Read, Int -> AwsDynamoDbTableProvisionedThroughputOverride -> ShowS
[AwsDynamoDbTableProvisionedThroughputOverride] -> ShowS
AwsDynamoDbTableProvisionedThroughputOverride -> String
(Int -> AwsDynamoDbTableProvisionedThroughputOverride -> ShowS)
-> (AwsDynamoDbTableProvisionedThroughputOverride -> String)
-> ([AwsDynamoDbTableProvisionedThroughputOverride] -> ShowS)
-> Show AwsDynamoDbTableProvisionedThroughputOverride
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsDynamoDbTableProvisionedThroughputOverride] -> ShowS
$cshowList :: [AwsDynamoDbTableProvisionedThroughputOverride] -> ShowS
show :: AwsDynamoDbTableProvisionedThroughputOverride -> String
$cshow :: AwsDynamoDbTableProvisionedThroughputOverride -> String
showsPrec :: Int -> AwsDynamoDbTableProvisionedThroughputOverride -> ShowS
$cshowsPrec :: Int -> AwsDynamoDbTableProvisionedThroughputOverride -> ShowS
Prelude.Show, (forall x.
 AwsDynamoDbTableProvisionedThroughputOverride
 -> Rep AwsDynamoDbTableProvisionedThroughputOverride x)
-> (forall x.
    Rep AwsDynamoDbTableProvisionedThroughputOverride x
    -> AwsDynamoDbTableProvisionedThroughputOverride)
-> Generic AwsDynamoDbTableProvisionedThroughputOverride
forall x.
Rep AwsDynamoDbTableProvisionedThroughputOverride x
-> AwsDynamoDbTableProvisionedThroughputOverride
forall x.
AwsDynamoDbTableProvisionedThroughputOverride
-> Rep AwsDynamoDbTableProvisionedThroughputOverride x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsDynamoDbTableProvisionedThroughputOverride x
-> AwsDynamoDbTableProvisionedThroughputOverride
$cfrom :: forall x.
AwsDynamoDbTableProvisionedThroughputOverride
-> Rep AwsDynamoDbTableProvisionedThroughputOverride x
Prelude.Generic)

-- |
-- Create a value of 'AwsDynamoDbTableProvisionedThroughputOverride' 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:
--
-- 'readCapacityUnits', 'awsDynamoDbTableProvisionedThroughputOverride_readCapacityUnits' - The read capacity units for the replica.
newAwsDynamoDbTableProvisionedThroughputOverride ::
  AwsDynamoDbTableProvisionedThroughputOverride
newAwsDynamoDbTableProvisionedThroughputOverride :: AwsDynamoDbTableProvisionedThroughputOverride
newAwsDynamoDbTableProvisionedThroughputOverride =
  AwsDynamoDbTableProvisionedThroughputOverride' :: Maybe Int -> AwsDynamoDbTableProvisionedThroughputOverride
AwsDynamoDbTableProvisionedThroughputOverride'
    { $sel:readCapacityUnits:AwsDynamoDbTableProvisionedThroughputOverride' :: Maybe Int
readCapacityUnits =
        Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The read capacity units for the replica.
awsDynamoDbTableProvisionedThroughputOverride_readCapacityUnits :: Lens.Lens' AwsDynamoDbTableProvisionedThroughputOverride (Prelude.Maybe Prelude.Int)
awsDynamoDbTableProvisionedThroughputOverride_readCapacityUnits :: (Maybe Int -> f (Maybe Int))
-> AwsDynamoDbTableProvisionedThroughputOverride
-> f AwsDynamoDbTableProvisionedThroughputOverride
awsDynamoDbTableProvisionedThroughputOverride_readCapacityUnits = (AwsDynamoDbTableProvisionedThroughputOverride -> Maybe Int)
-> (AwsDynamoDbTableProvisionedThroughputOverride
    -> Maybe Int -> AwsDynamoDbTableProvisionedThroughputOverride)
-> Lens
     AwsDynamoDbTableProvisionedThroughputOverride
     AwsDynamoDbTableProvisionedThroughputOverride
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableProvisionedThroughputOverride' {Maybe Int
readCapacityUnits :: Maybe Int
$sel:readCapacityUnits:AwsDynamoDbTableProvisionedThroughputOverride' :: AwsDynamoDbTableProvisionedThroughputOverride -> Maybe Int
readCapacityUnits} -> Maybe Int
readCapacityUnits) (\s :: AwsDynamoDbTableProvisionedThroughputOverride
s@AwsDynamoDbTableProvisionedThroughputOverride' {} Maybe Int
a -> AwsDynamoDbTableProvisionedThroughputOverride
s {$sel:readCapacityUnits:AwsDynamoDbTableProvisionedThroughputOverride' :: Maybe Int
readCapacityUnits = Maybe Int
a} :: AwsDynamoDbTableProvisionedThroughputOverride)

instance
  Core.FromJSON
    AwsDynamoDbTableProvisionedThroughputOverride
  where
  parseJSON :: Value -> Parser AwsDynamoDbTableProvisionedThroughputOverride
parseJSON =
    String
-> (Object -> Parser AwsDynamoDbTableProvisionedThroughputOverride)
-> Value
-> Parser AwsDynamoDbTableProvisionedThroughputOverride
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsDynamoDbTableProvisionedThroughputOverride"
      ( \Object
x ->
          Maybe Int -> AwsDynamoDbTableProvisionedThroughputOverride
AwsDynamoDbTableProvisionedThroughputOverride'
            (Maybe Int -> AwsDynamoDbTableProvisionedThroughputOverride)
-> Parser (Maybe Int)
-> Parser AwsDynamoDbTableProvisionedThroughputOverride
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
"ReadCapacityUnits")
      )

instance
  Prelude.Hashable
    AwsDynamoDbTableProvisionedThroughputOverride

instance
  Prelude.NFData
    AwsDynamoDbTableProvisionedThroughputOverride

instance
  Core.ToJSON
    AwsDynamoDbTableProvisionedThroughputOverride
  where
  toJSON :: AwsDynamoDbTableProvisionedThroughputOverride -> Value
toJSON
    AwsDynamoDbTableProvisionedThroughputOverride' {Maybe Int
readCapacityUnits :: Maybe Int
$sel:readCapacityUnits:AwsDynamoDbTableProvisionedThroughputOverride' :: AwsDynamoDbTableProvisionedThroughputOverride -> Maybe Int
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"ReadCapacityUnits" 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
readCapacityUnits
            ]
        )