{-# 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.GetAlias
(
GetAlias (..),
newGetAlias,
getAlias_functionName,
getAlias_name,
AliasConfiguration (..),
newAliasConfiguration,
aliasConfiguration_routingConfig,
aliasConfiguration_name,
aliasConfiguration_functionVersion,
aliasConfiguration_aliasArn,
aliasConfiguration_description,
aliasConfiguration_revisionId,
)
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 GetAlias = GetAlias'
{
GetAlias -> Text
functionName :: Prelude.Text,
GetAlias -> Text
name :: Prelude.Text
}
deriving (GetAlias -> GetAlias -> Bool
(GetAlias -> GetAlias -> Bool)
-> (GetAlias -> GetAlias -> Bool) -> Eq GetAlias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAlias -> GetAlias -> Bool
$c/= :: GetAlias -> GetAlias -> Bool
== :: GetAlias -> GetAlias -> Bool
$c== :: GetAlias -> GetAlias -> Bool
Prelude.Eq, ReadPrec [GetAlias]
ReadPrec GetAlias
Int -> ReadS GetAlias
ReadS [GetAlias]
(Int -> ReadS GetAlias)
-> ReadS [GetAlias]
-> ReadPrec GetAlias
-> ReadPrec [GetAlias]
-> Read GetAlias
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAlias]
$creadListPrec :: ReadPrec [GetAlias]
readPrec :: ReadPrec GetAlias
$creadPrec :: ReadPrec GetAlias
readList :: ReadS [GetAlias]
$creadList :: ReadS [GetAlias]
readsPrec :: Int -> ReadS GetAlias
$creadsPrec :: Int -> ReadS GetAlias
Prelude.Read, Int -> GetAlias -> ShowS
[GetAlias] -> ShowS
GetAlias -> String
(Int -> GetAlias -> ShowS)
-> (GetAlias -> String) -> ([GetAlias] -> ShowS) -> Show GetAlias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAlias] -> ShowS
$cshowList :: [GetAlias] -> ShowS
show :: GetAlias -> String
$cshow :: GetAlias -> String
showsPrec :: Int -> GetAlias -> ShowS
$cshowsPrec :: Int -> GetAlias -> ShowS
Prelude.Show, (forall x. GetAlias -> Rep GetAlias x)
-> (forall x. Rep GetAlias x -> GetAlias) -> Generic GetAlias
forall x. Rep GetAlias x -> GetAlias
forall x. GetAlias -> Rep GetAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAlias x -> GetAlias
$cfrom :: forall x. GetAlias -> Rep GetAlias x
Prelude.Generic)
newGetAlias ::
Prelude.Text ->
Prelude.Text ->
GetAlias
newGetAlias :: Text -> Text -> GetAlias
newGetAlias Text
pFunctionName_ Text
pName_ =
GetAlias' :: Text -> Text -> GetAlias
GetAlias'
{ $sel:functionName:GetAlias' :: Text
functionName = Text
pFunctionName_,
$sel:name:GetAlias' :: Text
name = Text
pName_
}
getAlias_functionName :: Lens.Lens' GetAlias Prelude.Text
getAlias_functionName :: (Text -> f Text) -> GetAlias -> f GetAlias
getAlias_functionName = (GetAlias -> Text)
-> (GetAlias -> Text -> GetAlias)
-> Lens GetAlias GetAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlias' {Text
functionName :: Text
$sel:functionName:GetAlias' :: GetAlias -> Text
functionName} -> Text
functionName) (\s :: GetAlias
s@GetAlias' {} Text
a -> GetAlias
s {$sel:functionName:GetAlias' :: Text
functionName = Text
a} :: GetAlias)
getAlias_name :: Lens.Lens' GetAlias Prelude.Text
getAlias_name :: (Text -> f Text) -> GetAlias -> f GetAlias
getAlias_name = (GetAlias -> Text)
-> (GetAlias -> Text -> GetAlias)
-> Lens GetAlias GetAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlias' {Text
name :: Text
$sel:name:GetAlias' :: GetAlias -> Text
name} -> Text
name) (\s :: GetAlias
s@GetAlias' {} Text
a -> GetAlias
s {$sel:name:GetAlias' :: Text
name = Text
a} :: GetAlias)
instance Core.AWSRequest GetAlias where
type AWSResponse GetAlias = AliasConfiguration
request :: GetAlias -> Request GetAlias
request = Service -> GetAlias -> Request GetAlias
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAlias)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetAlias))
-> Logger
-> Service
-> Proxy GetAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAlias)))
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 AliasConfiguration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable GetAlias
instance Prelude.NFData GetAlias
instance Core.ToHeaders GetAlias where
toHeaders :: GetAlias -> ResponseHeaders
toHeaders = ResponseHeaders -> GetAlias -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetAlias where
toPath :: GetAlias -> ByteString
toPath GetAlias' {Text
name :: Text
functionName :: Text
$sel:name:GetAlias' :: GetAlias -> Text
$sel:functionName:GetAlias' :: GetAlias -> 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
"/aliases/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name
]
instance Core.ToQuery GetAlias where
toQuery :: GetAlias -> QueryString
toQuery = QueryString -> GetAlias -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty