{-# 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.Lambda.PutProvisionedConcurrencyConfig
-- 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)
--
-- Adds a provisioned concurrency configuration to a function\'s alias or
-- version.
module Amazonka.Lambda.PutProvisionedConcurrencyConfig
  ( -- * Creating a Request
    PutProvisionedConcurrencyConfig (..),
    newPutProvisionedConcurrencyConfig,

    -- * Request Lenses
    putProvisionedConcurrencyConfig_functionName,
    putProvisionedConcurrencyConfig_qualifier,
    putProvisionedConcurrencyConfig_provisionedConcurrentExecutions,

    -- * Destructuring the Response
    PutProvisionedConcurrencyConfigResponse (..),
    newPutProvisionedConcurrencyConfigResponse,

    -- * Response Lenses
    putProvisionedConcurrencyConfigResponse_status,
    putProvisionedConcurrencyConfigResponse_requestedProvisionedConcurrentExecutions,
    putProvisionedConcurrencyConfigResponse_availableProvisionedConcurrentExecutions,
    putProvisionedConcurrencyConfigResponse_statusReason,
    putProvisionedConcurrencyConfigResponse_allocatedProvisionedConcurrentExecutions,
    putProvisionedConcurrencyConfigResponse_lastModified,
    putProvisionedConcurrencyConfigResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Lambda.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:/ 'newPutProvisionedConcurrencyConfig' smart constructor.
data PutProvisionedConcurrencyConfig = PutProvisionedConcurrencyConfig'
  { -- | The name of the Lambda function.
    --
    -- __Name formats__
    --
    -- -   __Function name__ - @my-function@.
    --
    -- -   __Function ARN__ -
    --     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
    --
    -- -   __Partial ARN__ - @123456789012:function:my-function@.
    --
    -- The length constraint applies only to the full ARN. If you specify only
    -- the function name, it is limited to 64 characters in length.
    PutProvisionedConcurrencyConfig -> Text
functionName :: Prelude.Text,
    -- | The version number or alias name.
    PutProvisionedConcurrencyConfig -> Text
qualifier :: Prelude.Text,
    -- | The amount of provisioned concurrency to allocate for the version or
    -- alias.
    PutProvisionedConcurrencyConfig -> Natural
provisionedConcurrentExecutions :: Prelude.Natural
  }
  deriving (PutProvisionedConcurrencyConfig
-> PutProvisionedConcurrencyConfig -> Bool
(PutProvisionedConcurrencyConfig
 -> PutProvisionedConcurrencyConfig -> Bool)
-> (PutProvisionedConcurrencyConfig
    -> PutProvisionedConcurrencyConfig -> Bool)
-> Eq PutProvisionedConcurrencyConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutProvisionedConcurrencyConfig
-> PutProvisionedConcurrencyConfig -> Bool
$c/= :: PutProvisionedConcurrencyConfig
-> PutProvisionedConcurrencyConfig -> Bool
== :: PutProvisionedConcurrencyConfig
-> PutProvisionedConcurrencyConfig -> Bool
$c== :: PutProvisionedConcurrencyConfig
-> PutProvisionedConcurrencyConfig -> Bool
Prelude.Eq, ReadPrec [PutProvisionedConcurrencyConfig]
ReadPrec PutProvisionedConcurrencyConfig
Int -> ReadS PutProvisionedConcurrencyConfig
ReadS [PutProvisionedConcurrencyConfig]
(Int -> ReadS PutProvisionedConcurrencyConfig)
-> ReadS [PutProvisionedConcurrencyConfig]
-> ReadPrec PutProvisionedConcurrencyConfig
-> ReadPrec [PutProvisionedConcurrencyConfig]
-> Read PutProvisionedConcurrencyConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutProvisionedConcurrencyConfig]
$creadListPrec :: ReadPrec [PutProvisionedConcurrencyConfig]
readPrec :: ReadPrec PutProvisionedConcurrencyConfig
$creadPrec :: ReadPrec PutProvisionedConcurrencyConfig
readList :: ReadS [PutProvisionedConcurrencyConfig]
$creadList :: ReadS [PutProvisionedConcurrencyConfig]
readsPrec :: Int -> ReadS PutProvisionedConcurrencyConfig
$creadsPrec :: Int -> ReadS PutProvisionedConcurrencyConfig
Prelude.Read, Int -> PutProvisionedConcurrencyConfig -> ShowS
[PutProvisionedConcurrencyConfig] -> ShowS
PutProvisionedConcurrencyConfig -> String
(Int -> PutProvisionedConcurrencyConfig -> ShowS)
-> (PutProvisionedConcurrencyConfig -> String)
-> ([PutProvisionedConcurrencyConfig] -> ShowS)
-> Show PutProvisionedConcurrencyConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutProvisionedConcurrencyConfig] -> ShowS
$cshowList :: [PutProvisionedConcurrencyConfig] -> ShowS
show :: PutProvisionedConcurrencyConfig -> String
$cshow :: PutProvisionedConcurrencyConfig -> String
showsPrec :: Int -> PutProvisionedConcurrencyConfig -> ShowS
$cshowsPrec :: Int -> PutProvisionedConcurrencyConfig -> ShowS
Prelude.Show, (forall x.
 PutProvisionedConcurrencyConfig
 -> Rep PutProvisionedConcurrencyConfig x)
