{-# 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.DeleteEventsConfiguration
-- 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 the events configuration that allows a bot to receive outgoing
-- events.
module Amazonka.Chime.DeleteEventsConfiguration
  ( -- * Creating a Request
    DeleteEventsConfiguration (..),
    newDeleteEventsConfiguration,

    -- * Request Lenses
    deleteEventsConfiguration_accountId,
    deleteEventsConfiguration_botId,

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

-- |
-- Create a value of 'DeleteEventsConfiguration' 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', 'deleteEventsConfiguration_accountId' - The Amazon Chime account ID.
--
-- 'botId', 'deleteEventsConfiguration_botId' - The bot ID.
newDeleteEventsConfiguration ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'botId'
  Prelude.Text ->
  DeleteEventsConfiguration
newDeleteEventsConfiguration :: Text -> Text -> DeleteEventsConfiguration
newDeleteEventsConfiguration Text
pAccountId_ Text
pBotId_ =
  DeleteEventsConfiguration' :: Text -> Text -> DeleteEventsConfiguration
DeleteEventsConfiguration'
    { $sel:accountId:DeleteEventsConfiguration' :: Text
accountId = Text
pAccountId_,
      $sel:botId:DeleteEventsConfiguration' :: Text
botId = Text
pBotId_
    }

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

-- | The bot ID.
deleteEventsConfiguration_botId :: Lens.Lens' DeleteEventsConfiguration Prelude.Text
deleteEventsConfiguration_botId :: (Text -> f Text)
-> DeleteEventsConfiguration -> f DeleteEventsConfiguration
deleteEventsConfiguration_botId = (DeleteEventsConfiguration -> Text)
-> (DeleteEventsConfiguration -> Text -> DeleteEventsConfiguration)
-> Lens
     DeleteEventsConfiguration DeleteEventsConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEventsConfiguration' {Text
botId :: Text
$sel:botId:DeleteEventsConfiguration' :: DeleteEventsConfiguration -> Text
botId} -> Text
botId) (\s :: DeleteEventsConfiguration
s@DeleteEventsConfiguration' {} Text
a -> DeleteEventsConfiguration
s {$sel:botId:DeleteEventsConfiguration' :: Text
botId = Text
a} :: DeleteEventsConfiguration)

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

instance Prelude.Hashable DeleteEventsConfiguration

instance Prelude.NFData DeleteEventsConfiguration

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

instance Core.ToPath DeleteEventsConfiguration where
  toPath :: DeleteEventsConfiguration -> ByteString
toPath DeleteEventsConfiguration' {Text
botId :: Text
accountId :: Text
$sel:botId:DeleteEventsConfiguration' :: DeleteEventsConfiguration -> Text
$sel:accountId:DeleteEventsConfiguration' :: DeleteEventsConfiguration -> 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
"/bots/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
botId,
        ByteString
"/events-configuration"
      ]

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

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

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

instance
  Prelude.NFData
    DeleteEventsConfigurationResponse