{-# 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.AppConfig.DeleteDeploymentStrategy
-- 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 deployment strategy. Deleting a deployment strategy does not
-- delete a configuration from a host.
module Amazonka.AppConfig.DeleteDeploymentStrategy
  ( -- * Creating a Request
    DeleteDeploymentStrategy (..),
    newDeleteDeploymentStrategy,

    -- * Request Lenses
    deleteDeploymentStrategy_deploymentStrategyId,

    -- * Destructuring the Response
    DeleteDeploymentStrategyResponse (..),
    newDeleteDeploymentStrategyResponse,
  )
where

import Amazonka.AppConfig.Types
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

-- | /See:/ 'newDeleteDeploymentStrategy' smart constructor.
data DeleteDeploymentStrategy = DeleteDeploymentStrategy'
  { -- | The ID of the deployment strategy you want to delete.
    DeleteDeploymentStrategy -> Text
deploymentStrategyId :: Prelude.Text
  }
  deriving (DeleteDeploymentStrategy -> DeleteDeploymentStrategy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeploymentStrategy -> DeleteDeploymentStrategy -> Bool
$c/= :: DeleteDeploymentStrategy -> DeleteDeploymentStrategy -> Bool
== :: DeleteDeploymentStrategy -> DeleteDeploymentStrategy -> Bool
$c== :: DeleteDeploymentStrategy -> DeleteDeploymentStrategy -> Bool
Prelude.Eq, ReadPrec [DeleteDeploymentStrategy]
ReadPrec DeleteDeploymentStrategy
Int -> ReadS DeleteDeploymentStrategy
ReadS [DeleteDeploymentStrategy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeploymentStrategy]
$creadListPrec :: ReadPrec [DeleteDeploymentStrategy]
readPrec :: ReadPrec DeleteDeploymentStrategy
$creadPrec :: ReadPrec DeleteDeploymentStrategy
readList :: ReadS [DeleteDeploymentStrategy]
$creadList :: ReadS [DeleteDeploymentStrategy]
readsPrec :: Int -> ReadS DeleteDeploymentStrategy
$creadsPrec :: Int -> ReadS DeleteDeploymentStrategy
Prelude.Read, Int -> DeleteDeploymentStrategy -> ShowS
[DeleteDeploymentStrategy] -> ShowS
DeleteDeploymentStrategy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeploymentStrategy] -> ShowS
$cshowList :: [DeleteDeploymentStrategy] -> ShowS
show :: DeleteDeploymentStrategy -> String
$cshow :: DeleteDeploymentStrategy -> String
showsPrec :: Int -> DeleteDeploymentStrategy -> ShowS
$cshowsPrec :: Int -> DeleteDeploymentStrategy -> ShowS
Prelude.Show, forall x.
Rep DeleteDeploymentStrategy x -> DeleteDeploymentStrategy
forall x.
DeleteDeploymentStrategy -> Rep DeleteDeploymentStrategy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDeploymentStrategy x -> DeleteDeploymentStrategy
$cfrom :: forall x.
DeleteDeploymentStrategy -> Rep DeleteDeploymentStrategy x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDeploymentStrategy' 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:
--
-- 'deploymentStrategyId', 'deleteDeploymentStrategy_deploymentStrategyId' - The ID of the deployment strategy you want to delete.
newDeleteDeploymentStrategy ::
  -- | 'deploymentStrategyId'
  Prelude.Text ->
  DeleteDeploymentStrategy
newDeleteDeploymentStrategy :: Text -> DeleteDeploymentStrategy
newDeleteDeploymentStrategy Text
pDeploymentStrategyId_ =
  DeleteDeploymentStrategy'
    { $sel:deploymentStrategyId:DeleteDeploymentStrategy' :: Text
deploymentStrategyId =
        Text
pDeploymentStrategyId_
    }

-- | The ID of the deployment strategy you want to delete.
deleteDeploymentStrategy_deploymentStrategyId :: Lens.Lens' DeleteDeploymentStrategy Prelude.Text
deleteDeploymentStrategy_deploymentStrategyId :: Lens' DeleteDeploymentStrategy Text
deleteDeploymentStrategy_deploymentStrategyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeploymentStrategy' {Text
deploymentStrategyId :: Text
$sel:deploymentStrategyId:DeleteDeploymentStrategy' :: DeleteDeploymentStrategy -> Text
deploymentStrategyId} -> Text
deploymentStrategyId) (\s :: DeleteDeploymentStrategy
s@DeleteDeploymentStrategy' {} Text
a -> DeleteDeploymentStrategy
s {$sel:deploymentStrategyId:DeleteDeploymentStrategy' :: Text
deploymentStrategyId = Text
a} :: DeleteDeploymentStrategy)

instance Core.AWSRequest DeleteDeploymentStrategy where
  type
    AWSResponse DeleteDeploymentStrategy =
      DeleteDeploymentStrategyResponse
  request :: (Service -> Service)
-> DeleteDeploymentStrategy -> Request DeleteDeploymentStrategy
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 DeleteDeploymentStrategy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDeploymentStrategy)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteDeploymentStrategyResponse
DeleteDeploymentStrategyResponse'

instance Prelude.Hashable DeleteDeploymentStrategy where
  hashWithSalt :: Int -> DeleteDeploymentStrategy -> Int
hashWithSalt Int
_salt DeleteDeploymentStrategy' {Text
deploymentStrategyId :: Text
$sel:deploymentStrategyId:DeleteDeploymentStrategy' :: DeleteDeploymentStrategy -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deploymentStrategyId

instance Prelude.NFData DeleteDeploymentStrategy where
  rnf :: DeleteDeploymentStrategy -> ()
rnf DeleteDeploymentStrategy' {Text
deploymentStrategyId :: Text
$sel:deploymentStrategyId:DeleteDeploymentStrategy' :: DeleteDeploymentStrategy -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
deploymentStrategyId

instance Data.ToHeaders DeleteDeploymentStrategy where
  toHeaders :: DeleteDeploymentStrategy -> [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 DeleteDeploymentStrategy where
  toPath :: DeleteDeploymentStrategy -> ByteString
toPath DeleteDeploymentStrategy' {Text
deploymentStrategyId :: Text
$sel:deploymentStrategyId:DeleteDeploymentStrategy' :: DeleteDeploymentStrategy -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/deployementstrategies/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
deploymentStrategyId
      ]

instance Data.ToQuery DeleteDeploymentStrategy where
  toQuery :: DeleteDeploymentStrategy -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

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

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