{-# 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.KafkaConnect.Types.ProvisionedCapacityDescription
-- 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.KafkaConnect.Types.ProvisionedCapacityDescription where

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

-- | The description of a connector\'s provisioned capacity.
--
-- /See:/ 'newProvisionedCapacityDescription' smart constructor.
data ProvisionedCapacityDescription = ProvisionedCapacityDescription'
  { -- | The number of workers that are allocated to the connector.
    ProvisionedCapacityDescription -> Maybe Int
workerCount :: Prelude.Maybe Prelude.Int,
    -- | The number of microcontroller units (MCUs) allocated to each connector
    -- worker. The valid values are 1,2,4,8.
    ProvisionedCapacityDescription -> Maybe Int
mcuCount :: Prelude.Maybe Prelude.Int
  }
  deriving (ProvisionedCapacityDescription
-> ProvisionedCapacityDescription -> Bool
(ProvisionedCapacityDescription
 -> ProvisionedCapacityDescription -> Bool)
-> (ProvisionedCapacityDescription
    -> ProvisionedCapacityDescription -> Bool)
-> Eq ProvisionedCapacityDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisionedCapacityDescription
-> ProvisionedCapacityDescription -> Bool
$c/= :: ProvisionedCapacityDescription
-> ProvisionedCapacityDescription -> Bool
== :: ProvisionedCapacityDescription
-> ProvisionedCapacityDescription -> Bool
$c== :: ProvisionedCapacityDescription
-> ProvisionedCapacityDescription -> Bool
Prelude.Eq, ReadPrec [ProvisionedCapacityDescription]
ReadPrec ProvisionedCapacityDescription
Int -> ReadS ProvisionedCapacityDescription
ReadS [ProvisionedCapacityDescription]
(Int -> ReadS ProvisionedCapacityDescription)
-> ReadS [ProvisionedCapacityDescription]
-> ReadPrec ProvisionedCapacityDescription
-> ReadPrec [ProvisionedCapacityDescription]
-> Read ProvisionedCapacityDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisionedCapacityDescription]
$creadListPrec :: ReadPrec [ProvisionedCapacityDescription]
readPrec :: ReadPrec ProvisionedCapacityDescription
$creadPrec :: ReadPrec ProvisionedCapacityDescription
readList :: ReadS [ProvisionedCapacityDescription]
$creadList :: ReadS [ProvisionedCapacityDescription]
readsPrec :: Int -> ReadS ProvisionedCapacityDescription
$creadsPrec :: Int -> ReadS ProvisionedCapacityDescription
Prelude.Read, Int -> ProvisionedCapacityDescription -> ShowS
[ProvisionedCapacityDescription] -> ShowS
ProvisionedCapacityDescription -> String
(Int -> ProvisionedCapacityDescription -> ShowS)
-> (ProvisionedCapacityDescription -> String)
-> ([ProvisionedCapacityDescription] -> ShowS)
-> Show ProvisionedCapacityDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisionedCapacityDescription] -> ShowS
$cshowList :: [ProvisionedCapacityDescription] -> ShowS
show :: ProvisionedCapacityDescription -> String
$cshow :: ProvisionedCapacityDescription -> String
showsPrec :: Int -> ProvisionedCapacityDescription -> ShowS
$cshowsPrec :: Int -> ProvisionedCapacityDescription -> ShowS
Prelude.Show, (forall x.
 ProvisionedCapacityDescription
 -> Rep ProvisionedCapacityDescription x)
-> (forall x.
    Rep ProvisionedCapacityDescription x
    -> ProvisionedCapacityDescription)
-> Generic ProvisionedCapacityDescription
forall x.
Rep ProvisionedCapacityDescription x
-> ProvisionedCapacityDescription
forall x.
ProvisionedCapacityDescription
-> Rep ProvisionedCapacityDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisionedCapacityDescription x
-> ProvisionedCapacityDescription
$cfrom :: forall x.
ProvisionedCapacityDescription
-> Rep ProvisionedCapacityDescription x
Prelude.Generic)

-- |
-- Create a value of 'ProvisionedCapacityDescription' 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:
--
-- 'workerCount', 'provisionedCapacityDescription_workerCount' - The number of workers that are allocated to the connector.
--
-- 'mcuCount', 'provisionedCapacityDescription_mcuCount' - The number of microcontroller units (MCUs) allocated to each connector
-- worker. The valid values are 1,2,4,8.
newProvisionedCapacityDescription ::
  ProvisionedCapacityDescription
newProvisionedCapacityDescription :: ProvisionedCapacityDescription
newProvisionedCapacityDescription =
  ProvisionedCapacityDescription' :: Maybe Int -> Maybe Int -> ProvisionedCapacityDescription
ProvisionedCapacityDescription'
    { $sel:workerCount:ProvisionedCapacityDescription' :: Maybe Int
workerCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:mcuCount:ProvisionedCapacityDescription' :: Maybe Int
mcuCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of workers that are allocated to the connector.
provisionedCapacityDescription_workerCount :: Lens.Lens' ProvisionedCapacityDescription (Prelude.Maybe Prelude.Int)
provisionedCapacityDescription_workerCount :: (Maybe Int -> f (Maybe Int))
-> ProvisionedCapacityDescription
-> f ProvisionedCapacityDescription
provisionedCapacityDescription_workerCount = (ProvisionedCapacityDescription -> Maybe Int)
-> (ProvisionedCapacityDescription
    -> Maybe Int -> ProvisionedCapacityDescription)
-> Lens
     ProvisionedCapacityDescription
     ProvisionedCapacityDescription
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedCapacityDescription' {Maybe Int
workerCount :: Maybe Int
$sel:workerCount:ProvisionedCapacityDescription' :: ProvisionedCapacityDescription -> Maybe Int
workerCount} -> Maybe Int
workerCount) (\s :: ProvisionedCapacityDescription
s@ProvisionedCapacityDescription' {} Maybe Int
a -> ProvisionedCapacityDescription
s {$sel:workerCount:ProvisionedCapacityDescription' :: Maybe Int
workerCount = Maybe Int
a} :: ProvisionedCapacityDescription)

-- | The number of microcontroller units (MCUs) allocated to each connector
-- worker. The valid values are 1,2,4,8.
provisionedCapacityDescription_mcuCount :: Lens.Lens' ProvisionedCapacityDescription (Prelude.Maybe Prelude.Int)
provisionedCapacityDescription_mcuCount :: (Maybe Int -> f (Maybe Int))
-> ProvisionedCapacityDescription
-> f ProvisionedCapacityDescription
provisionedCapacityDescription_mcuCount = (ProvisionedCapacityDescription -> Maybe Int)
-> (ProvisionedCapacityDescription
    -> Maybe Int -> ProvisionedCapacityDescription)
-> Lens
     ProvisionedCapacityDescription
     ProvisionedCapacityDescription
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedCapacityDescription' {Maybe Int
mcuCount :: Maybe Int
$sel:mcuCount:ProvisionedCapacityDescription' :: ProvisionedCapacityDescription -> Maybe Int
mcuCount} -> Maybe Int
mcuCount) (\s :: ProvisionedCapacityDescription
s@ProvisionedCapacityDescription' {} Maybe Int
a -> ProvisionedCapacityDescription
s {$sel:mcuCount:ProvisionedCapacityDescription' :: Maybe Int
mcuCount = Maybe Int
a} :: ProvisionedCapacityDescription)

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

instance
  Prelude.Hashable
    ProvisionedCapacityDescription

instance
  Prelude.NFData
    ProvisionedCapacityDescription