{-# 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.DeleteWorkloadShare
-- 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 a workload share.
module Amazonka.WellArchitected.DeleteWorkloadShare
  ( -- * Creating a Request
    DeleteWorkloadShare (..),
    newDeleteWorkloadShare,

    -- * Request Lenses
    deleteWorkloadShare_shareId,
    deleteWorkloadShare_workloadId,
    deleteWorkloadShare_clientRequestToken,

    -- * Destructuring the Response
    DeleteWorkloadShareResponse (..),
    newDeleteWorkloadShareResponse,
  )
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 Delete Workload Share
--
-- /See:/ 'newDeleteWorkloadShare' smart constructor.
data DeleteWorkloadShare = DeleteWorkloadShare'
  { DeleteWorkloadShare -> Text
shareId :: Prelude.Text,
    DeleteWorkloadShare -> Text
workloadId :: Prelude.Text,
    DeleteWorkloadShare -> Text
clientRequestToken :: Prelude.Text
  }
  deriving (DeleteWorkloadShare -> DeleteWorkloadShare -> Bool
(DeleteWorkloadShare -> DeleteWorkloadShare -> Bool)
-> (DeleteWorkloadShare -> DeleteWorkloadShare -> Bool)
-> Eq DeleteWorkloadShare
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWorkloadShare -> DeleteWorkloadShare -> Bool
$c/= :: DeleteWorkloadShare -> DeleteWorkloadShare -> Bool
== :: DeleteWorkloadShare -> DeleteWorkloadShare -> Bool
$c== :: DeleteWorkloadShare -> DeleteWorkloadShare -> Bool
Prelude.Eq, ReadPrec [DeleteWorkloadShare]
ReadPrec DeleteWorkloadShare
Int -> ReadS DeleteWorkloadShare
ReadS [DeleteWorkloadShare]
(Int -> ReadS DeleteWorkloadShare)
-> ReadS [DeleteWorkloadShare]
-> ReadPrec DeleteWorkloadShare
-> ReadPrec [DeleteWorkloadShare]
-> Read DeleteWorkloadShare
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWorkloadShare]
$creadListPrec :: ReadPrec [DeleteWorkloadShare]
readPrec :: ReadPrec DeleteWorkloadShare
$creadPrec :: ReadPrec DeleteWorkloadShare
readList :: ReadS [DeleteWorkloadShare]
$creadList :: ReadS [DeleteWorkloadShare]
readsPrec :: Int -> ReadS DeleteWorkloadShare
$creadsPrec :: Int -> ReadS DeleteWorkloadShare
Prelude.Read, Int -> DeleteWorkloadShare -> ShowS
[DeleteWorkloadShare] -> ShowS
DeleteWorkloadShare -> String
(Int -> DeleteWorkloadShare -> ShowS)
-> (DeleteWorkloadShare -> String)
-> ([DeleteWorkloadShare] -> ShowS)
-> Show DeleteWorkloadShare
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWorkloadShare] -> ShowS
$cshowList :: [DeleteWorkloadShare] -> ShowS
show :: DeleteWorkloadShare -> String
$cshow :: DeleteWorkloadShare -> String
showsPrec :: Int -> DeleteWorkloadShare -> ShowS
$cshowsPrec :: Int -> DeleteWorkloadShare -> ShowS
Prelude.Show, (forall x. DeleteWorkloadShare -> Rep DeleteWorkloadShare x)
-> (forall x. Rep DeleteWorkloadShare x -> DeleteWorkloadShare)
-> Generic DeleteWorkloadShare
forall x. Rep DeleteWorkloadShare x -> DeleteWorkloadShare
forall x. DeleteWorkloadShare -> Rep DeleteWorkloadShare x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteWorkloadShare x -> DeleteWorkloadShare
$cfrom :: forall x. DeleteWorkloadShare -> Rep DeleteWorkloadShare x
Prelude.Generic)

-- |
-- Create a value of 'DeleteWorkloadShare' 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:
--
-- 'shareId', 'deleteWorkloadShare_shareId' - Undocumented member.
--
-- 'workloadId', 'deleteWorkloadShare_workloadId' - Undocumented member.
--
-- 'clientRequestToken', 'deleteWorkloadShare_clientRequestToken' - Undocumented member.
newDeleteWorkloadShare ::
  -- | 'shareId'
  Prelude.Text ->
  -- | 'workloadId'
  Prelude.Text ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  DeleteWorkloadShare
newDeleteWorkloadShare :: Text -> Text -> Text -> DeleteWorkloadShare
newDeleteWorkloadShare
  Text
pShareId_
  Text
pWorkloadId_
  Text
pClientRequestToken_ =
    DeleteWorkloadShare' :: Text -> Text -> Text -> DeleteWorkloadShare
DeleteWorkloadShare'
      { $sel:shareId:DeleteWorkloadShare' :: Text
shareId = Text
pShareId_,
        $sel:workloadId:DeleteWorkloadShare' :: Text
workloadId = Text
pWorkloadId_,
        $sel:clientRequestToken:DeleteWorkloadShare' :: Text
clientRequestToken = Text
pClientRequestToken_
      }

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

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

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

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

instance Prelude.Hashable DeleteWorkloadShare

instance Prelude.NFData DeleteWorkloadShare

instance Core.ToHeaders DeleteWorkloadShare where
  toHeaders :: DeleteWorkloadShare -> [Header]
toHeaders =
    [Header] -> DeleteWorkloadShare -> [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 DeleteWorkloadShare where
  toPath :: DeleteWorkloadShare -> ByteString
toPath DeleteWorkloadShare' {Text
clientRequestToken :: Text
workloadId :: Text
shareId :: Text
$sel:clientRequestToken:DeleteWorkloadShare' :: DeleteWorkloadShare -> Text
$sel:workloadId:DeleteWorkloadShare' :: DeleteWorkloadShare -> Text
$sel:shareId:DeleteWorkloadShare' :: DeleteWorkloadShare -> 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,
        ByteString
"/shares/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
shareId
      ]

instance Core.ToQuery DeleteWorkloadShare where
  toQuery :: DeleteWorkloadShare -> QueryString
toQuery DeleteWorkloadShare' {Text
clientRequestToken :: Text
workloadId :: Text
shareId :: Text
$sel:clientRequestToken:DeleteWorkloadShare' :: DeleteWorkloadShare -> Text
$sel:workloadId:DeleteWorkloadShare' :: DeleteWorkloadShare -> Text
$sel:shareId:DeleteWorkloadShare' :: DeleteWorkloadShare -> 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:/ 'newDeleteWorkloadShareResponse' smart constructor.
data DeleteWorkloadShareResponse = DeleteWorkloadShareResponse'
  {
  }
  deriving (DeleteWorkloadShareResponse -> DeleteWorkloadShareResponse -> Bool
(DeleteWorkloadShareResponse
 -> DeleteWorkloadShareResponse -> Bool)
-> (DeleteWorkloadShareResponse
    -> DeleteWorkloadShareResponse -> Bool)
-> Eq DeleteWorkloadShareResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWorkloadShareResponse -> DeleteWorkloadShareResponse -> Bool
$c/= :: DeleteWorkloadShareResponse -> DeleteWorkloadShareResponse -> Bool
== :: DeleteWorkloadShareResponse -> DeleteWorkloadShareResponse -> Bool
$c== :: DeleteWorkloadShareResponse -> DeleteWorkloadShareResponse -> Bool
Prelude.Eq, ReadPrec [DeleteWorkloadShareResponse]
ReadPrec DeleteWorkloadShareResponse
Int -> ReadS DeleteWorkloadShareResponse
ReadS [DeleteWorkloadShareResponse]
(Int -> ReadS DeleteWorkloadShareResponse)
-> ReadS [DeleteWorkloadShareResponse]
-> ReadPrec DeleteWorkloadShareResponse
-> ReadPrec [DeleteWorkloadShareResponse]
-> Read DeleteWorkloadShareResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWorkloadShareResponse]
$creadListPrec :: ReadPrec [DeleteWorkloadShareResponse]
readPrec :: ReadPrec DeleteWorkloadShareResponse
$creadPrec :: ReadPrec DeleteWorkloadShareResponse
readList :: ReadS [DeleteWorkloadShareResponse]
$creadList :: ReadS [DeleteWorkloadShareResponse]
readsPrec :: Int -> ReadS DeleteWorkloadShareResponse
$creadsPrec :: Int -> ReadS DeleteWorkloadShareResponse
Prelude.Read, Int -> DeleteWorkloadShareResponse -> ShowS
[DeleteWorkloadShareResponse] -> ShowS
DeleteWorkloadShareResponse -> String
(Int -> DeleteWorkloadShareResponse -> ShowS)
-> (DeleteWorkloadShareResponse -> String)
-> ([DeleteWorkloadShareResponse] -> ShowS)
-> Show DeleteWorkloadShareResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWorkloadShareResponse] -> ShowS
$cshowList :: [DeleteWorkloadShareResponse] -> ShowS
show :: DeleteWorkloadShareResponse -> String
$cshow :: DeleteWorkloadShareResponse -> String
showsPrec :: Int -> DeleteWorkloadShareResponse -> ShowS
$cshowsPrec :: Int -> DeleteWorkloadShareResponse -> ShowS
Prelude.Show, (forall x.
 DeleteWorkloadShareResponse -> Rep DeleteWorkloadShareResponse x)
-> (forall x.
    Rep DeleteWorkloadShareResponse x -> DeleteWorkloadShareResponse)
-> Generic DeleteWorkloadShareResponse
forall x.
Rep DeleteWorkloadShareResponse x -> DeleteWorkloadShareResponse
forall x.
DeleteWorkloadShareResponse -> Rep DeleteWorkloadShareResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteWorkloadShareResponse x -> DeleteWorkloadShareResponse
$cfrom :: forall x.
DeleteWorkloadShareResponse -> Rep DeleteWorkloadShareResponse x
Prelude.Generic)

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

instance Prelude.NFData DeleteWorkloadShareResponse