{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Lambda.PutFunctionConcurrency
(
putFunctionConcurrency
, PutFunctionConcurrency
, pfcFunctionName
, pfcReservedConcurrentExecutions
, concurrency
, Concurrency
, cReservedConcurrentExecutions
) where
import Network.AWS.Lambda.Types
import Network.AWS.Lambda.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data PutFunctionConcurrency = PutFunctionConcurrency'
{ _pfcFunctionName :: !Text
, _pfcReservedConcurrentExecutions :: !Nat
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putFunctionConcurrency
:: Text
-> Natural
-> PutFunctionConcurrency
putFunctionConcurrency pFunctionName_ pReservedConcurrentExecutions_ =
PutFunctionConcurrency'
{ _pfcFunctionName = pFunctionName_
, _pfcReservedConcurrentExecutions = _Nat # pReservedConcurrentExecutions_
}
pfcFunctionName :: Lens' PutFunctionConcurrency Text
pfcFunctionName = lens _pfcFunctionName (\ s a -> s{_pfcFunctionName = a})
pfcReservedConcurrentExecutions :: Lens' PutFunctionConcurrency Natural
pfcReservedConcurrentExecutions = lens _pfcReservedConcurrentExecutions (\ s a -> s{_pfcReservedConcurrentExecutions = a}) . _Nat
instance AWSRequest PutFunctionConcurrency where
type Rs PutFunctionConcurrency = Concurrency
request = putJSON lambda
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable PutFunctionConcurrency where
instance NFData PutFunctionConcurrency where
instance ToHeaders PutFunctionConcurrency where
toHeaders = const mempty
instance ToJSON PutFunctionConcurrency where
toJSON PutFunctionConcurrency'{..}
= object
(catMaybes
[Just
("ReservedConcurrentExecutions" .=
_pfcReservedConcurrentExecutions)])
instance ToPath PutFunctionConcurrency where
toPath PutFunctionConcurrency'{..}
= mconcat
["/2017-10-31/functions/", toBS _pfcFunctionName,
"/concurrency"]
instance ToQuery PutFunctionConcurrency where
toQuery = const mempty