{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kinesis.UpdateShardCount
-- 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)
--
-- Updates the shard count of the specified stream to the specified number
-- of shards.
--
-- Updating the shard count is an asynchronous operation. Upon receiving
-- the request, Kinesis Data Streams returns immediately and sets the
-- status of the stream to @UPDATING@. After the update is complete,
-- Kinesis Data Streams sets the status of the stream back to @ACTIVE@.
-- Depending on the size of the stream, the scaling action could take a few
-- minutes to complete. You can continue to read and write data to your
-- stream while its status is @UPDATING@.
--
-- To update the shard count, Kinesis Data Streams performs splits or
-- merges on individual shards. This can cause short-lived shards to be
-- created, in addition to the final shards. These short-lived shards count
-- towards your total shard limit for your account in the Region.
--
-- When using this operation, we recommend that you specify a target shard
-- count that is a multiple of 25% (25%, 50%, 75%, 100%). You can specify
-- any target value within your shard limit. However, if you specify a
-- target that isn\'t a multiple of 25%, the scaling action might take
-- longer to complete.
--
-- This operation has the following default limits. By default, you cannot
-- do the following:
--
-- -   Scale more than ten times per rolling 24-hour period per stream
--
-- -   Scale up to more than double your current shard count for a stream
--
-- -   Scale down below half your current shard count for a stream
--
-- -   Scale up to more than 500 shards in a stream
--
-- -   Scale a stream with more than 500 shards down unless the result is
--     less than 500 shards
--
-- -   Scale up to more than the shard limit for your account
--
-- For the default limits for an AWS account, see
-- <https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html Streams Limits>
-- in the /Amazon Kinesis Data Streams Developer Guide/. To request an
-- increase in the call rate limit, the shard limit for this API, or your
-- overall shard limit, use the
-- <https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase&limitType=service-code-kinesis limits form>.
module Amazonka.Kinesis.UpdateShardCount
  ( -- * Creating a Request
    UpdateShardCount (..),
    newUpdateShardCount,

    -- * Request Lenses
    updateShardCount_streamName,
    updateShardCount_targetShardCount,
    updateShardCount_scalingType,

    -- * Destructuring the Response
    UpdateShardCountResponse (..),
    newUpdateShardCountResponse,

    -- * Response Lenses
    updateShardCountResponse_targetShardCount,
    updateShardCountResponse_streamName,
    updateShardCountResponse_currentShardCount,
    updateShardCountResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateShardCount' smart constructor.
data UpdateShardCount = UpdateShardCount'
  { -- | The name of the stream.
    UpdateShardCount -> Text
streamName :: Prelude.Text,
    -- | The new number of shards. This value has the following default limits.
    -- By default, you cannot do the following:
    --
    -- -   Set this value to more than double your current shard count for a
    --     stream.
    --
    -- -   Set this value below half your current shard count for a stream.
    --
    -- -   Set this value to more than 500 shards in a stream (the default
    --     limit for shard count per stream is 500 per account per region),
    --     unless you request a limit increase.
    --
    -- -   Scale a stream with more than 500 shards down unless you set this
    --     value to less than 500 shards.
    UpdateShardCount -> Natural
targetShardCount :: Prelude.Natural,
    -- | The scaling type. Uniform scaling creates shards of equal size.
    UpdateShardCount -> ScalingType
scalingType :: ScalingType
  }
  deriving (UpdateShardCount -> UpdateShardCount -> Bool
(UpdateShardCount -> UpdateShardCount -> Bool)
-> (UpdateShardCount -> UpdateShardCount -> Bool)
-> Eq UpdateShardCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateShardCount -> UpdateShardCount -> Bool
$c/= :: UpdateShardCount -> UpdateShardCount -> Bool
== :: UpdateShardCount -> UpdateShardCount -> Bool
$c== :: UpdateShardCount -> UpdateShardCount -> Bool
Prelude.Eq, ReadPrec [UpdateShardCount]
ReadPrec UpdateShardCount
Int -> ReadS UpdateShardCount
ReadS [UpdateShardCount]
(Int -> ReadS UpdateShardCount)
-> ReadS [UpdateShardCount]
-> ReadPrec UpdateShardCount
-> ReadPrec [UpdateShardCount]
-> Read UpdateShardCount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateShardCount]
$creadListPrec :: ReadPrec [UpdateShardCount]
readPrec :: ReadPrec UpdateShardCount
$creadPrec :: ReadPrec UpdateShardCount
readList :: ReadS [UpdateShardCount]
$creadList :: ReadS [UpdateShardCount]
readsPrec :: Int -> ReadS UpdateShardCount
$creadsPrec :: Int -> ReadS UpdateShardCount
Prelude.Read, Int -> UpdateShardCount -> ShowS
[UpdateShardCount] -> ShowS
UpdateShardCount -> String
(Int -> UpdateShardCount -> ShowS)
-> (UpdateShardCount -> String)
-> ([UpdateShardCount] -> ShowS)
-> Show UpdateShardCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateShardCount] -> ShowS
$cshowList :: [UpdateShardCount] -> ShowS
show :: UpdateShardCount -> String
$cshow :: UpdateShardCount -> String
showsPrec :: Int -> UpdateShardCount -> ShowS
$cshowsPrec :: Int -> UpdateShardCount -> ShowS
Prelude.Show, (forall x. UpdateShardCount -> Rep UpdateShardCount x)
-> (forall x. Rep UpdateShardCount x -> UpdateShardCount)
-> Generic UpdateShardCount
forall x. Rep UpdateShardCount x -> UpdateShardCount
forall x. UpdateShardCount -> Rep UpdateShardCount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateShardCount x -> UpdateShardCount
$cfrom :: forall x. UpdateShardCount -> Rep UpdateShardCount x
Prelude.Generic)