-> (forall x.
    Rep PutProvisionedConcurrencyConfig x
    -> PutProvisionedConcurrencyConfig)
-> Generic PutProvisionedConcurrencyConfig
forall x.
Rep PutProvisionedConcurrencyConfig x
-> PutProvisionedConcurrencyConfig
forall x.
PutProvisionedConcurrencyConfig
-> Rep PutProvisionedConcurrencyConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutProvisionedConcurrencyConfig x
-> PutProvisionedConcurrencyConfig
$cfrom :: forall x.
PutProvisionedConcurrencyConfig
-> Rep PutProvisionedConcurrencyConfig x
Prelude.Generic)

-- |
-- Create a value of 'PutProvisionedConcurrencyConfig' 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:
--
-- 'functionName', 'putProvisionedConcurrencyConfig_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
--
-- 'qualifier', 'putProvisionedConcurrencyConfig_qualifier' - The version number or alias name.
--
-- 'provisionedConcurrentExecutions', 'putProvisionedConcurrencyConfig_provisionedConcurrentExecutions' - The amount of provisioned concurrency to allocate for the version or
-- alias.
newPutProvisionedConcurrencyConfig ::
  -- | 'functionName'
  Prelude.Text ->
  -- | 'qualifier'
  Prelude.Text ->
  -- | 'provisionedConcurrentExecutions'
  Prelude.Natural ->
  PutProvisionedConcurrencyConfig
newPutProvisionedConcurrencyConfig :: Text -> Text -> Natural -> PutProvisionedConcurrencyConfig
newPutProvisionedConcurrencyConfig
  Text
pFunctionName_
  Text
pQualifier_
  Natural
pProvisionedConcurrentExecutions_ =
    PutProvisionedConcurrencyConfig' :: Text -> Text -> Natural -> PutProvisionedConcurrencyConfig
PutProvisionedConcurrencyConfig'
      { $sel:functionName:PutProvisionedConcurrencyConfig' :: Text
functionName =
          Text
pFunctionName_,
        $sel:qualifier:PutProvisionedConcurrencyConfig' :: Text
qualifier = Text
pQualifier_,
        $sel:provisionedConcurrentExecutions:PutProvisionedConcurrencyConfig' :: Natural
provisionedConcurrentExecutions =
          Natural
pProvisionedConcurrentExecutions_
      }

-- | The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
putProvisionedConcurrencyConfig_functionName :: Lens.Lens' PutProvisionedConcurrencyConfig Prelude.Text
putProvisionedConcurrencyConfig_functionName :: (Text -> f Text)
-> PutProvisionedConcurrencyConfig
-> f PutProvisionedConcurrencyConfig
putProvisionedConcurrencyConfig_functionName = (PutProvisionedConcurrencyConfig -> Text)
-> (PutProvisionedConcurrencyConfig
    -> Text -> PutProvisionedConcurrencyConfig)
-> Lens
     PutProvisionedConcurrencyConfig
     PutProvisionedConcurrencyConfig
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfig' {Text
functionName :: Text
$sel:functionName:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Text
functionName} -> Text
functionName) (\s :: PutProvisionedConcurrencyConfig
s@PutProvisionedConcurrencyConfig' {} Text
a -> PutProvisionedConcurrencyConfig
s {$sel:functionName:PutProvisionedConcurrencyConfig' :: Text
functionName = Text
a} :: PutProvisionedConcurrencyConfig)

-- | The version number or alias name.
putProvisionedConcurrencyConfig_qualifier :: Lens.Lens' PutProvisionedConcurrencyConfig Prelude.Text
putProvisionedConcurrencyConfig_qualifier :: (Text -> f Text)
-> PutProvisionedConcurrencyConfig
-> f PutProvisionedConcurrencyConfig
putProvisionedConcurrencyConfig_qualifier = (PutProvisionedConcurrencyConfig -> Text)
-> (PutProvisionedConcurrencyConfig
    -> Text -> PutProvisionedConcurrencyConfig)
-> Lens
     PutProvisionedConcurrencyConfig
     PutProvisionedConcurrencyConfig
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfig' {Text
qualifier :: Text
$sel:qualifier:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Text
qualifier} -> Text
qualifier) (\s :: PutProvisionedConcurrencyConfig
s@PutProvisionedConcurrencyConfig' {} Text
a -> PutProvisionedConcurrencyConfig
s {$sel:qualifier:PutProvisionedConcurrencyConfig' :: Text
qualifier = Text
a} :: PutProvisionedConcurrencyConfig)

-- | The amount of provisioned concurrency to allocate for the version or
-- alias.
putProvisionedConcurrencyConfig_provisionedConcurrentExecutions :: Lens.Lens' PutProvisionedConcurrencyConfig Prelude.Natural
putProvisionedConcurrencyConfig_provisionedConcurrentExecutions :: (Natural -> f Natural)
-> PutProvisionedConcurrencyConfig
-> f PutProvisionedConcurrencyConfig
putProvisionedConcurrencyConfig_provisionedConcurrentExecutions = (PutProvisionedConcurrencyConfig -> Natural)
-> (PutProvisionedConcurrencyConfig
    -> Natural -> PutProvisionedConcurrencyConfig)
-> Lens
     PutProvisionedConcurrencyConfig
     PutProvisionedConcurrencyConfig
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfig' {Natural
provisionedConcurrentExecutions :: Natural
$sel:provisionedConcurrentExecutions:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Natural
provisionedConcurrentExecutions} -> Natural
provisionedConcurrentExecutions) (\s :: PutProvisionedConcurrencyConfig
s@PutProvisionedConcurrencyConfig' {} Natural
a -> PutProvisionedConcurrencyConfig
s {$sel:provisionedConcurrentExecutions:PutProvisionedConcurrencyConfig' :: Natural
provisionedConcurrentExecutions = Natural
a} :: PutProvisionedConcurrencyConfig)

instance
  Core.AWSRequest
    PutProvisionedConcurrencyConfig
  where
  type
    AWSResponse PutProvisionedConcurrencyConfig =
      PutProvisionedConcurrencyConfigResponse
  request :: PutProvisionedConcurrencyConfig
-> Request PutProvisionedConcurrencyConfig
request = Service
-> PutProvisionedConcurrencyConfig
-> Request PutProvisionedConcurrencyConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutProvisionedConcurrencyConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutProvisionedConcurrencyConfig)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutProvisionedConcurrencyConfig))
-> Logger
-> Service
-> Proxy PutProvisionedConcurrencyConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutProvisionedConcurrencyConfig)))
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 ProvisionedConcurrencyStatusEnum
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Int
-> PutProvisionedConcurrencyConfigResponse
PutProvisionedConcurrencyConfigResponse'
            (Maybe ProvisionedConcurrencyStatusEnum
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Int
 -> PutProvisionedConcurrencyConfigResponse)
-> Either String (Maybe ProvisionedConcurrencyStatusEnum)
-> Either
     String
     (Maybe Natural
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> PutProvisionedConcurrencyConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe ProvisionedConcurrencyStatusEnum)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe Natural
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> PutProvisionedConcurrencyConfigResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> PutProvisionedConcurrencyConfigResponse)
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
"RequestedProvisionedConcurrentExecutions"
                        )
            Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> PutProvisionedConcurrencyConfigResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> PutProvisionedConcurrencyConfigResponse)
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
"AvailableProvisionedConcurrentExecutions"
                        )
            Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> PutProvisionedConcurrencyConfigResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Text -> Int -> PutProvisionedConcurrencyConfigResponse)
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
"StatusReason")
            Either
  String
  (Maybe Natural
   -> Maybe Text -> Int -> PutProvisionedConcurrencyConfigResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text -> Int -> PutProvisionedConcurrencyConfigResponse)
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
"AllocatedProvisionedConcurrentExecutions"
                        )
            Either
  String
  (Maybe Text -> Int -> PutProvisionedConcurrencyConfigResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PutProvisionedConcurrencyConfigResponse)
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
"LastModified")
            Either String (Int -> PutProvisionedConcurrencyConfigResponse)
-> Either String Int
-> Either String PutProvisionedConcurrencyConfigResponse
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
    PutProvisionedConcurrencyConfig

instance
  Prelude.NFData
    PutProvisionedConcurrencyConfig

instance
  Core.ToHeaders
    PutProvisionedConcurrencyConfig
  where
  toHeaders :: PutProvisionedConcurrencyConfig -> ResponseHeaders
toHeaders = ResponseHeaders
-> PutProvisionedConcurrencyConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON PutProvisionedConcurrencyConfig where
  toJSON :: PutProvisionedConcurrencyConfig -> Value
toJSON PutProvisionedConcurrencyConfig' {Natural
Text
provisionedConcurrentExecutions :: Natural
qualifier :: Text
functionName :: Text
$sel:provisionedConcurrentExecutions:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Natural
$sel:qualifier:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Text
$sel:functionName:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> 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
"ProvisionedConcurrentExecutions"
                  Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
provisionedConcurrentExecutions
              )
          ]
      )

instance Core.ToPath PutProvisionedConcurrencyConfig where
  toPath :: PutProvisionedConcurrencyConfig -> ByteString
toPath PutProvisionedConcurrencyConfig' {Natural
Text
provisionedConcurrentExecutions :: Natural
qualifier :: Text
functionName :: Text
$sel:provisionedConcurrentExecutions:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Natural
$sel:qualifier:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Text
$sel:functionName:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2019-09-30/functions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
functionName,
        ByteString
"/provisioned-concurrency"
      ]

instance Core.ToQuery PutProvisionedConcurrencyConfig where
  toQuery :: PutProvisionedConcurrencyConfig -> QueryString
toQuery PutProvisionedConcurrencyConfig' {Natural
Text
provisionedConcurrentExecutions :: Natural
qualifier :: Text
functionName :: Text
$sel:provisionedConcurrentExecutions:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Natural
$sel:qualifier:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Text
$sel:functionName:PutProvisionedConcurrencyConfig' :: PutProvisionedConcurrencyConfig -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
qualifier]

-- | /See:/ 'newPutProvisionedConcurrencyConfigResponse' smart constructor.
data PutProvisionedConcurrencyConfigResponse = PutProvisionedConcurrencyConfigResponse'
  { -- | The status of the allocation process.
    PutProvisionedConcurrencyConfigResponse
-> Maybe ProvisionedConcurrencyStatusEnum
status :: Prelude.Maybe ProvisionedConcurrencyStatusEnum,
    -- | The amount of provisioned concurrency requested.
    PutProvisionedConcurrencyConfigResponse -> Maybe Natural
requestedProvisionedConcurrentExecutions :: Prelude.Maybe Prelude.Natural,
    -- | The amount of provisioned concurrency available.
    PutProvisionedConcurrencyConfigResponse -> Maybe Natural
availableProvisionedConcurrentExecutions :: Prelude.Maybe Prelude.Natural,
    -- | For failed allocations, the reason that provisioned concurrency could
    -- not be allocated.
    PutProvisionedConcurrencyConfigResponse -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | The amount of provisioned concurrency allocated.
    PutProvisionedConcurrencyConfigResponse -> Maybe Natural
allocatedProvisionedConcurrentExecutions :: Prelude.Maybe Prelude.Natural,
    -- | The date and time that a user last updated the configuration, in
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601 format>.
    PutProvisionedConcurrencyConfigResponse -> Maybe Text
lastModified :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    PutProvisionedConcurrencyConfigResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutProvisionedConcurrencyConfigResponse
-> PutProvisionedConcurrencyConfigResponse -> Bool
(PutProvisionedConcurrencyConfigResponse
 -> PutProvisionedConcurrencyConfigResponse -> Bool)
-> (PutProvisionedConcurrencyConfigResponse
    -> PutProvisionedConcurrencyConfigResponse -> Bool)
-> Eq PutProvisionedConcurrencyConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutProvisionedConcurrencyConfigResponse
-> PutProvisionedConcurrencyConfigResponse -> Bool
$c/= :: PutProvisionedConcurrencyConfigResponse
-> PutProvisionedConcurrencyConfigResponse -> Bool
== :: PutProvisionedConcurrencyConfigResponse
-> PutProvisionedConcurrencyConfigResponse -> Bool
$c== :: PutProvisionedConcurrencyConfigResponse
-> PutProvisionedConcurrencyConfigResponse -> Bool
Prelude.Eq, ReadPrec [PutProvisionedConcurrencyConfigResponse]
ReadPrec PutProvisionedConcurrencyConfigResponse
Int -> ReadS PutProvisionedConcurrencyConfigResponse
ReadS [PutProvisionedConcurrencyConfigResponse]
(Int -> ReadS PutProvisionedConcurrencyConfigResponse)
-> ReadS [PutProvisionedConcurrencyConfigResponse]
-> ReadPrec PutProvisionedConcurrencyConfigResponse
-> ReadPrec [PutProvisionedConcurrencyConfigResponse]
-> Read PutProvisionedConcurrencyConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutProvisionedConcurrencyConfigResponse]
$creadListPrec :: ReadPrec [PutProvisionedConcurrencyConfigResponse]
readPrec :: ReadPrec PutProvisionedConcurrencyConfigResponse
$creadPrec :: ReadPrec PutProvisionedConcurrencyConfigResponse
readList :: ReadS [PutProvisionedConcurrencyConfigResponse]
$creadList :: ReadS [PutProvisionedConcurrencyConfigResponse]
readsPrec :: Int -> ReadS PutProvisionedConcurrencyConfigResponse
$creadsPrec :: Int -> ReadS PutProvisionedConcurrencyConfigResponse
Prelude.Read, Int -> PutProvisionedConcurrencyConfigResponse -> ShowS
[PutProvisionedConcurrencyConfigResponse] -> ShowS
PutProvisionedConcurrencyConfigResponse -> String
(Int -> PutProvisionedConcurrencyConfigResponse -> ShowS)
-> (PutProvisionedConcurrencyConfigResponse -> String)
-> ([PutProvisionedConcurrencyConfigResponse] -> ShowS)
-> Show PutProvisionedConcurrencyConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutProvisionedConcurrencyConfigResponse] -> ShowS
$cshowList :: [PutProvisionedConcurrencyConfigResponse] -> ShowS
show :: PutProvisionedConcurrencyConfigResponse -> String
$cshow :: PutProvisionedConcurrencyConfigResponse -> String
showsPrec :: Int -> PutProvisionedConcurrencyConfigResponse -> ShowS
$cshowsPrec :: Int -> PutProvisionedConcurrencyConfigResponse -> ShowS
Prelude.Show, (forall x.
 PutProvisionedConcurrencyConfigResponse
 -> Rep PutProvisionedConcurrencyConfigResponse x)
-> (forall x.
    Rep PutProvisionedConcurrencyConfigResponse x
    -> PutProvisionedConcurrencyConfigResponse)
-> Generic PutProvisionedConcurrencyConfigResponse
forall x.
Rep PutProvisionedConcurrencyConfigResponse x
-> PutProvisionedConcurrencyConfigResponse
forall x.
PutProvisionedConcurrencyConfigResponse
-> Rep PutProvisionedConcurrencyConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutProvisionedConcurrencyConfigResponse x
-> PutProvisionedConcurrencyConfigResponse
$cfrom :: forall x.
PutProvisionedConcurrencyConfigResponse
-> Rep PutProvisionedConcurrencyConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutProvisionedConcurrencyConfigResponse' 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:
--
-- 'status', 'putProvisionedConcurrencyConfigResponse_status' - The status of the allocation process.
--
-- 'requestedProvisionedConcurrentExecutions', 'putProvisionedConcurrencyConfigResponse_requestedProvisionedConcurrentExecutions' - The amount of provisioned concurrency requested.
--
-- 'availableProvisionedConcurrentExecutions', 'putProvisionedConcurrencyConfigResponse_availableProvisionedConcurrentExecutions' - The amount of provisioned concurrency available.
--
-- 'statusReason', 'putProvisionedConcurrencyConfigResponse_statusReason' - For failed allocations, the reason that provisioned concurrency could
-- not be allocated.
--
-- 'allocatedProvisionedConcurrentExecutions', 'putProvisionedConcurrencyConfigResponse_allocatedProvisionedConcurrentExecutions' - The amount of provisioned concurrency allocated.
--
-- 'lastModified', 'putProvisionedConcurrencyConfigResponse_lastModified' - The date and time that a user last updated the configuration, in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601 format>.
--
-- 'httpStatus', 'putProvisionedConcurrencyConfigResponse_httpStatus' - The response's http status code.
newPutProvisionedConcurrencyConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutProvisionedConcurrencyConfigResponse
newPutProvisionedConcurrencyConfigResponse :: Int -> PutProvisionedConcurrencyConfigResponse
newPutProvisionedConcurrencyConfigResponse
  Int
pHttpStatus_ =
    PutProvisionedConcurrencyConfigResponse' :: Maybe ProvisionedConcurrencyStatusEnum
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Int
-> PutProvisionedConcurrencyConfigResponse
PutProvisionedConcurrencyConfigResponse'
      { $sel:status:PutProvisionedConcurrencyConfigResponse' :: Maybe ProvisionedConcurrencyStatusEnum
status =
          Maybe ProvisionedConcurrencyStatusEnum
forall a. Maybe a
Prelude.Nothing,
        $sel:requestedProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: Maybe Natural
requestedProvisionedConcurrentExecutions =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:availableProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: Maybe Natural
availableProvisionedConcurrentExecutions =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:statusReason:PutProvisionedConcurrencyConfigResponse' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:allocatedProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: Maybe Natural
allocatedProvisionedConcurrentExecutions =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:lastModified:PutProvisionedConcurrencyConfigResponse' :: Maybe Text
lastModified = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:PutProvisionedConcurrencyConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The status of the allocation process.
putProvisionedConcurrencyConfigResponse_status :: Lens.Lens' PutProvisionedConcurrencyConfigResponse (Prelude.Maybe ProvisionedConcurrencyStatusEnum)
putProvisionedConcurrencyConfigResponse_status :: (Maybe ProvisionedConcurrencyStatusEnum
 -> f (Maybe ProvisionedConcurrencyStatusEnum))
-> PutProvisionedConcurrencyConfigResponse
-> f PutProvisionedConcurrencyConfigResponse
putProvisionedConcurrencyConfigResponse_status = (PutProvisionedConcurrencyConfigResponse
 -> Maybe ProvisionedConcurrencyStatusEnum)
-> (PutProvisionedConcurrencyConfigResponse
    -> Maybe ProvisionedConcurrencyStatusEnum
    -> PutProvisionedConcurrencyConfigResponse)
-> Lens
     PutProvisionedConcurrencyConfigResponse
     PutProvisionedConcurrencyConfigResponse
     (Maybe ProvisionedConcurrencyStatusEnum)
     (Maybe ProvisionedConcurrencyStatusEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfigResponse' {Maybe ProvisionedConcurrencyStatusEnum
status :: Maybe ProvisionedConcurrencyStatusEnum
$sel:status:PutProvisionedConcurrencyConfigResponse' :: PutProvisionedConcurrencyConfigResponse
-> Maybe ProvisionedConcurrencyStatusEnum
status} -> Maybe ProvisionedConcurrencyStatusEnum
status) (\s :: PutProvisionedConcurrencyConfigResponse
s@PutProvisionedConcurrencyConfigResponse' {} Maybe ProvisionedConcurrencyStatusEnum
a -> PutProvisionedConcurrencyConfigResponse
s {$sel:status:PutProvisionedConcurrencyConfigResponse' :: Maybe ProvisionedConcurrencyStatusEnum
status = Maybe ProvisionedConcurrencyStatusEnum
a} :: PutProvisionedConcurrencyConfigResponse)

-- | The amount of provisioned concurrency requested.
putProvisionedConcurrencyConfigResponse_requestedProvisionedConcurrentExecutions :: Lens.Lens' PutProvisionedConcurrencyConfigResponse (Prelude.Maybe Prelude.Natural)
putProvisionedConcurrencyConfigResponse_requestedProvisionedConcurrentExecutions :: (Maybe Natural -> f (Maybe Natural))
-> PutProvisionedConcurrencyConfigResponse
-> f PutProvisionedConcurrencyConfigResponse
putProvisionedConcurrencyConfigResponse_requestedProvisionedConcurrentExecutions = (PutProvisionedConcurrencyConfigResponse -> Maybe Natural)
-> (PutProvisionedConcurrencyConfigResponse
    -> Maybe Natural -> PutProvisionedConcurrencyConfigResponse)
-> Lens
     PutProvisionedConcurrencyConfigResponse
     PutProvisionedConcurrencyConfigResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfigResponse' {Maybe Natural
requestedProvisionedConcurrentExecutions :: Maybe Natural
$sel:requestedProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: PutProvisionedConcurrencyConfigResponse -> Maybe Natural
requestedProvisionedConcurrentExecutions} -> Maybe Natural
requestedProvisionedConcurrentExecutions) (\s :: PutProvisionedConcurrencyConfigResponse
s@PutProvisionedConcurrencyConfigResponse' {} Maybe Natural
a -> PutProvisionedConcurrencyConfigResponse
s {$sel:requestedProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: Maybe Natural
requestedProvisionedConcurrentExecutions = Maybe Natural
a} :: PutProvisionedConcurrencyConfigResponse)

-- | The amount of provisioned concurrency available.
putProvisionedConcurrencyConfigResponse_availableProvisionedConcurrentExecutions :: Lens.Lens' PutProvisionedConcurrencyConfigResponse (Prelude.Maybe Prelude.Natural)
putProvisionedConcurrencyConfigResponse_availableProvisionedConcurrentExecutions :: (Maybe Natural -> f (Maybe Natural))
-> PutProvisionedConcurrencyConfigResponse
-> f PutProvisionedConcurrencyConfigResponse
putProvisionedConcurrencyConfigResponse_availableProvisionedConcurrentExecutions = (PutProvisionedConcurrencyConfigResponse -> Maybe Natural)
-> (PutProvisionedConcurrencyConfigResponse
    -> Maybe Natural -> PutProvisionedConcurrencyConfigResponse)
-> Lens
     PutProvisionedConcurrencyConfigResponse
     PutProvisionedConcurrencyConfigResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfigResponse' {Maybe Natural
availableProvisionedConcurrentExecutions :: Maybe Natural
$sel:availableProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: PutProvisionedConcurrencyConfigResponse -> Maybe Natural
availableProvisionedConcurrentExecutions} -> Maybe Natural
availableProvisionedConcurrentExecutions) (\s :: PutProvisionedConcurrencyConfigResponse
s@PutProvisionedConcurrencyConfigResponse' {} Maybe Natural
a -> PutProvisionedConcurrencyConfigResponse
s {$sel:availableProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: Maybe Natural
availableProvisionedConcurrentExecutions = Maybe Natural
a} :: PutProvisionedConcurrencyConfigResponse)

-- | For failed allocations, the reason that provisioned concurrency could
-- not be allocated.
putProvisionedConcurrencyConfigResponse_statusReason :: Lens.Lens' PutProvisionedConcurrencyConfigResponse (Prelude.Maybe Prelude.Text)
putProvisionedConcurrencyConfigResponse_statusReason :: (Maybe Text -> f (Maybe Text))
-> PutProvisionedConcurrencyConfigResponse
-> f PutProvisionedConcurrencyConfigResponse
putProvisionedConcurrencyConfigResponse_statusReason = (PutProvisionedConcurrencyConfigResponse -> Maybe Text)
-> (PutProvisionedConcurrencyConfigResponse
    -> Maybe Text -> PutProvisionedConcurrencyConfigResponse)
-> Lens
     PutProvisionedConcurrencyConfigResponse
     PutProvisionedConcurrencyConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfigResponse' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:PutProvisionedConcurrencyConfigResponse' :: PutProvisionedConcurrencyConfigResponse -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: PutProvisionedConcurrencyConfigResponse
s@PutProvisionedConcurrencyConfigResponse' {} Maybe Text
a -> PutProvisionedConcurrencyConfigResponse
s {$sel:statusReason:PutProvisionedConcurrencyConfigResponse' :: Maybe Text
statusReason = Maybe Text
a} :: PutProvisionedConcurrencyConfigResponse)

-- | The amount of provisioned concurrency allocated.
putProvisionedConcurrencyConfigResponse_allocatedProvisionedConcurrentExecutions :: Lens.Lens' PutProvisionedConcurrencyConfigResponse (Prelude.Maybe Prelude.Natural)
putProvisionedConcurrencyConfigResponse_allocatedProvisionedConcurrentExecutions :: (Maybe Natural -> f (Maybe Natural))
-> PutProvisionedConcurrencyConfigResponse
-> f PutProvisionedConcurrencyConfigResponse
putProvisionedConcurrencyConfigResponse_allocatedProvisionedConcurrentExecutions = (PutProvisionedConcurrencyConfigResponse -> Maybe Natural)
-> (PutProvisionedConcurrencyConfigResponse
    -> Maybe Natural -> PutProvisionedConcurrencyConfigResponse)
-> Lens
     PutProvisionedConcurrencyConfigResponse
     PutProvisionedConcurrencyConfigResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfigResponse' {Maybe Natural
allocatedProvisionedConcurrentExecutions :: Maybe Natural
$sel:allocatedProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: PutProvisionedConcurrencyConfigResponse -> Maybe Natural
allocatedProvisionedConcurrentExecutions} -> Maybe Natural
allocatedProvisionedConcurrentExecutions) (\s :: PutProvisionedConcurrencyConfigResponse
s@PutProvisionedConcurrencyConfigResponse' {} Maybe Natural
a -> PutProvisionedConcurrencyConfigResponse
s {$sel:allocatedProvisionedConcurrentExecutions:PutProvisionedConcurrencyConfigResponse' :: Maybe Natural
allocatedProvisionedConcurrentExecutions = Maybe Natural
a} :: PutProvisionedConcurrencyConfigResponse)

-- | The date and time that a user last updated the configuration, in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601 format>.
putProvisionedConcurrencyConfigResponse_lastModified :: Lens.Lens' PutProvisionedConcurrencyConfigResponse (Prelude.Maybe Prelude.Text)
putProvisionedConcurrencyConfigResponse_lastModified :: (Maybe Text -> f (Maybe Text))
-> PutProvisionedConcurrencyConfigResponse
-> f PutProvisionedConcurrencyConfigResponse
putProvisionedConcurrencyConfigResponse_lastModified = (PutProvisionedConcurrencyConfigResponse -> Maybe Text)
-> (PutProvisionedConcurrencyConfigResponse
    -> Maybe Text -> PutProvisionedConcurrencyConfigResponse)
-> Lens
     PutProvisionedConcurrencyConfigResponse
     PutProvisionedConcurrencyConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutProvisionedConcurrencyConfigResponse' {Maybe Text
lastModified :: Maybe Text
$sel:lastModified:PutProvisionedConcurrencyConfigResponse' :: PutProvisionedConcurrencyConfigResponse -> Maybe Text
lastModified} -> Maybe Text
lastModified) (\s :: PutProvisionedConcurrencyConfigResponse
s@PutProvisionedConcurrencyConfigResponse' {} Maybe Text
a -> PutProvisionedConcurrencyConfigResponse
s {$sel:lastModified:PutProvisionedConcurrencyConfigResponse' :: Maybe Text
lastModified = Maybe Text
a} :: PutProvisionedConcurrencyConfigResponse)

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

instance
  Prelude.NFData
    PutProvisionedConcurrencyConfigResponse