{-# 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_aliasArn,
aliasConfiguration_description,
aliasConfiguration_functionVersion,
aliasConfiguration_name,
aliasConfiguration_revisionId,
aliasConfiguration_routingConfig,
)
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 GetAlias = GetAlias'
{
GetAlias -> Text
functionName :: Prelude.Text,
GetAlias -> Text
name :: Prelude.Text
}
deriving (GetAlias -> GetAlias -> Bool
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]
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
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. 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'
{ $sel:functionName:GetAlias' :: Text
functionName = Text
pFunctionName_,
$sel:name:GetAlias' :: Text
name = Text
pName_
}
getAlias_functionName :: Lens.Lens' GetAlias Prelude.Text
getAlias_functionName :: Lens' GetAlias Text
getAlias_functionName = 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 :: Lens' GetAlias Text
getAlias_name = 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 :: (Service -> Service) -> GetAlias -> Request GetAlias
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 GetAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAlias)))
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 -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance Prelude.Hashable GetAlias where
hashWithSalt :: Int -> GetAlias -> Int
hashWithSalt Int
_salt GetAlias' {Text
name :: Text
functionName :: Text
$sel:name:GetAlias' :: GetAlias -> Text
$sel:functionName:GetAlias' :: GetAlias -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData GetAlias where
rnf :: GetAlias -> ()
rnf GetAlias' {Text
name :: Text
functionName :: Text
$sel:name:GetAlias' :: GetAlias -> Text
$sel:functionName:GetAlias' :: GetAlias -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders GetAlias where
toHeaders :: GetAlias -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetAlias where
toPath :: GetAlias -> ByteString
toPath GetAlias' {Text
name :: Text
functionName :: Text
$sel:name:GetAlias' :: GetAlias -> Text
$sel:functionName:GetAlias' :: GetAlias -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2015-03-31/functions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
ByteString
"/aliases/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
name
]
instance Data.ToQuery GetAlias where
toQuery :: GetAlias -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty