{-# 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 #-}
module Amazonka.Lambda.GetFunctionConcurrency
(
GetFunctionConcurrency (..),
newGetFunctionConcurrency,
getFunctionConcurrency_functionName,
GetFunctionConcurrencyResponse (..),
newGetFunctionConcurrencyResponse,
getFunctionConcurrencyResponse_reservedConcurrentExecutions,
getFunctionConcurrencyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetFunctionConcurrency = GetFunctionConcurrency'
{
GetFunctionConcurrency -> Text
functionName :: Prelude.Text
}
deriving (GetFunctionConcurrency -> GetFunctionConcurrency -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFunctionConcurrency -> GetFunctionConcurrency -> Bool
$c/= :: GetFunctionConcurrency -> GetFunctionConcurrency -> Bool
== :: GetFunctionConcurrency -> GetFunctionConcurrency -> Bool
$c== :: GetFunctionConcurrency -> GetFunctionConcurrency -> Bool
Prelude.Eq, ReadPrec [GetFunctionConcurrency]
ReadPrec GetFunctionConcurrency
Int -> ReadS GetFunctionConcurrency
ReadS [GetFunctionConcurrency]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFunctionConcurrency]
$creadListPrec :: ReadPrec [GetFunctionConcurrency]
readPrec :: ReadPrec GetFunctionConcurrency
$creadPrec :: ReadPrec GetFunctionConcurrency
readList :: ReadS [GetFunctionConcurrency]
$creadList :: ReadS [GetFunctionConcurrency]
readsPrec :: Int -> ReadS GetFunctionConcurrency
$creadsPrec :: Int -> ReadS GetFunctionConcurrency
Prelude.Read, Int -> GetFunctionConcurrency -> ShowS
[GetFunctionConcurrency] -> ShowS
GetFunctionConcurrency -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFunctionConcurrency] -> ShowS
$cshowList :: [GetFunctionConcurrency] -> ShowS
show :: GetFunctionConcurrency -> String
$cshow :: GetFunctionConcurrency -> String
showsPrec :: Int -> GetFunctionConcurrency -> ShowS
$cshowsPrec :: Int -> GetFunctionConcurrency -> ShowS
Prelude.Show, forall x. Rep GetFunctionConcurrency x -> GetFunctionConcurrency
forall x. GetFunctionConcurrency -> Rep GetFunctionConcurrency x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetFunctionConcurrency x -> GetFunctionConcurrency
$cfrom :: forall x. GetFunctionConcurrency -> Rep GetFunctionConcurrency x
Prelude.Generic)
newGetFunctionConcurrency ::
Prelude.Text ->
GetFunctionConcurrency
newGetFunctionConcurrency :: Text -> GetFunctionConcurrency
newGetFunctionConcurrency Text
pFunctionName_ =
GetFunctionConcurrency'
{ $sel:functionName:GetFunctionConcurrency' :: Text
functionName =
Text
pFunctionName_
}
getFunctionConcurrency_functionName :: Lens.Lens' GetFunctionConcurrency Prelude.Text
getFunctionConcurrency_functionName :: Lens' GetFunctionConcurrency Text
getFunctionConcurrency_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionConcurrency' {Text
functionName :: Text
$sel:functionName:GetFunctionConcurrency' :: GetFunctionConcurrency -> Text
functionName} -> Text
functionName) (\s :: GetFunctionConcurrency
s@GetFunctionConcurrency' {} Text
a -> GetFunctionConcurrency
s {$sel:functionName:GetFunctionConcurrency' :: Text
functionName = Text
a} :: GetFunctionConcurrency)
instance Core.AWSRequest GetFunctionConcurrency where
type
AWSResponse GetFunctionConcurrency =
GetFunctionConcurrencyResponse
request :: (Service -> Service)
-> GetFunctionConcurrency -> Request GetFunctionConcurrency
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetFunctionConcurrency
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetFunctionConcurrency)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Natural -> Int -> GetFunctionConcurrencyResponse
GetFunctionConcurrencyResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReservedConcurrentExecutions")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetFunctionConcurrency where
hashWithSalt :: Int -> GetFunctionConcurrency -> Int
hashWithSalt Int
_salt GetFunctionConcurrency' {Text
functionName :: Text
$sel:functionName:GetFunctionConcurrency' :: GetFunctionConcurrency -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName
instance Prelude.NFData GetFunctionConcurrency where
rnf :: GetFunctionConcurrency -> ()
rnf GetFunctionConcurrency' {Text
functionName :: Text
$sel:functionName:GetFunctionConcurrency' :: GetFunctionConcurrency -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
instance Data.ToHeaders GetFunctionConcurrency where
toHeaders :: GetFunctionConcurrency -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetFunctionConcurrency where
toPath :: GetFunctionConcurrency -> ByteString
toPath GetFunctionConcurrency' {Text
functionName :: Text
$sel:functionName:GetFunctionConcurrency' :: GetFunctionConcurrency -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2019-09-30/functions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
ByteString
"/concurrency"
]
instance Data.ToQuery GetFunctionConcurrency where
toQuery :: GetFunctionConcurrency -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetFunctionConcurrencyResponse = GetFunctionConcurrencyResponse'
{
GetFunctionConcurrencyResponse -> Maybe Natural
reservedConcurrentExecutions :: Prelude.Maybe Prelude.Natural,
GetFunctionConcurrencyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetFunctionConcurrencyResponse
-> GetFunctionConcurrencyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFunctionConcurrencyResponse
-> GetFunctionConcurrencyResponse -> Bool
$c/= :: GetFunctionConcurrencyResponse
-> GetFunctionConcurrencyResponse -> Bool
== :: GetFunctionConcurrencyResponse
-> GetFunctionConcurrencyResponse -> Bool
$c== :: GetFunctionConcurrencyResponse
-> GetFunctionConcurrencyResponse -> Bool
Prelude.Eq, ReadPrec [GetFunctionConcurrencyResponse]
ReadPrec GetFunctionConcurrencyResponse
Int -> ReadS GetFunctionConcurrencyResponse
ReadS [GetFunctionConcurrencyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFunctionConcurrencyResponse]
$creadListPrec :: ReadPrec [GetFunctionConcurrencyResponse]
readPrec :: ReadPrec GetFunctionConcurrencyResponse
$creadPrec :: ReadPrec GetFunctionConcurrencyResponse
readList :: ReadS [GetFunctionConcurrencyResponse]
$creadList :: ReadS [GetFunctionConcurrencyResponse]
readsPrec :: Int -> ReadS GetFunctionConcurrencyResponse
$creadsPrec :: Int -> ReadS GetFunctionConcurrencyResponse
Prelude.Read, Int -> GetFunctionConcurrencyResponse -> ShowS
[GetFunctionConcurrencyResponse] -> ShowS
GetFunctionConcurrencyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFunctionConcurrencyResponse] -> ShowS
$cshowList :: [GetFunctionConcurrencyResponse] -> ShowS
show :: GetFunctionConcurrencyResponse -> String
$cshow :: GetFunctionConcurrencyResponse -> String
showsPrec :: Int -> GetFunctionConcurrencyResponse -> ShowS
$cshowsPrec :: Int -> GetFunctionConcurrencyResponse -> ShowS
Prelude.Show, forall x.
Rep GetFunctionConcurrencyResponse x
-> GetFunctionConcurrencyResponse
forall x.
GetFunctionConcurrencyResponse
-> Rep GetFunctionConcurrencyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFunctionConcurrencyResponse x
-> GetFunctionConcurrencyResponse
$cfrom :: forall x.
GetFunctionConcurrencyResponse
-> Rep GetFunctionConcurrencyResponse x
Prelude.Generic)
newGetFunctionConcurrencyResponse ::
Prelude.Int ->
GetFunctionConcurrencyResponse
newGetFunctionConcurrencyResponse :: Int -> GetFunctionConcurrencyResponse
newGetFunctionConcurrencyResponse Int
pHttpStatus_ =
GetFunctionConcurrencyResponse'
{ $sel:reservedConcurrentExecutions:GetFunctionConcurrencyResponse' :: Maybe Natural
reservedConcurrentExecutions =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetFunctionConcurrencyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getFunctionConcurrencyResponse_reservedConcurrentExecutions :: Lens.Lens' GetFunctionConcurrencyResponse (Prelude.Maybe Prelude.Natural)
getFunctionConcurrencyResponse_reservedConcurrentExecutions :: Lens' GetFunctionConcurrencyResponse (Maybe Natural)
getFunctionConcurrencyResponse_reservedConcurrentExecutions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionConcurrencyResponse' {Maybe Natural
reservedConcurrentExecutions :: Maybe Natural
$sel:reservedConcurrentExecutions:GetFunctionConcurrencyResponse' :: GetFunctionConcurrencyResponse -> Maybe Natural
reservedConcurrentExecutions} -> Maybe Natural
reservedConcurrentExecutions) (\s :: GetFunctionConcurrencyResponse
s@GetFunctionConcurrencyResponse' {} Maybe Natural
a -> GetFunctionConcurrencyResponse
s {$sel:reservedConcurrentExecutions:GetFunctionConcurrencyResponse' :: Maybe Natural
reservedConcurrentExecutions = Maybe Natural
a} :: GetFunctionConcurrencyResponse)
getFunctionConcurrencyResponse_httpStatus :: Lens.Lens' GetFunctionConcurrencyResponse Prelude.Int
getFunctionConcurrencyResponse_httpStatus :: Lens' GetFunctionConcurrencyResponse Int
getFunctionConcurrencyResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionConcurrencyResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetFunctionConcurrencyResponse' :: GetFunctionConcurrencyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetFunctionConcurrencyResponse
s@GetFunctionConcurrencyResponse' {} Int
a -> GetFunctionConcurrencyResponse
s {$sel:httpStatus:GetFunctionConcurrencyResponse' :: Int
httpStatus = Int
a} :: GetFunctionConcurrencyResponse)
instance
Prelude.NFData
GetFunctionConcurrencyResponse
where
rnf :: GetFunctionConcurrencyResponse -> ()
rnf GetFunctionConcurrencyResponse' {Int
Maybe Natural
httpStatus :: Int
reservedConcurrentExecutions :: Maybe Natural
$sel:httpStatus:GetFunctionConcurrencyResponse' :: GetFunctionConcurrencyResponse -> Int
$sel:reservedConcurrentExecutions:GetFunctionConcurrencyResponse' :: GetFunctionConcurrencyResponse -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
reservedConcurrentExecutions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus