{-# 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.LexV2Models.DeleteIntent
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Removes the specified intent.
--
-- Deleting an intent also deletes the slots associated with the intent.
module Amazonka.LexV2Models.DeleteIntent
  ( -- * Creating a Request
    DeleteIntent (..),
    newDeleteIntent,

    -- * Request Lenses
    deleteIntent_intentId,
    deleteIntent_botId,
    deleteIntent_botVersion,
    deleteIntent_localeId,

    -- * Destructuring the Response
    DeleteIntentResponse (..),
    newDeleteIntentResponse,
  )
where

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

-- | /See:/ 'newDeleteIntent' smart constructor.
data DeleteIntent = DeleteIntent'
  { -- | The unique identifier of the intent to delete.
    DeleteIntent -> Text
intentId :: Prelude.Text,
    -- | The identifier of the bot associated with the intent.
    DeleteIntent -> Text
botId :: Prelude.Text,
    -- | The version of the bot associated with the intent.
    DeleteIntent -> Text
botVersion :: Prelude.Text,
    -- | The identifier of the language and locale where the bot will be deleted.
    -- The string must match one of the supported locales. For more
    -- information, see
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
    DeleteIntent -> Text
localeId :: Prelude.Text
  }
  deriving (DeleteIntent -> DeleteIntent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteIntent -> DeleteIntent -> Bool
$c/= :: DeleteIntent -> DeleteIntent -> Bool
== :: DeleteIntent -> DeleteIntent -> Bool
$c== :: DeleteIntent -> DeleteIntent -> Bool
Prelude.Eq, ReadPrec [DeleteIntent]
ReadPrec DeleteIntent
Int -> ReadS DeleteIntent
ReadS [DeleteIntent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteIntent]
$creadListPrec :: ReadPrec [DeleteIntent]
readPrec :: ReadPrec DeleteIntent
$creadPrec :: ReadPrec DeleteIntent
readList :: ReadS [DeleteIntent]
$creadList :: ReadS [DeleteIntent]
readsPrec :: Int -> ReadS DeleteIntent
$creadsPrec :: Int -> ReadS DeleteIntent
Prelude.Read, Int -> DeleteIntent -> ShowS
[DeleteIntent] -> ShowS
DeleteIntent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteIntent] -> ShowS
$cshowList :: [DeleteIntent] -> ShowS
show :: DeleteIntent -> String
$cshow :: DeleteIntent -> String
showsPrec :: Int -> DeleteIntent -> ShowS
$cshowsPrec :: Int -> DeleteIntent -> ShowS
Prelude.Show, forall x. Rep DeleteIntent x -> DeleteIntent
forall x. DeleteIntent -> Rep DeleteIntent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteIntent x -> DeleteIntent
$cfrom :: forall x. DeleteIntent -> Rep DeleteIntent x
Prelude.Generic)

-- |
-- Create a value of 'DeleteIntent' 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:
--
-- 'intentId', 'deleteIntent_intentId' - The unique identifier of the intent to delete.
--
-- 'botId', 'deleteIntent_botId' - The identifier of the bot associated with the intent.
--
-- 'botVersion', 'deleteIntent_botVersion' - The version of the bot associated with the intent.
--
-- 'localeId', 'deleteIntent_localeId' - The identifier of the language and locale where the bot will be deleted.
-- The string must match one of the supported locales. For more
-- information, see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
newDeleteIntent ::
  -- | 'intentId'
  Prelude.Text ->
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  DeleteIntent
newDeleteIntent :: Text -> Text -> Text -> Text -> DeleteIntent
newDeleteIntent
  Text
pIntentId_
  Text
pBotId_
  Text
pBotVersion_
  Text
pLocaleId_ =
    DeleteIntent'
      { $sel:intentId:DeleteIntent' :: Text
intentId = Text
pIntentId_,
        $sel:botId:DeleteIntent' :: Text
botId = Text
pBotId_,
        $sel:botVersion:DeleteIntent' :: Text
botVersion = Text
pBotVersion_,
        $sel:localeId:DeleteIntent' :: Text
localeId = Text
pLocaleId_
      }

