{-# 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.Chime.DeleteRoomMembership
-- 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)
--
-- Removes a member from a chat room in an Amazon Chime Enterprise account.
module Amazonka.Chime.DeleteRoomMembership
  ( -- * Creating a Request
    DeleteRoomMembership (..),
    newDeleteRoomMembership,

    -- * Request Lenses
    deleteRoomMembership_accountId,
    deleteRoomMembership_roomId,
    deleteRoomMembership_memberId,

    -- * Destructuring the Response
    DeleteRoomMembershipResponse (..),
    newDeleteRoomMembershipResponse,
  )
where

import Amazonka.Chime.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:/ 'newDeleteRoomMembership' smart constructor.
data DeleteRoomMembership = DeleteRoomMembership'
  { -- | The Amazon Chime account ID.
    DeleteRoomMembership -> Text
accountId :: Prelude.Text,
    -- | The room ID.
    DeleteRoomMembership -> Text
roomId :: Prelude.Text,
    -- | The member ID (user ID or bot ID).
    DeleteRoomMembership -> Text
memberId :: Prelude.Text
  }
  deriving (DeleteRoomMembership -> DeleteRoomMembership -> Bool
(DeleteRoomMembership -> DeleteRoomMembership -> Bool)
-> (DeleteRoomMembership -> DeleteRoomMembership -> Bool)
-> Eq DeleteRoomMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRoomMembership -> DeleteRoomMembership -> Bool
$c/= :: DeleteRoomMembership -> DeleteRoomMembership -> Bool
== :: DeleteRoomMembership -> DeleteRoomMembership -> Bool
$c== :: DeleteRoomMembership -> DeleteRoomMembership -> Bool
Prelude.Eq, ReadPrec [DeleteRoomMembership]
ReadPrec DeleteRoomMembership
Int -> ReadS DeleteRoomMembership
ReadS [DeleteRoomMembership]
(Int -> ReadS DeleteRoomMembership)
-> ReadS [DeleteRoomMembership]
-> ReadPrec DeleteRoomMembership
-> ReadPrec [DeleteRoomMembership]
-> Read DeleteRoomMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRoomMembership]
$creadListPrec :: ReadPrec [DeleteRoomMembership]
readPrec :: ReadPrec DeleteRoomMembership
$creadPrec :: ReadPrec DeleteRoomMembership
readList :: ReadS [DeleteRoomMembership]
$creadList :: ReadS [DeleteRoomMembership]
readsPrec :: Int -> ReadS DeleteRoomMembership
$creadsPrec :: Int -> ReadS DeleteRoomMembership
Prelude.Read, Int -> DeleteRoomMembership -> ShowS
[DeleteRoomMembership] -> ShowS
DeleteRoomMembership -> String
(Int -> DeleteRoomMembership -> ShowS)
-> (DeleteRoomMembership -> String)
-> ([DeleteRoomMembership] -> ShowS)
-> Show DeleteRoomMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRoomMembership] -> ShowS
$cshowList :: [DeleteRoomMembership] -> ShowS
show :: DeleteRoomMembership -> String
$cshow :: DeleteRoomMembership -> String
showsPrec :: Int -> DeleteRoomMembership -> ShowS
$cshowsPrec :: Int -> DeleteRoomMembership -> ShowS
Prelude.Show, (forall x. DeleteRoomMembership -> Rep DeleteRoomMembership x)
-> (forall x. Rep DeleteRoomMembership x -> DeleteRoomMembership)
-> Generic DeleteRoomMembership
forall x. Rep DeleteRoomMembership x -> DeleteRoomMembership
forall x. DeleteRoomMembership -> Rep DeleteRoomMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRoomMembership x -> DeleteRoomMembership
$cfrom :: forall x. DeleteRoomMembership -> Rep DeleteRoomMembership x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRoomMembership' 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:
--
-- 'accountId', 'deleteRoomMembership_accountId' - The Amazon Chime account ID.
--
-- 'roomId', 'deleteRoomMembership_roomId' - The room ID.
--
-- 'memberId', 'deleteRoomMembership_memberId' - The member ID (user ID or bot ID).
newDeleteRoomMembership ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'roomId'
  Prelude.Text ->
  -- | 'memberId'
  Prelude.Text ->
  DeleteRoomMembership
newDeleteRoomMembership :: Text -> Text -> Text -> DeleteRoomMembership
newDeleteRoomMembership
  Text
pAccountId_
  Text
pRoomId_
  Text
pMemberId_ =
    DeleteRoomMembership' :: Text -> Text -> Text -> DeleteRoomMembership
DeleteRoomMembership'
      { $sel:accountId:DeleteRoomMembership' :: Text
accountId = Text
pAccountId_,
        $sel:roomId:DeleteRoomMembership' :: Text
roomId = Text
pRoomId_,
        $sel:memberId:DeleteRoomMembership' :: Text
memberId = Text
pMemberId_
      }

-- | The Amazon Chime account ID.
deleteRoomMembership_accountId :: Lens.Lens' DeleteRoomMembership Prelude.Text
deleteRoomMembership_accountId :: (Text -> f Text) -> DeleteRoomMembership -> f DeleteRoomMembership
deleteRoomMembership_accountId = (DeleteRoomMembership -> Text)
-> (DeleteRoomMembership -> Text -> DeleteRoomMembership)
-> Lens DeleteRoomMembership DeleteRoomMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRoomMembership' {Text
accountId :: Text
$sel:accountId:DeleteRoomMembership' :: DeleteRoomMembership -> Text
accountId} -> Text
accountId) (\s :: DeleteRoomMembership
s@DeleteRoomMembership' {} Text
a -> DeleteRoomMembership
s {$sel:accountId:DeleteRoomMembership' :: Text
accountId = Text
a} :: DeleteRoomMembership)

-- | The room ID.
deleteRoomMembership_roomId :: Lens.Lens' DeleteRoomMembership Prelude.Text
deleteRoomMembership_roomId :: (Text -> f Text) -> DeleteRoomMembership -> f DeleteRoomMembership
deleteRoomMembership_roomId = (DeleteRoomMembership -> Text)
-> (DeleteRoomMembership -> Text -> DeleteRoomMembership)
-> Lens DeleteRoomMembership DeleteRoomMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRoomMembership' {Text
roomId :: Text
$sel:roomId:DeleteRoomMembership' :: DeleteRoomMembership -> Text
roomId} -> Text
roomId) (\s :: DeleteRoomMembership
s@DeleteRoomMembership' {} Text
a -> DeleteRoomMembership
s {$sel:roomId:DeleteRoomMembership' :: Text
roomId = Text
a} :: DeleteRoomMembership)

-- | The member ID (user ID or bot ID).
deleteRoomMembership_memberId :: Lens.Lens' DeleteRoomMembership Prelude.Text
deleteRoomMembership_memberId :: (Text -> f Text) -> DeleteRoomMembership -> f DeleteRoomMembership
deleteRoomMembership_memberId = (DeleteRoomMembership -> Text)
-> (DeleteRoomMembership -> Text -> DeleteRoomMembership)
-> Lens DeleteRoomMembership DeleteRoomMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRoomMembership' {Text
memberId :: Text
$sel:memberId:DeleteRoomMembership' :: DeleteRoomMembership -> Text
memberId} -> Text
memberId) (\s :: DeleteRoomMembership
s@DeleteRoomMembership' {} Text
a -> DeleteRoomMembership
s {$sel:memberId:DeleteRoomMembership' :: Text
memberId = Text
a} :: DeleteRoomMembership)

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

instance Prelude.Hashable DeleteRoomMembership

instance Prelude.NFData DeleteRoomMembership

instance Core.ToHeaders DeleteRoomMembership where
  toHeaders :: DeleteRoomMembership -> [Header]
toHeaders = [Header] -> DeleteRoomMembership -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DeleteRoomMembership where
  toPath :: DeleteRoomMembership -> ByteString
toPath DeleteRoomMembership' {Text
memberId :: Text
roomId :: Text
accountId :: Text
$sel:memberId:DeleteRoomMembership' :: DeleteRoomMembership -> Text
$sel:roomId:DeleteRoomMembership' :: DeleteRoomMembership -> Text
$sel:accountId:DeleteRoomMembership' :: DeleteRoomMembership -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
        ByteString
"/rooms/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
roomId,
        ByteString
"/memberships/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
memberId
      ]

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

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

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

instance Prelude.NFData DeleteRoomMembershipResponse