{-# 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.KinesisAnalytics.Types.InputParallelismUpdate
-- 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.KinesisAnalytics.Types.InputParallelismUpdate where

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

-- | Provides updates to the parallelism count.
--
-- /See:/ 'newInputParallelismUpdate' smart constructor.
data InputParallelismUpdate = InputParallelismUpdate'
  { -- | Number of in-application streams to create for the specified streaming
    -- source.
    InputParallelismUpdate -> Maybe Natural
countUpdate :: Prelude.Maybe Prelude.Natural
  }
  deriving (InputParallelismUpdate -> InputParallelismUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputParallelismUpdate -> InputParallelismUpdate -> Bool
$c/= :: InputParallelismUpdate -> InputParallelismUpdate -> Bool
== :: InputParallelismUpdate -> InputParallelismUpdate -> Bool
$c== :: InputParallelismUpdate -> InputParallelismUpdate -> Bool
Prelude.Eq, ReadPrec [InputParallelismUpdate]
ReadPrec InputParallelismUpdate
Int -> ReadS InputParallelismUpdate
ReadS [InputParallelismUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputParallelismUpdate]
$creadListPrec :: ReadPrec [InputParallelismUpdate]
readPrec :: ReadPrec InputParallelismUpdate
$creadPrec :: ReadPrec InputParallelismUpdate
readList :: ReadS [InputParallelismUpdate]
$creadList :: ReadS [InputParallelismUpdate]
readsPrec :: Int -> ReadS InputParallelismUpdate
$creadsPrec :: Int -> ReadS InputParallelismUpdate
Prelude.Read, Int -> InputParallelismUpdate -> ShowS
[InputParallelismUpdate] -> ShowS
InputParallelismUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputParallelismUpdate] -> ShowS
$cshowList :: [InputParallelismUpdate] -> ShowS
show :: InputParallelismUpdate -> String
$cshow :: InputParallelismUpdate -> String
showsPrec :: Int -> InputParallelismUpdate -> ShowS
$cshowsPrec :: Int -> InputParallelismUpdate -> ShowS
Prelude.Show, forall x. Rep InputParallelismUpdate x -> InputParallelismUpdate
forall x. InputParallelismUpdate -> Rep InputParallelismUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputParallelismUpdate x -> InputParallelismUpdate
$cfrom :: forall x. InputParallelismUpdate -> Rep InputParallelismUpdate x
Prelude.Generic)

-- |
-- Create a value of 'InputParallelismUpdate' 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:
--
-- 'countUpdate', 'inputParallelismUpdate_countUpdate' - Number of in-application streams to create for the specified streaming
-- source.
newInputParallelismUpdate ::
  InputParallelismUpdate
newInputParallelismUpdate :: InputParallelismUpdate
newInputParallelismUpdate =
  InputParallelismUpdate'
    { $sel:countUpdate:InputParallelismUpdate' :: Maybe Natural
countUpdate =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Number of in-application streams to create for the specified streaming
-- source.
inputParallelismUpdate_countUpdate :: Lens.Lens' InputParallelismUpdate (Prelude.Maybe Prelude.Natural)
inputParallelismUpdate_countUpdate :: Lens' InputParallelismUpdate (Maybe Natural)
inputParallelismUpdate_countUpdate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputParallelismUpdate' {Maybe Natural
countUpdate :: Maybe Natural
$sel:countUpdate:InputParallelismUpdate' :: InputParallelismUpdate -> Maybe Natural
countUpdate} -> Maybe Natural
countUpdate) (\s :: InputParallelismUpdate
s@InputParallelismUpdate' {} Maybe Natural
a -> InputParallelismUpdate
s {$sel:countUpdate:InputParallelismUpdate' :: Maybe Natural
countUpdate = Maybe Natural
a} :: InputParallelismUpdate)

instance Prelude.Hashable InputParallelismUpdate where
  hashWithSalt :: Int -> InputParallelismUpdate -> Int
hashWithSalt Int
_salt InputParallelismUpdate' {Maybe Natural
countUpdate :: Maybe Natural
$sel:countUpdate:InputParallelismUpdate' :: InputParallelismUpdate -> Maybe Natural
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
countUpdate

instance Prelude.NFData InputParallelismUpdate where
  rnf :: InputParallelismUpdate -> ()
rnf InputParallelismUpdate' {Maybe Natural
countUpdate :: Maybe Natural
$sel:countUpdate:InputParallelismUpdate' :: InputParallelismUpdate -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
countUpdate

instance Data.ToJSON InputParallelismUpdate where
  toJSON :: InputParallelismUpdate -> Value
toJSON InputParallelismUpdate' {Maybe Natural
countUpdate :: Maybe Natural
$sel:countUpdate:InputParallelismUpdate' :: InputParallelismUpdate -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"CountUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
countUpdate]
      )