-- | The unique identifier of the intent to delete.
deleteIntent_intentId :: Lens.Lens' DeleteIntent Prelude.Text
deleteIntent_intentId :: Lens' DeleteIntent Text
deleteIntent_intentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIntent' {Text
intentId :: Text
$sel:intentId:DeleteIntent' :: DeleteIntent -> Text
intentId} -> Text
intentId) (\s :: DeleteIntent
s@DeleteIntent' {} Text
a -> DeleteIntent
s {$sel:intentId:DeleteIntent' :: Text
intentId = Text
a} :: DeleteIntent)

-- | The identifier of the bot associated with the intent.
deleteIntent_botId :: Lens.Lens' DeleteIntent Prelude.Text
deleteIntent_botId :: Lens' DeleteIntent Text
deleteIntent_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIntent' {Text
botId :: Text
$sel:botId:DeleteIntent' :: DeleteIntent -> Text
botId} -> Text
botId) (\s :: DeleteIntent
s@DeleteIntent' {} Text
a -> DeleteIntent
s {$sel:botId:DeleteIntent' :: Text
botId = Text
a} :: DeleteIntent)

-- | The version of the bot associated with the intent.
deleteIntent_botVersion :: Lens.Lens' DeleteIntent Prelude.Text
deleteIntent_botVersion :: Lens' DeleteIntent Text
deleteIntent_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIntent' {Text
botVersion :: Text
$sel:botVersion:DeleteIntent' :: DeleteIntent -> Text
botVersion} -> Text
botVersion) (\s :: DeleteIntent
s@DeleteIntent' {} Text
a -> DeleteIntent
s {$sel:botVersion:DeleteIntent' :: Text
botVersion = Text
a} :: DeleteIntent)

-- | The identifier of the language and locale where the bot will be deleted.
-- The string must match one of the supported locales. For more
-- information, see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
deleteIntent_localeId :: Lens.Lens' DeleteIntent Prelude.Text
deleteIntent_localeId :: Lens' DeleteIntent Text
deleteIntent_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIntent' {Text
localeId :: Text
$sel:localeId:DeleteIntent' :: DeleteIntent -> Text
localeId} -> Text
localeId) (\s :: DeleteIntent
s@DeleteIntent' {} Text
a -> DeleteIntent
s {$sel:localeId:DeleteIntent' :: Text
localeId = Text
a} :: DeleteIntent)

instance Core.AWSRequest DeleteIntent where
  type AWSResponse DeleteIntent = DeleteIntentResponse
  request :: (Service -> Service) -> DeleteIntent -> Request DeleteIntent
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 DeleteIntent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteIntent)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteIntentResponse
DeleteIntentResponse'

instance Prelude.Hashable DeleteIntent where
  hashWithSalt :: Int -> DeleteIntent -> Int
hashWithSalt Int
_salt DeleteIntent' {Text
localeId :: Text
botVersion :: Text
botId :: Text
intentId :: Text
$sel:localeId:DeleteIntent' :: DeleteIntent -> Text
$sel:botVersion:DeleteIntent' :: DeleteIntent -> Text
$sel:botId:DeleteIntent' :: DeleteIntent -> Text
$sel:intentId:DeleteIntent' :: DeleteIntent -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
intentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
localeId

instance Prelude.NFData DeleteIntent where
  rnf :: DeleteIntent -> ()
rnf DeleteIntent' {Text
localeId :: Text
botVersion :: Text
botId :: Text
intentId :: Text
$sel:localeId:DeleteIntent' :: DeleteIntent -> Text
$sel:botVersion:DeleteIntent' :: DeleteIntent -> Text
$sel:botId:DeleteIntent' :: DeleteIntent -> Text
$sel:intentId:DeleteIntent' :: DeleteIntent -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
intentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
localeId

instance Data.ToHeaders DeleteIntent where
  toHeaders :: DeleteIntent -> [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 DeleteIntent where
  toPath :: DeleteIntent -> ByteString
toPath DeleteIntent' {Text
localeId :: Text
botVersion :: Text
botId :: Text
intentId :: Text
$sel:localeId:DeleteIntent' :: DeleteIntent -> Text
$sel:botVersion:DeleteIntent' :: DeleteIntent -> Text
$sel:botId:DeleteIntent' :: DeleteIntent -> Text
$sel:intentId:DeleteIntent' :: DeleteIntent -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/bots/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botId,
        ByteString
"/botversions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botVersion,
        ByteString
"/botlocales/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
localeId,
        ByteString
"/intents/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
intentId,
        ByteString
"/"
      ]

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

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

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

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