{-# 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.Connect.DisassociateLexBot
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Revokes authorization from the specified instance to access the
-- specified Amazon Lex bot.
module Amazonka.Connect.DisassociateLexBot
  ( -- * Creating a Request
    DisassociateLexBot (..),
    newDisassociateLexBot,

    -- * Request Lenses
    disassociateLexBot_instanceId,
    disassociateLexBot_botName,
    disassociateLexBot_lexRegion,

    -- * Destructuring the Response
    DisassociateLexBotResponse (..),
    newDisassociateLexBotResponse,
  )
where

import Amazonka.Connect.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDisassociateLexBot' smart constructor.
data DisassociateLexBot = DisassociateLexBot'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    DisassociateLexBot -> Text
instanceId :: Prelude.Text,
    -- | The name of the Amazon Lex bot. Maximum character limit of 50.
    DisassociateLexBot -> Text
botName :: Prelude.Text,
    -- | The Amazon Web Services Region in which the Amazon Lex bot has been
    -- created.
    DisassociateLexBot -> Text
lexRegion :: Prelude.Text
  }
  deriving (DisassociateLexBot -> DisassociateLexBot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateLexBot -> DisassociateLexBot -> Bool
$c/= :: DisassociateLexBot -> DisassociateLexBot -> Bool
== :: DisassociateLexBot -> DisassociateLexBot -> Bool
$c== :: DisassociateLexBot -> DisassociateLexBot -> Bool
Prelude.Eq, ReadPrec [DisassociateLexBot]
ReadPrec DisassociateLexBot
Int -> ReadS DisassociateLexBot
ReadS [DisassociateLexBot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateLexBot]
$creadListPrec :: ReadPrec [DisassociateLexBot]
readPrec :: ReadPrec DisassociateLexBot
$creadPrec :: ReadPrec DisassociateLexBot
readList :: ReadS [DisassociateLexBot]
$creadList :: ReadS [DisassociateLexBot]
readsPrec :: Int -> ReadS DisassociateLexBot
$creadsPrec :: Int -> ReadS DisassociateLexBot
Prelude.Read, Int -> DisassociateLexBot -> ShowS
[DisassociateLexBot] -> ShowS
DisassociateLexBot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateLexBot] -> ShowS
$cshowList :: [DisassociateLexBot] -> ShowS
show :: DisassociateLexBot -> String
$cshow :: DisassociateLexBot -> String
showsPrec :: Int -> DisassociateLexBot -> ShowS
$cshowsPrec :: Int -> DisassociateLexBot -> ShowS
Prelude.Show, forall x. Rep DisassociateLexBot x -> DisassociateLexBot
forall x. DisassociateLexBot -> Rep DisassociateLexBot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateLexBot x -> DisassociateLexBot
$cfrom :: forall x. DisassociateLexBot -> Rep DisassociateLexBot x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateLexBot' 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:
--
-- 'instanceId', 'disassociateLexBot_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'botName', 'disassociateLexBot_botName' - The name of the Amazon Lex bot. Maximum character limit of 50.
--
-- 'lexRegion', 'disassociateLexBot_lexRegion' - The Amazon Web Services Region in which the Amazon Lex bot has been
-- created.
newDisassociateLexBot ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'botName'
  Prelude.Text ->
  -- | 'lexRegion'
  Prelude.Text ->
  DisassociateLexBot
newDisassociateLexBot :: Text -> Text -> Text -> DisassociateLexBot
newDisassociateLexBot
  Text
pInstanceId_
  Text
pBotName_
  Text
