{-# 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.WellArchitected.DeleteLens
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete an existing lens.
--
-- Only the owner of a lens can delete it. After the lens is deleted,
-- Amazon Web Services accounts and IAM users that you shared the lens with
-- can continue to use it, but they will no longer be able to apply it to
-- new workloads.
--
-- __Disclaimer__
--
-- By sharing your custom lenses with other Amazon Web Services accounts,
-- you acknowledge that Amazon Web Services will make your custom lenses
-- available to those other accounts. Those other accounts may continue to
-- access and use your shared custom lenses even if you delete the custom
-- lenses from your own Amazon Web Services account or terminate your
-- Amazon Web Services account.
module Amazonka.WellArchitected.DeleteLens
  ( -- * Creating a Request
    DeleteLens (..),
    newDeleteLens,

    -- * Request Lenses
    deleteLens_lensAlias,
    deleteLens_clientRequestToken,
    deleteLens_lensStatus,

    -- * Destructuring the Response
    DeleteLensResponse (..),
    newDeleteLensResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WellArchitected.Types

-- | /See:/ 'newDeleteLens' smart constructor.
data DeleteLens = DeleteLens'
  { DeleteLens -> Text
lensAlias :: Prelude.Text,
    DeleteLens -> Text
clientRequestToken :: Prelude.Text,
    -- | The status of the lens to be deleted.
    DeleteLens -> LensStatusType
lensStatus :: LensStatusType
  }
  deriving (DeleteLens -> DeleteLens -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLens -> DeleteLens -> Bool
$c/= :: DeleteLens -> DeleteLens -> Bool
== :: DeleteLens -> DeleteLens -> Bool
$c== :: DeleteLens -> DeleteLens -> Bool
Prelude.Eq, ReadPrec [DeleteLens]
ReadPrec DeleteLens
Int -> ReadS DeleteLens
ReadS [DeleteLens]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLens]
$creadListPrec :: ReadPrec [DeleteLens]
readPrec :: ReadPrec DeleteLens
$creadPrec :: ReadPrec DeleteLens
readList :: ReadS [DeleteLens]
$creadList :: ReadS [DeleteLens]
readsPrec :: Int -> ReadS DeleteLens
$creadsPrec :: Int -> ReadS DeleteLens
Prelude.Read, Int -> DeleteLens -> ShowS
[DeleteLens] -> ShowS
DeleteLens -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLens] -> ShowS
$cshowList :: [DeleteLens] -> ShowS
show :: DeleteLens -> String
$cshow :: DeleteLens -> String
showsPrec :: Int -> DeleteLens -> ShowS
$cshowsPrec :: Int -> DeleteLens -> ShowS
Prelude.Show, forall x. Rep DeleteLens x -> DeleteLens
forall x. DeleteLens -> Rep DeleteLens x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLens x -> DeleteLens
$cfrom :: forall x. DeleteLens -> Rep DeleteLens x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLens' 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:
--
-- 'lensAlias', 'deleteLens_lensAlias' - Undocumented member.
--
-- 'clientRequestToken', 'deleteLens_clientRequestToken' - Undocumented member.
--
-- 'lensStatus', 'deleteLens_lensStatus' - The status of the lens to be deleted.
newDeleteLens ::
  -- | 'lensAlias'
  Prelude.Text ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  -- | 'lensStatus'
  LensStatusType ->
  DeleteLens
newDeleteLens :: Text -> Text -> LensStatusType -> DeleteLens
newDeleteLens
  Text
pLensAlias_
  Text
pClientRequestToken_
  LensStatusType
pLensStatus_ =
    DeleteLens'
      { $sel:lensAlias:DeleteLens' :: Text
lensAlias = Text
pLensAlias_,
        $sel:clientRequestToken:DeleteLens' :: Text
clientRequestToken = Text
pClientRequestToken_,
        $sel:lensStatus:DeleteLens' :: LensStatusType
lensStatus = LensStatusType
pLensStatus_
      }

-- | Undocumented member.
deleteLens_lensAlias :: Lens.Lens' DeleteLens Prelude.Text
deleteLens_lensAlias :: Lens' DeleteLens Text
deleteLens_lensAlias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLens' {Text
lensAlias :: Text
$sel:lensAlias:DeleteLens' :: DeleteLens -> Text
lensAlias} -> Text
lensAlias) (\s :: DeleteLens
s@DeleteLens' {} Text
a -> DeleteLens
s {$sel:lensAlias:DeleteLens' :: Text
lensAlias = Text
a} :: DeleteLens)

-- | Undocumented member.
deleteLens_clientRequestToken :: Lens.Lens' DeleteLens Prelude.Text
deleteLens_clientRequestToken :: Lens' DeleteLens Text
deleteLens_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLens' {Text
clientRequestToken :: Text
$sel:clientRequestToken:DeleteLens' :: DeleteLens -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: DeleteLens
s@DeleteLens' {} Text
a -> DeleteLens
s {$sel:clientRequestToken:DeleteLens' :: Text
clientRequestToken = Text
a} :: DeleteLens)