-- |
-- Create a value of 'UpdateShardCount' 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:
--
-- 'streamName', 'updateShardCount_streamName' - The name of the stream.
--
-- 'targetShardCount', 'updateShardCount_targetShardCount' - The new number of shards. This value has the following default limits.
-- By default, you cannot do the following:
--
-- -   Set this value to more than double your current shard count for a
--     stream.
--
-- -   Set this value below half your current shard count for a stream.
--
-- -   Set this value to more than 500 shards in a stream (the default
--     limit for shard count per stream is 500 per account per region),
--     unless you request a limit increase.
--
-- -   Scale a stream with more than 500 shards down unless you set this
--     value to less than 500 shards.
--
-- 'scalingType', 'updateShardCount_scalingType' - The scaling type. Uniform scaling creates shards of equal size.
newUpdateShardCount ::
  -- | 'streamName'
  Prelude.Text ->
  -- | 'targetShardCount'
  Prelude.Natural ->
  -- | 'scalingType'
  ScalingType ->
  UpdateShardCount
newUpdateShardCount :: Text -> Natural -> ScalingType -> UpdateShardCount
newUpdateShardCount
  Text
pStreamName_
  Natural
pTargetShardCount_
  ScalingType
pScalingType_ =
    UpdateShardCount' :: Text -> Natural -> ScalingType -> UpdateShardCount
UpdateShardCount'
      { $sel:streamName:UpdateShardCount' :: Text
streamName = Text
pStreamName_,
        $sel:targetShardCount:UpdateShardCount' :: Natural
targetShardCount = Natural
pTargetShardCount_,
        $sel:scalingType:UpdateShardCount' :: ScalingType
scalingType = ScalingType
pScalingType_
      }

-- | The name of the stream.
updateShardCount_streamName :: Lens.Lens' UpdateShardCount Prelude.Text
updateShardCount_streamName :: (Text -> f Text) -> UpdateShardCount -> f UpdateShardCount
updateShardCount_streamName = (UpdateShardCount -> Text)
-> (UpdateShardCount -> Text -> UpdateShardCount)
-> Lens UpdateShardCount UpdateShardCount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateShardCount' {Text
streamName :: Text
$sel:streamName:UpdateShardCount' :: UpdateShardCount -> Text
streamName} -> Text
streamName) (\s :: UpdateShardCount
s@UpdateShardCount' {} Text
a -> UpdateShardCount
s {$sel:streamName:UpdateShardCount' :: Text
streamName = Text
a} :: UpdateShardCount)

-- | The new number of shards. This value has the following default limits.
-- By default, you cannot do the following:
--
-- -   Set this value to more than double your current shard count for a
--     stream.
--
-- -   Set this value below half your current shard count for a stream.
--
-- -   Set this value to more than 500 shards in a stream (the default
--     limit for shard count per stream is 500 per account per region),
--     unless you request a limit increase.
--
-- -   Scale a stream with more than 500 shards down unless you set this
--     value to less than 500 shards.
updateShardCount_targetShardCount :: Lens.Lens' UpdateShardCount Prelude.Natural
updateShardCount_targetShardCount :: (Natural -> f Natural) -> UpdateShardCount -> f UpdateShardCount
updateShardCount_targetShardCount = (UpdateShardCount -> Natural)
-> (UpdateShardCount -> Natural -> UpdateShardCount)
-> Lens UpdateShardCount UpdateShardCount Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateShardCount' {Natural
targetShardCount :: Natural
$sel:targetShardCount:UpdateShardCount' :: UpdateShardCount -> Natural
targetShardCount} -> Natural
targetShardCount) (\s :: UpdateShardCount
s@UpdateShardCount' {} Natural
a -> UpdateShardCount
s {$sel:targetShardCount:UpdateShardCount' :: Natural
targetShardCount = Natural
a} :: UpdateShardCount)

-- | The scaling type. Uniform scaling creates shards of equal size.
updateShardCount_scalingType :: Lens.Lens' UpdateShardCount ScalingType
updateShardCount_scalingType :: (ScalingType -> f ScalingType)
-> UpdateShardCount -> f UpdateShardCount
updateShardCount_scalingType = (UpdateShardCount -> ScalingType)
-> (UpdateShardCount -> ScalingType -> UpdateShardCount)
-> Lens UpdateShardCount UpdateShardCount ScalingType ScalingType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateShardCount' {ScalingType
scalingType :: ScalingType
$sel:scalingType:UpdateShardCount' :: UpdateShardCount -> ScalingType
scalingType} -> ScalingType
scalingType) (\s :: UpdateShardCount
s@UpdateShardCount' {} ScalingType
a -> UpdateShardCount
s {$sel:scalingType:UpdateShardCount' :: ScalingType
scalingType = ScalingType
a} :: UpdateShardCount)

instance Core.AWSRequest UpdateShardCount where
  type
    AWSResponse UpdateShardCount =
      UpdateShardCountResponse
  request :: UpdateShardCount -> Request UpdateShardCount
request = Service -> UpdateShardCount -> Request UpdateShardCount
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateShardCount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateShardCount)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateShardCount))
-> Logger
-> Service
-> Proxy UpdateShardCount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateShardCount)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Natural
-> Maybe Text -> Maybe Natural -> Int -> UpdateShardCountResponse
UpdateShardCountResponse'
            (Maybe Natural
 -> Maybe Text -> Maybe Natural -> Int -> UpdateShardCountResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text -> Maybe Natural -> Int -> UpdateShardCountResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TargetShardCount")
            Either
  String
  (Maybe Text -> Maybe Natural -> Int -> UpdateShardCountResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Natural -> Int -> UpdateShardCountResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StreamName")
            Either String (Maybe Natural -> Int -> UpdateShardCountResponse)
-> Either String (Maybe Natural)
-> Either String (Int -> UpdateShardCountResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CurrentShardCount")
            Either String (Int -> UpdateShardCountResponse)
-> Either String Int -> Either String UpdateShardCountResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateShardCount

instance Prelude.NFData UpdateShardCount

instance Core.ToHeaders UpdateShardCount where
  toHeaders :: UpdateShardCount -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateShardCount -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Kinesis_20131202.UpdateShardCount" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateShardCount where
  toJSON :: UpdateShardCount -> Value
toJSON UpdateShardCount' {Natural
Text
ScalingType
scalingType :: ScalingType
targetShardCount :: Natural
streamName :: Text
$sel:scalingType:UpdateShardCount' :: UpdateShardCount -> ScalingType
$sel:targetShardCount:UpdateShardCount' :: UpdateShardCount -> Natural
$sel:streamName:UpdateShardCount' :: UpdateShardCount -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TargetShardCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
targetShardCount),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ScalingType" Text -> ScalingType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ScalingType
scalingType)
          ]
      )

instance Core.ToPath UpdateShardCount where
  toPath :: UpdateShardCount -> ByteString
toPath = ByteString -> UpdateShardCount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery UpdateShardCount where
  toQuery :: UpdateShardCount -> QueryString
toQuery = QueryString -> UpdateShardCount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateShardCountResponse' smart constructor.
data UpdateShardCountResponse = UpdateShardCountResponse'
  { -- | The updated number of shards.
    UpdateShardCountResponse -> Maybe Natural
targetShardCount :: Prelude.Maybe Prelude.Natural,
    -- | The name of the stream.
    UpdateShardCountResponse -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
    -- | The current number of shards.
    UpdateShardCountResponse -> Maybe Natural
currentShardCount :: Prelude.Maybe Prelude.Natural,
    -- | The response's http status code.
    UpdateShardCountResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateShardCountResponse -> UpdateShardCountResponse -> Bool
(UpdateShardCountResponse -> UpdateShardCountResponse -> Bool)
-> (UpdateShardCountResponse -> UpdateShardCountResponse -> Bool)
-> Eq UpdateShardCountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateShardCountResponse -> UpdateShardCountResponse -> Bool
$c/= :: UpdateShardCountResponse -> UpdateShardCountResponse -> Bool
== :: UpdateShardCountResponse -> UpdateShardCountResponse -> Bool
$c== :: UpdateShardCountResponse -> UpdateShardCountResponse -> Bool
Prelude.Eq, ReadPrec [UpdateShardCountResponse]
ReadPrec UpdateShardCountResponse
Int -> ReadS UpdateShardCountResponse
ReadS [UpdateShardCountResponse]
(Int -> ReadS UpdateShardCountResponse)
-> ReadS [UpdateShardCountResponse]
-> ReadPrec UpdateShardCountResponse
-> ReadPrec [UpdateShardCountResponse]
-> Read UpdateShardCountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateShardCountResponse]
$creadListPrec :: ReadPrec [UpdateShardCountResponse]
readPrec :: ReadPrec UpdateShardCountResponse
$creadPrec :: ReadPrec UpdateShardCountResponse
readList :: ReadS [UpdateShardCountResponse]
$creadList :: ReadS [UpdateShardCountResponse]
readsPrec :: Int -> ReadS UpdateShardCountResponse
$creadsPrec :: Int -> ReadS UpdateShardCountResponse
Prelude.Read, Int -> UpdateShardCountResponse -> ShowS
[UpdateShardCountResponse] -> ShowS
UpdateShardCountResponse -> String
(Int -> UpdateShardCountResponse -> ShowS)
-> (UpdateShardCountResponse -> String)
-> ([UpdateShardCountResponse] -> ShowS)
-> Show UpdateShardCountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateShardCountResponse] -> ShowS
$cshowList :: [UpdateShardCountResponse] -> ShowS
show :: UpdateShardCountResponse -> String
$cshow :: UpdateShardCountResponse -> String
showsPrec :: Int -> UpdateShardCountResponse -> ShowS
$cshowsPrec :: Int -> UpdateShardCountResponse -> ShowS
Prelude.Show, (forall x.
 UpdateShardCountResponse -> Rep UpdateShardCountResponse x)
-> (forall x.
    Rep UpdateShardCountResponse x -> UpdateShardCountResponse)
-> Generic UpdateShardCountResponse
forall x.
Rep UpdateShardCountResponse x -> UpdateShardCountResponse
forall x.
UpdateShardCountResponse -> Rep UpdateShardCountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateShardCountResponse x -> UpdateShardCountResponse
$cfrom :: forall x.
UpdateShardCountResponse -> Rep UpdateShardCountResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateShardCountResponse' 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:
--
-- 'targetShardCount', 'updateShardCountResponse_targetShardCount' - The updated number of shards.
--
-- 'streamName', 'updateShardCountResponse_streamName' - The name of the stream.
--
-- 'currentShardCount', 'updateShardCountResponse_currentShardCount' - The current number of shards.
--
-- 'httpStatus', 'updateShardCountResponse_httpStatus' - The response's http status code.
newUpdateShardCountResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateShardCountResponse
newUpdateShardCountResponse :: Int -> UpdateShardCountResponse
newUpdateShardCountResponse Int
pHttpStatus_ =
  UpdateShardCountResponse' :: Maybe Natural
