{-# 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.KinesisAnalyticsV2.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.KinesisAnalyticsV2.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

-- | For a SQL-based Kinesis Data Analytics application, provides updates to
-- the parallelism count.
--
-- /See:/ 'newInputParallelismUpdate' smart constructor.
data InputParallelismUpdate = InputParallelismUpdate'
  { -- | The number of in-application streams to create for the specified
    -- streaming source.
    InputParallelismUpdate -> Natural
countUpdate :: 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' - The number of in-application streams to create for the specified
-- streaming source.
newInputParallelismUpdate ::
  -- | 'countUpdate'
  Prelude.Natural ->
  InputParallelismUpdate
newInputParallelismUpdate :: Natural -> InputParallelismUpdate
newInputParallelismUpdate Natural
pCountUpdate_ =
  InputParallelismUpdate'
    { $sel:countUpdate:InputParallelismUpdate' :: Natural
countUpdate =
        Natural
pCountUpdate_
    }

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

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

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

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