{-# 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.DeleteWorkload
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete an existing workload.
module Amazonka.WellArchitected.DeleteWorkload
  ( -- * Creating a Request
    DeleteWorkload (..),
    newDeleteWorkload,

    -- * Request Lenses
    deleteWorkload_workloadId,
    deleteWorkload_clientRequestToken,

    -- * Destructuring the Response
    DeleteWorkloadResponse (..),
    newDeleteWorkloadResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteWorkload' 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:
--
-- 'workloadId', 'deleteWorkload_workloadId' - Undocumented member.
--
-- 'clientRequestToken', 'deleteWorkload_clientRequestToken' - Undocumented member.
newDeleteWorkload ::
  -- | 'workloadId'
  Prelude.Text ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  DeleteWorkload
newDeleteWorkload :: Text -> Text -> DeleteWorkload
newDeleteWorkload Text
pWorkloadId_ Text
pClientRequestToken_ =
  DeleteWorkload' :: Text -> Text -> DeleteWorkload
DeleteWorkload'
    { $sel:workloadId:DeleteWorkload' :: Text
workloadId = Text
pWorkloadId_,
      $sel:clientRequestToken:DeleteWorkload' :: Text
clientRequestToken = Text
pClientRequestToken_
    }

-- | Undocumented member.
deleteWorkload_workloadId :: Lens.Lens' DeleteWorkload Prelude.Text
deleteWorkload_workloadId :: (Text -> f Text) -> DeleteWorkload -> f DeleteWorkload
deleteWorkload_workloadId = (DeleteWorkload -> Text)
-> (DeleteWorkload -> Text -> DeleteWorkload)
-> Lens DeleteWorkload DeleteWorkload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorkload' {Text
workloadId :: Text
$sel:workloadId:DeleteWorkload' :: DeleteWorkload -> Text
workloadId} -> Text
workloadId) (\s :: DeleteWorkload
s@DeleteWorkload' {} Text
a -> DeleteWorkload
s {$sel:workloadId:DeleteWorkload' :: Text
workloadId = Text
a} :: DeleteWorkload)

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

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

instance Prelude.Hashable DeleteWorkload

instance Prelude.NFData DeleteWorkload

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

instance Core.ToPath DeleteWorkload where
  toPath :: DeleteWorkload -> ByteString
toPath DeleteWorkload' {Text
clientRequestToken :: Text
workloadId :: Text
$sel:clientRequestToken:DeleteWorkload' :: DeleteWorkload -> Text
$sel:workloadId:DeleteWorkload' :: DeleteWorkload -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/workloads/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workloadId]

instance Core.ToQuery DeleteWorkload where
  toQuery :: DeleteWorkload -> QueryString
toQuery DeleteWorkload' {Text
clientRequestToken :: Text
workloadId :: Text
$sel:clientRequestToken:DeleteWorkload' :: DeleteWorkload -> Text
$sel:workloadId:DeleteWorkload' :: DeleteWorkload -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"ClientRequestToken" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clientRequestToken]

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

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

instance Prelude.NFData DeleteWorkloadResponse