-> Maybe Text -> Maybe Natural -> Int -> UpdateShardCountResponse
UpdateShardCountResponse'
    { $sel:targetShardCount:UpdateShardCountResponse' :: Maybe Natural
targetShardCount =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:UpdateShardCountResponse' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:currentShardCount:UpdateShardCountResponse' :: Maybe Natural
currentShardCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateShardCountResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The updated number of shards.
updateShardCountResponse_targetShardCount :: Lens.Lens' UpdateShardCountResponse (Prelude.Maybe Prelude.Natural)
updateShardCountResponse_targetShardCount :: (Maybe Natural -> f (Maybe Natural))
-> UpdateShardCountResponse -> f UpdateShardCountResponse
updateShardCountResponse_targetShardCount = (UpdateShardCountResponse -> Maybe Natural)
-> (UpdateShardCountResponse
    -> Maybe Natural -> UpdateShardCountResponse)
-> Lens
     UpdateShardCountResponse
     UpdateShardCountResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateShardCountResponse' {Maybe Natural
targetShardCount :: Maybe Natural
$sel:targetShardCount:UpdateShardCountResponse' :: UpdateShardCountResponse -> Maybe Natural
targetShardCount} -> Maybe Natural
targetShardCount) (\s :: UpdateShardCountResponse
s@UpdateShardCountResponse' {} Maybe Natural
a -> UpdateShardCountResponse
s {$sel:targetShardCount:UpdateShardCountResponse' :: Maybe Natural
targetShardCount = Maybe Natural
a} :: UpdateShardCountResponse)

-- | The name of the stream.
updateShardCountResponse_streamName :: Lens.Lens' UpdateShardCountResponse (Prelude.Maybe Prelude.Text)
updateShardCountResponse_streamName :: (Maybe Text -> f (Maybe Text))
-> UpdateShardCountResponse -> f UpdateShardCountResponse
updateShardCountResponse_streamName = (UpdateShardCountResponse -> Maybe Text)
-> (UpdateShardCountResponse
    -> Maybe Text -> UpdateShardCountResponse)
-> Lens
     UpdateShardCountResponse
     UpdateShardCountResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateShardCountResponse' {Maybe Text
streamName :: Maybe Text
$sel:streamName:UpdateShardCountResponse' :: UpdateShardCountResponse -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: UpdateShardCountResponse
s@UpdateShardCountResponse' {} Maybe Text
a -> UpdateShardCountResponse
s {$sel:streamName:UpdateShardCountResponse' :: Maybe Text
streamName = Maybe Text
a} :: UpdateShardCountResponse)

-- | The current number of shards.
updateShardCountResponse_currentShardCount :: Lens.Lens' UpdateShardCountResponse (Prelude.Maybe Prelude.Natural)
updateShardCountResponse_currentShardCount :: (Maybe Natural -> f (Maybe Natural))
-> UpdateShardCountResponse -> f UpdateShardCountResponse
updateShardCountResponse_currentShardCount = (UpdateShardCountResponse -> Maybe Natural)
-> (UpdateShardCountResponse
    -> Maybe Natural -> UpdateShardCountResponse)
-> Lens
     UpdateShardCountResponse
     UpdateShardCountResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateShardCountResponse' {Maybe Natural
currentShardCount :: Maybe Natural
$sel:currentShardCount:UpdateShardCountResponse' :: UpdateShardCountResponse -> Maybe Natural
currentShardCount} -> Maybe Natural
currentShardCount) (\s :: UpdateShardCountResponse
s@UpdateShardCountResponse' {} Maybe Natural
a -> UpdateShardCountResponse
s {$sel:currentShardCount:UpdateShardCountResponse' :: Maybe Natural
currentShardCount = Maybe Natural
a} :: UpdateShardCountResponse)

-- | The response's http status code.
updateShardCountResponse_httpStatus :: Lens.Lens' UpdateShardCountResponse Prelude.Int
updateShardCountResponse_httpStatus :: (Int -> f Int)
-> UpdateShardCountResponse -> f UpdateShardCountResponse
updateShardCountResponse_httpStatus = (UpdateShardCountResponse -> Int)
-> (UpdateShardCountResponse -> Int -> UpdateShardCountResponse)
-> Lens UpdateShardCountResponse UpdateShardCountResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateShardCountResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateShardCountResponse' :: UpdateShardCountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateShardCountResponse
s@UpdateShardCountResponse' {} Int
a -> UpdateShardCountResponse
s {$sel:httpStatus:UpdateShardCountResponse' :: Int
httpStatus = Int
a} :: UpdateShardCountResponse)

instance Prelude.NFData UpdateShardCountResponse