pLexRegion_ =
    DisassociateLexBot'
      { $sel:instanceId:DisassociateLexBot' :: Text
instanceId = Text
pInstanceId_,
        $sel:botName:DisassociateLexBot' :: Text
botName = Text
pBotName_,
        $sel:lexRegion:DisassociateLexBot' :: Text
lexRegion = Text
pLexRegion_
      }

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
disassociateLexBot_instanceId :: Lens.Lens' DisassociateLexBot Prelude.Text
disassociateLexBot_instanceId :: Lens' DisassociateLexBot Text
disassociateLexBot_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLexBot' {Text
instanceId :: Text
$sel:instanceId:DisassociateLexBot' :: DisassociateLexBot -> Text
instanceId} -> Text
instanceId) (\s :: DisassociateLexBot
s@DisassociateLexBot' {} Text
a -> DisassociateLexBot
s {$sel:instanceId:DisassociateLexBot' :: Text
instanceId = Text
a} :: DisassociateLexBot)

-- | The name of the Amazon Lex bot. Maximum character limit of 50.
disassociateLexBot_botName :: Lens.Lens' DisassociateLexBot Prelude.Text
disassociateLexBot_botName :: Lens' DisassociateLexBot Text
disassociateLexBot_botName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLexBot' {Text
botName :: Text
$sel:botName:DisassociateLexBot' :: DisassociateLexBot -> Text
botName} -> Text
botName) (\s :: DisassociateLexBot
s@DisassociateLexBot' {} Text
a -> DisassociateLexBot
s {$sel:botName:DisassociateLexBot' :: Text
botName = Text
a} :: DisassociateLexBot)

-- | The Amazon Web Services Region in which the Amazon Lex bot has been
-- created.
disassociateLexBot_lexRegion :: Lens.Lens' DisassociateLexBot Prelude.Text
disassociateLexBot_lexRegion :: Lens' DisassociateLexBot Text
disassociateLexBot_lexRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLexBot' {Text
lexRegion :: Text
$sel:lexRegion:DisassociateLexBot' :: DisassociateLexBot -> Text
lexRegion} -> Text
lexRegion) (\s :: DisassociateLexBot
s@DisassociateLexBot' {} Text
a -> DisassociateLexBot
s {$sel:lexRegion:DisassociateLexBot' :: Text
lexRegion = Text
a} :: DisassociateLexBot)

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

instance Prelude.Hashable DisassociateLexBot where
  hashWithSalt :: Int -> DisassociateLexBot -> Int
hashWithSalt Int
_salt DisassociateLexBot' {Text
lexRegion :: Text
botName :: Text
instanceId :: Text
$sel:lexRegion:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:botName:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:instanceId:DisassociateLexBot' :: DisassociateLexBot -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lexRegion

instance Prelude.NFData DisassociateLexBot where
  rnf :: DisassociateLexBot -> ()
rnf DisassociateLexBot' {Text
lexRegion :: Text
botName :: Text
instanceId :: Text
$sel:lexRegion:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:botName:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:instanceId:DisassociateLexBot' :: DisassociateLexBot -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lexRegion

instance Data.ToHeaders DisassociateLexBot where
  toHeaders :: DisassociateLexBot -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DisassociateLexBot where
  toPath :: DisassociateLexBot -> ByteString
toPath DisassociateLexBot' {Text
lexRegion :: Text
botName :: Text
instanceId :: Text
$sel:lexRegion:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:botName:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:instanceId:DisassociateLexBot' :: DisassociateLexBot -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/instance/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId, ByteString
"/lex-bot"]

instance Data.ToQuery DisassociateLexBot where
  toQuery :: DisassociateLexBot -> QueryString
toQuery DisassociateLexBot' {Text
lexRegion :: Text
botName :: Text
instanceId :: Text
$sel:lexRegion:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:botName:DisassociateLexBot' :: DisassociateLexBot -> Text
$sel:instanceId:DisassociateLexBot' :: DisassociateLexBot -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"botName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
botName,
        ByteString
"lexRegion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
lexRegion
      ]

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

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

instance Prelude.NFData DisassociateLexBotResponse where
  rnf :: DisassociateLexBotResponse -> ()
rnf DisassociateLexBotResponse
_ = ()