{-# 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.ChimeSDKMessaging.DeleteChannelModerator
-- 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)
--
-- Deletes a channel moderator.
--
-- The @x-amz-chime-bearer@ request header is mandatory. Use the
-- @AppInstanceUserArn@ of the user that makes the API call as the value in
-- the header.
module Amazonka.ChimeSDKMessaging.DeleteChannelModerator
  ( -- * Creating a Request
    DeleteChannelModerator (..),
    newDeleteChannelModerator,

    -- * Request Lenses
    deleteChannelModerator_channelArn,
    deleteChannelModerator_channelModeratorArn,
    deleteChannelModerator_chimeBearer,

    -- * Destructuring the Response
    DeleteChannelModeratorResponse (..),
    newDeleteChannelModeratorResponse,
  )
where

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

-- | /See:/ 'newDeleteChannelModerator' smart constructor.
data DeleteChannelModerator = DeleteChannelModerator'
  { -- | The ARN of the channel.
    DeleteChannelModerator -> Text
channelArn :: Prelude.Text,
    -- | The ARN of the moderator being deleted.
    DeleteChannelModerator -> Text
channelModeratorArn :: Prelude.Text,
    -- | The @AppInstanceUserArn@ of the user that makes the API call.
    DeleteChannelModerator -> Text
chimeBearer :: Prelude.Text
  }
  deriving (DeleteChannelModerator -> DeleteChannelModerator -> Bool
(DeleteChannelModerator -> DeleteChannelModerator -> Bool)
-> (DeleteChannelModerator -> DeleteChannelModerator -> Bool)
-> Eq DeleteChannelModerator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteChannelModerator -> DeleteChannelModerator -> Bool
$c/= :: DeleteChannelModerator -> DeleteChannelModerator -> Bool
== :: DeleteChannelModerator -> DeleteChannelModerator -> Bool
$c== :: DeleteChannelModerator -> DeleteChannelModerator -> Bool
Prelude.Eq, ReadPrec [DeleteChannelModerator]
ReadPrec DeleteChannelModerator
Int -> ReadS DeleteChannelModerator
ReadS [DeleteChannelModerator]
(Int -> ReadS DeleteChannelModerator)
-> ReadS [DeleteChannelModerator]
-> ReadPrec DeleteChannelModerator
-> ReadPrec [DeleteChannelModerator]
-> Read DeleteChannelModerator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteChannelModerator]
$creadListPrec :: ReadPrec [DeleteChannelModerator]
readPrec :: ReadPrec DeleteChannelModerator
$creadPrec :: ReadPrec DeleteChannelModerator
readList :: ReadS [DeleteChannelModerator]
$creadList :: ReadS [DeleteChannelModerator]
readsPrec :: Int -> ReadS DeleteChannelModerator
$creadsPrec :: Int -> ReadS DeleteChannelModerator
Prelude.Read, Int -> DeleteChannelModerator -> ShowS
[DeleteChannelModerator] -> ShowS
DeleteChannelModerator -> String
(Int -> DeleteChannelModerator -> ShowS)
-> (DeleteChannelModerator -> String)
-> ([DeleteChannelModerator] -> ShowS)
-> Show DeleteChannelModerator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteChannelModerator] -> ShowS
$cshowList :: [DeleteChannelModerator] -> ShowS
show :: DeleteChannelModerator -> String
$cshow :: DeleteChannelModerator -> String
showsPrec :: Int -> DeleteChannelModerator -> ShowS
$cshowsPrec :: Int -> DeleteChannelModerator -> ShowS
Prelude.Show, (forall x. DeleteChannelModerator -> Rep DeleteChannelModerator x)
-> (forall x.
    Rep DeleteChannelModerator x -> DeleteChannelModerator)
-> Generic DeleteChannelModerator
forall x. Rep DeleteChannelModerator x -> DeleteChannelModerator
forall x. DeleteChannelModerator -> Rep DeleteChannelModerator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteChannelModerator x -> DeleteChannelModerator
$cfrom :: forall x. DeleteChannelModerator -> Rep DeleteChannelModerator x
Prelude.Generic)

-- |
-- Create a value of 'DeleteChannelModerator' 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:
--
-- 'channelArn', 'deleteChannelModerator_channelArn' - The ARN of the channel.
--
-- 'channelModeratorArn', 'deleteChannelModerator_channelModeratorArn' - The ARN of the moderator being deleted.
--
-- 'chimeBearer', 'deleteChannelModerator_chimeBearer' - The @AppInstanceUserArn@ of the user that makes the API call.
newDeleteChannelModerator ::
  -- | 'channelArn'
  Prelude.Text ->
  -- | 'channelModeratorArn'
  Prelude.Text ->
  -- | 'chimeBearer'
  Prelude.Text ->
  DeleteChannelModerator
newDeleteChannelModerator :: Text -> Text -> Text -> DeleteChannelModerator
newDeleteChannelModerator
  Text
pChannelArn_
  Text
pChannelModeratorArn_
  Text