-- | The status of the lens to be deleted.
deleteLens_lensStatus :: Lens.Lens' DeleteLens LensStatusType
deleteLens_lensStatus :: Lens' DeleteLens LensStatusType
deleteLens_lensStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLens' {LensStatusType
lensStatus :: LensStatusType
$sel:lensStatus:DeleteLens' :: DeleteLens -> LensStatusType
lensStatus} -> LensStatusType
lensStatus) (\s :: DeleteLens
s@DeleteLens' {} LensStatusType
a -> DeleteLens
s {$sel:lensStatus:DeleteLens' :: LensStatusType
lensStatus = LensStatusType
a} :: DeleteLens)

instance Core.AWSRequest DeleteLens where
  type AWSResponse DeleteLens = DeleteLensResponse
  request :: (Service -> Service) -> DeleteLens -> Request DeleteLens
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteLens
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLens)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteLensResponse
DeleteLensResponse'

instance Prelude.Hashable DeleteLens where
  hashWithSalt :: Int -> DeleteLens -> Int
hashWithSalt Int
_salt DeleteLens' {Text
LensStatusType
lensStatus :: LensStatusType
clientRequestToken :: Text
lensAlias :: Text
$sel:lensStatus:DeleteLens' :: DeleteLens -> LensStatusType
$sel:clientRequestToken:DeleteLens' :: DeleteLens -> Text
$sel:lensAlias:DeleteLens' :: DeleteLens -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lensAlias
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientRequestToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LensStatusType
lensStatus

instance Prelude.NFData DeleteLens where
  rnf :: DeleteLens -> ()
rnf DeleteLens' {Text
LensStatusType
lensStatus :: LensStatusType
clientRequestToken :: Text
lensAlias :: Text
$sel:lensStatus:DeleteLens' :: DeleteLens -> LensStatusType
$sel:clientRequestToken:DeleteLens' :: DeleteLens -> Text
$sel:lensAlias:DeleteLens' :: DeleteLens -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
lensAlias
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientRequestToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LensStatusType
lensStatus

instance Data.ToHeaders DeleteLens where
  toHeaders :: DeleteLens -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeleteLens where
  toPath :: DeleteLens -> ByteString
toPath DeleteLens' {Text
LensStatusType
lensStatus :: LensStatusType
clientRequestToken :: Text
lensAlias :: Text
$sel:lensStatus:DeleteLens' :: DeleteLens -> LensStatusType
$sel:clientRequestToken:DeleteLens' :: DeleteLens -> Text
$sel:lensAlias:DeleteLens' :: DeleteLens -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/lenses/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
lensAlias]

instance Data.ToQuery DeleteLens where
  toQuery :: DeleteLens -> QueryString
toQuery DeleteLens' {Text
LensStatusType
lensStatus :: LensStatusType
clientRequestToken :: Text
lensAlias :: Text
$sel:lensStatus:DeleteLens' :: DeleteLens -> LensStatusType
$sel:clientRequestToken:DeleteLens' :: DeleteLens -> Text
$sel:lensAlias:DeleteLens' :: DeleteLens -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"ClientRequestToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
clientRequestToken,
        ByteString
"LensStatus" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: LensStatusType
lensStatus
      ]

-- | /See:/ 'newDeleteLensResponse' smart constructor.
data DeleteLensResponse = DeleteLensResponse'
  {
  }
  deriving (DeleteLensResponse -> DeleteLensResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLensResponse -> DeleteLensResponse -> Bool
$c/= :: DeleteLensResponse -> DeleteLensResponse -> Bool
== :: DeleteLensResponse -> DeleteLensResponse -> Bool
$c== :: DeleteLensResponse -> DeleteLensResponse -> Bool
Prelude.Eq, ReadPrec [DeleteLensResponse]
ReadPrec DeleteLensResponse
Int -> ReadS DeleteLensResponse
ReadS [DeleteLensResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLensResponse]
$creadListPrec :: ReadPrec [DeleteLensResponse]
readPrec :: ReadPrec DeleteLensResponse
$creadPrec :: ReadPrec DeleteLensResponse
readList :: ReadS [DeleteLensResponse]
$creadList :: ReadS [DeleteLensResponse]
readsPrec :: Int -> ReadS DeleteLensResponse
$creadsPrec :: Int -> ReadS DeleteLensResponse
Prelude.Read, Int -> DeleteLensResponse -> ShowS
[DeleteLensResponse] -> ShowS
DeleteLensResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLensResponse] -> ShowS
$cshowList :: [DeleteLensResponse] -> ShowS
show :: DeleteLensResponse -> String
$cshow :: DeleteLensResponse -> String
showsPrec :: Int -> DeleteLensResponse -> ShowS
$cshowsPrec :: Int -> DeleteLensResponse -> ShowS
Prelude.Show, forall x. Rep DeleteLensResponse x -> DeleteLensResponse
forall x. DeleteLensResponse -> Rep DeleteLensResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLensResponse x -> DeleteLensResponse
$cfrom :: forall x. DeleteLensResponse -> Rep DeleteLensResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLensResponse' 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.
newDeleteLensResponse ::
  DeleteLensResponse
newDeleteLensResponse :: DeleteLensResponse
newDeleteLensResponse = DeleteLensResponse
DeleteLensResponse'

instance Prelude.NFData DeleteLensResponse where
  rnf :: DeleteLensResponse -> ()
rnf DeleteLensResponse
_ = ()