{-# 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.GetFunctionConfiguration
(
GetFunctionConfiguration (..),
newGetFunctionConfiguration,
getFunctionConfiguration_qualifier,
getFunctionConfiguration_functionName,
FunctionConfiguration (..),
newFunctionConfiguration,
functionConfiguration_memorySize,
functionConfiguration_runtime,
functionConfiguration_state,
functionConfiguration_signingProfileVersionArn,
functionConfiguration_lastUpdateStatus,
functionConfiguration_functionArn,
functionConfiguration_kmsKeyArn,
functionConfiguration_packageType,
functionConfiguration_fileSystemConfigs,
functionConfiguration_environment,
functionConfiguration_deadLetterConfig,
functionConfiguration_architectures,
functionConfiguration_signingJobArn,
functionConfiguration_role,
functionConfiguration_vpcConfig,
functionConfiguration_version,
functionConfiguration_functionName,
functionConfiguration_layers,
functionConfiguration_codeSize,
functionConfiguration_handler,
functionConfiguration_timeout,
functionConfiguration_lastUpdateStatusReason,
functionConfiguration_stateReason,
functionConfiguration_lastModified,
functionConfiguration_codeSha256,
functionConfiguration_tracingConfig,
functionConfiguration_stateReasonCode,
functionConfiguration_imageConfigResponse,
functionConfiguration_description,
functionConfiguration_lastUpdateStatusReasonCode,
functionConfiguration_revisionId,
functionConfiguration_masterArn,
)
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
data GetFunctionConfiguration = GetFunctionConfiguration'
{
GetFunctionConfiguration -> Maybe Text
qualifier :: Prelude.Maybe Prelude.Text,
GetFunctionConfiguration -> Text
functionName :: Prelude.Text
}
deriving (GetFunctionConfiguration -> GetFunctionConfiguration -> Bool
(GetFunctionConfiguration -> GetFunctionConfiguration -> Bool)
-> (GetFunctionConfiguration -> GetFunctionConfiguration -> Bool)
-> Eq GetFunctionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFunctionConfiguration -> GetFunctionConfiguration -> Bool
$c/= :: GetFunctionConfiguration -> GetFunctionConfiguration -> Bool
== :: GetFunctionConfiguration -> GetFunctionConfiguration -> Bool
$c== :: GetFunctionConfiguration -> GetFunctionConfiguration -> Bool
Prelude.Eq, ReadPrec [GetFunctionConfiguration]
ReadPrec GetFunctionConfiguration
Int -> ReadS GetFunctionConfiguration
ReadS [GetFunctionConfiguration]
(Int -> ReadS GetFunctionConfiguration)
-> ReadS [GetFunctionConfiguration]
-> ReadPrec GetFunctionConfiguration
-> ReadPrec [GetFunctionConfiguration]
-> Read GetFunctionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFunctionConfiguration]
$creadListPrec :: ReadPrec [GetFunctionConfiguration]
readPrec :: ReadPrec GetFunctionConfiguration
$creadPrec :: ReadPrec GetFunctionConfiguration
readList :: ReadS [GetFunctionConfiguration]
$creadList :: ReadS [GetFunctionConfiguration]
readsPrec :: Int -> ReadS GetFunctionConfiguration
$creadsPrec :: Int -> ReadS GetFunctionConfiguration
Prelude.Read, Int -> GetFunctionConfiguration -> ShowS
[GetFunctionConfiguration] -> ShowS
GetFunctionConfiguration -> String
(Int -> GetFunctionConfiguration -> ShowS)
-> (GetFunctionConfiguration -> String)
-> ([GetFunctionConfiguration] -> ShowS)
-> Show GetFunctionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFunctionConfiguration] -> ShowS
$cshowList :: [GetFunctionConfiguration] -> ShowS
show :: GetFunctionConfiguration -> String
$cshow :: GetFunctionConfiguration -> String
showsPrec :: Int -> GetFunctionConfiguration -> ShowS
$cshowsPrec :: Int -> GetFunctionConfiguration -> ShowS
Prelude.Show, (forall x.
GetFunctionConfiguration -> Rep GetFunctionConfiguration x)
-> (forall x.
Rep GetFunctionConfiguration x -> GetFunctionConfiguration)
-> Generic GetFunctionConfiguration
forall x.
Rep GetFunctionConfiguration x -> GetFunctionConfiguration
forall x.
GetFunctionConfiguration -> Rep GetFunctionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFunctionConfiguration x -> GetFunctionConfiguration
$cfrom :: forall x.
GetFunctionConfiguration -> Rep GetFunctionConfiguration x
Prelude.Generic)
newGetFunctionConfiguration ::
Prelude.Text ->
GetFunctionConfiguration
newGetFunctionConfiguration :: Text -> GetFunctionConfiguration
newGetFunctionConfiguration Text
pFunctionName_ =
GetFunctionConfiguration' :: Maybe Text -> Text -> GetFunctionConfiguration
GetFunctionConfiguration'
{ $sel:qualifier:GetFunctionConfiguration' :: Maybe Text
qualifier =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:functionName:GetFunctionConfiguration' :: Text
functionName = Text
pFunctionName_
}
getFunctionConfiguration_qualifier :: Lens.Lens' GetFunctionConfiguration (Prelude.Maybe Prelude.Text)
getFunctionConfiguration_qualifier :: (Maybe Text -> f (Maybe Text))
-> GetFunctionConfiguration -> f GetFunctionConfiguration
getFunctionConfiguration_qualifier = (GetFunctionConfiguration -> Maybe Text)
-> (GetFunctionConfiguration
-> Maybe Text -> GetFunctionConfiguration)
-> Lens
GetFunctionConfiguration
GetFunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionConfiguration' {Maybe Text
qualifier :: Maybe Text
$sel:qualifier:GetFunctionConfiguration' :: GetFunctionConfiguration -> Maybe Text
qualifier} -> Maybe Text
qualifier) (\s :: GetFunctionConfiguration
s@GetFunctionConfiguration' {} Maybe Text
a -> GetFunctionConfiguration
s {$sel:qualifier:GetFunctionConfiguration' :: Maybe Text
qualifier = Maybe Text
a} :: GetFunctionConfiguration)
getFunctionConfiguration_functionName :: Lens.Lens' GetFunctionConfiguration Prelude.Text
getFunctionConfiguration_functionName :: (Text -> f Text)
-> GetFunctionConfiguration -> f GetFunctionConfiguration
getFunctionConfiguration_functionName = (GetFunctionConfiguration -> Text)
-> (GetFunctionConfiguration -> Text -> GetFunctionConfiguration)
-> Lens GetFunctionConfiguration GetFunctionConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionConfiguration' {Text
functionName :: Text
$sel:functionName:GetFunctionConfiguration' :: GetFunctionConfiguration -> Text
functionName} -> Text
functionName) (\s :: GetFunctionConfiguration
s@GetFunctionConfiguration' {} Text
a -> GetFunctionConfiguration
s {$sel:functionName:GetFunctionConfiguration' :: Text
functionName = Text
a} :: GetFunctionConfiguration)
instance Core.AWSRequest GetFunctionConfiguration where
type
AWSResponse GetFunctionConfiguration =
FunctionConfiguration
request :: GetFunctionConfiguration -> Request GetFunctionConfiguration
request = Service
-> GetFunctionConfiguration -> Request GetFunctionConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetFunctionConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetFunctionConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetFunctionConfiguration))
-> Logger
-> Service
-> Proxy GetFunctionConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetFunctionConfiguration)))
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 -> Object -> Either String FunctionConfiguration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable GetFunctionConfiguration
instance Prelude.NFData GetFunctionConfiguration
instance Core.ToHeaders GetFunctionConfiguration where
toHeaders :: GetFunctionConfiguration -> ResponseHeaders
toHeaders = ResponseHeaders -> GetFunctionConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetFunctionConfiguration where
toPath :: GetFunctionConfiguration -> ByteString
toPath GetFunctionConfiguration' {Maybe Text
Text
functionName :: Text
qualifier :: Maybe Text
$sel:functionName:GetFunctionConfiguration' :: GetFunctionConfiguration -> Text
$sel:qualifier:GetFunctionConfiguration' :: GetFunctionConfiguration -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2015-03-31/functions/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
functionName,
ByteString
"/configuration"
]
instance Core.ToQuery GetFunctionConfiguration where
toQuery :: GetFunctionConfiguration -> QueryString
toQuery GetFunctionConfiguration' {Maybe Text
Text
functionName :: Text
qualifier :: Maybe Text
$sel:functionName:GetFunctionConfiguration' :: GetFunctionConfiguration -> Text
$sel:qualifier:GetFunctionConfiguration' :: GetFunctionConfiguration -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
qualifier]