amazonka-lambda-2.0: gen/Amazonka/Lambda/DeleteAlias.hs
{-# 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 #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Amazonka.Lambda.DeleteAlias
-- Copyright : (c) 2013-2023 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a Lambda function
-- <https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html alias>.
module Amazonka.Lambda.DeleteAlias
( -- * Creating a Request
DeleteAlias (..),
newDeleteAlias,
-- * Request Lenses
deleteAlias_functionName,
deleteAlias_name,
-- * Destructuring the Response
DeleteAliasResponse (..),
newDeleteAliasResponse,
)
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
-- | /See:/ 'newDeleteAlias' smart constructor.
data DeleteAlias = DeleteAlias'
{ -- | The name of the Lambda function.
--
-- __Name formats__
--
-- - __Function name__ - @MyFunction@.
--
-- - __Function ARN__ -
-- @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- - __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
functionName :: Prelude.Text,
-- | The name of the alias.
name :: Prelude.Text
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteAlias' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'functionName', 'deleteAlias_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- - __Function name__ - @MyFunction@.
--
-- - __Function ARN__ -
-- @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- - __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
--
-- 'name', 'deleteAlias_name' - The name of the alias.
newDeleteAlias ::
-- | 'functionName'
Prelude.Text ->
-- | 'name'
Prelude.Text ->
DeleteAlias
newDeleteAlias pFunctionName_ pName_ =
DeleteAlias'
{ functionName = pFunctionName_,
name = pName_
}
-- | The name of the Lambda function.
--
-- __Name formats__
--
-- - __Function name__ - @MyFunction@.
--
-- - __Function ARN__ -
-- @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- - __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
deleteAlias_functionName :: Lens.Lens' DeleteAlias Prelude.Text
deleteAlias_functionName = Lens.lens (\DeleteAlias' {functionName} -> functionName) (\s@DeleteAlias' {} a -> s {functionName = a} :: DeleteAlias)
-- | The name of the alias.
deleteAlias_name :: Lens.Lens' DeleteAlias Prelude.Text
deleteAlias_name = Lens.lens (\DeleteAlias' {name} -> name) (\s@DeleteAlias' {} a -> s {name = a} :: DeleteAlias)
instance Core.AWSRequest DeleteAlias where
type AWSResponse DeleteAlias = DeleteAliasResponse
request overrides =
Request.delete (overrides defaultService)
response = Response.receiveNull DeleteAliasResponse'
instance Prelude.Hashable DeleteAlias where
hashWithSalt _salt DeleteAlias' {..} =
_salt
`Prelude.hashWithSalt` functionName
`Prelude.hashWithSalt` name
instance Prelude.NFData DeleteAlias where
rnf DeleteAlias' {..} =
Prelude.rnf functionName
`Prelude.seq` Prelude.rnf name
instance Data.ToHeaders DeleteAlias where
toHeaders = Prelude.const Prelude.mempty
instance Data.ToPath DeleteAlias where
toPath DeleteAlias' {..} =
Prelude.mconcat
[ "/2015-03-31/functions/",
Data.toBS functionName,
"/aliases/",
Data.toBS name
]
instance Data.ToQuery DeleteAlias where
toQuery = Prelude.const Prelude.mempty
-- | /See:/ 'newDeleteAliasResponse' smart constructor.
data DeleteAliasResponse = DeleteAliasResponse'
{
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteAliasResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newDeleteAliasResponse ::
DeleteAliasResponse
newDeleteAliasResponse = DeleteAliasResponse'
instance Prelude.NFData DeleteAliasResponse where
rnf _ = ()