pChimeBearer_ =
    DeleteChannelModerator' :: Text -> Text -> Text -> DeleteChannelModerator
DeleteChannelModerator'
      { $sel:channelArn:DeleteChannelModerator' :: Text
channelArn = Text
pChannelArn_,
        $sel:channelModeratorArn:DeleteChannelModerator' :: Text
channelModeratorArn = Text
pChannelModeratorArn_,
        $sel:chimeBearer:DeleteChannelModerator' :: Text
chimeBearer = Text
pChimeBearer_
      }

-- | The ARN of the channel.
deleteChannelModerator_channelArn :: Lens.Lens' DeleteChannelModerator Prelude.Text
deleteChannelModerator_channelArn :: (Text -> f Text)
-> DeleteChannelModerator -> f DeleteChannelModerator
deleteChannelModerator_channelArn = (DeleteChannelModerator -> Text)
-> (DeleteChannelModerator -> Text -> DeleteChannelModerator)
-> Lens DeleteChannelModerator DeleteChannelModerator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChannelModerator' {Text
channelArn :: Text
$sel:channelArn:DeleteChannelModerator' :: DeleteChannelModerator -> Text
channelArn} -> Text
channelArn) (\s :: DeleteChannelModerator
s@DeleteChannelModerator' {} Text
a -> DeleteChannelModerator
s {$sel:channelArn:DeleteChannelModerator' :: Text
channelArn = Text
a} :: DeleteChannelModerator)

-- | The ARN of the moderator being deleted.
deleteChannelModerator_channelModeratorArn :: Lens.Lens' DeleteChannelModerator Prelude.Text
deleteChannelModerator_channelModeratorArn :: (Text -> f Text)
-> DeleteChannelModerator -> f DeleteChannelModerator
deleteChannelModerator_channelModeratorArn = (DeleteChannelModerator -> Text)
-> (DeleteChannelModerator -> Text -> DeleteChannelModerator)
-> Lens DeleteChannelModerator DeleteChannelModerator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChannelModerator' {Text
channelModeratorArn :: Text
$sel:channelModeratorArn:DeleteChannelModerator' :: DeleteChannelModerator -> Text
channelModeratorArn} -> Text
channelModeratorArn) (\s :: DeleteChannelModerator
s@DeleteChannelModerator' {} Text
a -> DeleteChannelModerator
s {$sel:channelModeratorArn:DeleteChannelModerator' :: Text
channelModeratorArn = Text
a} :: DeleteChannelModerator)

-- | The @AppInstanceUserArn@ of the user that makes the API call.
deleteChannelModerator_chimeBearer :: Lens.Lens' DeleteChannelModerator Prelude.Text
deleteChannelModerator_chimeBearer :: (Text -> f Text)
-> DeleteChannelModerator -> f DeleteChannelModerator
deleteChannelModerator_chimeBearer = (DeleteChannelModerator -> Text)
-> (DeleteChannelModerator -> Text -> DeleteChannelModerator)
-> Lens DeleteChannelModerator DeleteChannelModerator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChannelModerator' {Text
chimeBearer :: Text
$sel:chimeBearer:DeleteChannelModerator' :: DeleteChannelModerator -> Text
chimeBearer} -> Text
chimeBearer) (\s :: DeleteChannelModerator
s@DeleteChannelModerator' {} Text
a -> DeleteChannelModerator
s {$sel:chimeBearer:DeleteChannelModerator' :: Text
chimeBearer = Text
a} :: DeleteChannelModerator)

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

instance Prelude.Hashable DeleteChannelModerator

instance Prelude.NFData DeleteChannelModerator

instance Core.ToHeaders DeleteChannelModerator where
  toHeaders :: DeleteChannelModerator -> [Header]
toHeaders DeleteChannelModerator' {Text
chimeBearer :: Text
channelModeratorArn :: Text
channelArn :: Text
$sel:chimeBearer:DeleteChannelModerator' :: DeleteChannelModerator -> Text
$sel:channelModeratorArn:DeleteChannelModerator' :: DeleteChannelModerator -> Text
$sel:channelArn:DeleteChannelModerator' :: DeleteChannelModerator -> Text
..} =
    [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [HeaderName
"x-amz-chime-bearer" HeaderName -> Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Text
chimeBearer]

instance Core.ToPath DeleteChannelModerator where
  toPath :: DeleteChannelModerator -> ByteString
toPath DeleteChannelModerator' {Text
chimeBearer :: Text
channelModeratorArn :: Text
channelArn :: Text
$sel:chimeBearer:DeleteChannelModerator' :: DeleteChannelModerator -> Text
$sel:channelModeratorArn:DeleteChannelModerator' :: DeleteChannelModerator -> Text
$sel:channelArn:DeleteChannelModerator' :: DeleteChannelModerator -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/channels/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelArn,
        ByteString
"/moderators/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelModeratorArn
      ]

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

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

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

instance
  Prelude.NFData
    DeleteChannelModeratorResponse