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

    -- * Request Lenses
    deleteRoom_accountId,
    deleteRoom_roomId,

    -- * Destructuring the Response
    DeleteRoomResponse (..),
    newDeleteRoomResponse,
  )
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:/ 'newDeleteRoom' smart constructor.
data DeleteRoom = DeleteRoom'
  { -- | The Amazon Chime account ID.
    DeleteRoom -> Text
accountId :: Prelude.Text,
    -- | The chat room ID.
    DeleteRoom -> Text
roomId :: Prelude.Text
  }
  deriving (DeleteRoom -> DeleteRoom -> Bool
(DeleteRoom -> DeleteRoom -> Bool)
-> (DeleteRoom -> DeleteRoom -> Bool) -> Eq DeleteRoom
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRoom -> DeleteRoom -> Bool
$c/= :: DeleteRoom -> DeleteRoom -> Bool
== :: DeleteRoom -> DeleteRoom -> Bool
$c== :: DeleteRoom -> DeleteRoom -> Bool
Prelude.Eq, ReadPrec [DeleteRoom]
ReadPrec DeleteRoom
Int -> ReadS DeleteRoom
ReadS [DeleteRoom]
(Int -> ReadS DeleteRoom)
-> ReadS [DeleteRoom]
-> ReadPrec DeleteRoom
-> ReadPrec [DeleteRoom]
-> Read DeleteRoom
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRoom]
$creadListPrec :: ReadPrec [DeleteRoom]
readPrec :: ReadPrec DeleteRoom
$creadPrec :: ReadPrec DeleteRoom
readList :: ReadS [DeleteRoom]
$creadList :: ReadS [DeleteRoom]
readsPrec :: Int -> ReadS DeleteRoom
$creadsPrec :: Int -> ReadS DeleteRoom
Prelude.Read, Int -> DeleteRoom -> ShowS
[DeleteRoom] -> ShowS
DeleteRoom -> String
(Int -> DeleteRoom -> ShowS)
-> (DeleteRoom -> String)
-> ([DeleteRoom] -> ShowS)
-> Show DeleteRoom
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRoom] -> ShowS
$cshowList :: [DeleteRoom] -> ShowS
show :: DeleteRoom -> String
$cshow :: DeleteRoom -> String
showsPrec :: Int -> DeleteRoom -> ShowS
$cshowsPrec :: Int -> DeleteRoom -> ShowS
Prelude.Show, (forall x. DeleteRoom -> Rep DeleteRoom x)
-> (forall x. Rep DeleteRoom x -> DeleteRoom) -> Generic DeleteRoom
forall x. Rep DeleteRoom x -> DeleteRoom
forall x. DeleteRoom -> Rep DeleteRoom x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRoom x -> DeleteRoom
$cfrom :: forall x. DeleteRoom -> Rep DeleteRoom x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRoom' 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', 'deleteRoom_accountId' - The Amazon Chime account ID.
--
-- 'roomId', 'deleteRoom_roomId' - The chat room ID.
newDeleteRoom ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'roomId'
  Prelude.Text ->
  DeleteRoom
newDeleteRoom :: Text -> Text -> DeleteRoom
newDeleteRoom Text
pAccountId_ Text
pRoomId_ =
  DeleteRoom' :: Text -> Text -> DeleteRoom
DeleteRoom'
    { $sel:accountId:DeleteRoom' :: Text
accountId = Text
pAccountId_,
      $sel:roomId:DeleteRoom' :: Text
roomId = Text
pRoomId_
    }

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

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

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

instance Prelude.Hashable DeleteRoom

instance Prelude.NFData DeleteRoom

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

instance Core.ToPath DeleteRoom where
  toPath :: DeleteRoom -> ByteString
toPath DeleteRoom' {Text
roomId :: Text
accountId :: Text
$sel:roomId:DeleteRoom' :: DeleteRoom -> Text
$sel:accountId:DeleteRoom' :: DeleteRoom -> 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
      ]

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

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

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

instance Prelude.NFData DeleteRoomResponse