{-# 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.DeleteSlot
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the specified slot from an intent.
module Amazonka.LexV2Models.DeleteSlot
  ( -- * Creating a Request
    DeleteSlot (..),
    newDeleteSlot,

    -- * Request Lenses
    deleteSlot_slotId,
    deleteSlot_botId,
    deleteSlot_botVersion,
    deleteSlot_localeId,
    deleteSlot_intentId,

    -- * Destructuring the Response
    DeleteSlotResponse (..),
    newDeleteSlotResponse,
  )
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:/ 'newDeleteSlot' smart constructor.
data DeleteSlot = DeleteSlot'
  { -- | The identifier of the slot to delete.
    DeleteSlot -> Text
slotId :: Prelude.Text,
    -- | The identifier of the bot associated with the slot to delete.
    DeleteSlot -> Text
botId :: Prelude.Text,
    -- | The version of the bot associated with the slot to delete.
    DeleteSlot -> Text
botVersion :: Prelude.Text,
    -- | The identifier of the language and locale that the slot will be deleted
    -- from. 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>.
    DeleteSlot -> Text
localeId :: Prelude.Text,
    -- | The identifier of the intent associated with the slot.
    DeleteSlot -> Text
intentId :: Prelude.Text
  }
  deriving (DeleteSlot -> DeleteSlot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSlot -> DeleteSlot -> Bool
$c/= :: DeleteSlot -> DeleteSlot -> Bool
== :: DeleteSlot -> DeleteSlot -> Bool
$c== :: DeleteSlot -> DeleteSlot -> Bool
Prelude.Eq, ReadPrec [DeleteSlot]
ReadPrec DeleteSlot
Int -> ReadS DeleteSlot
ReadS [DeleteSlot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSlot]
$creadListPrec :: ReadPrec [DeleteSlot]
readPrec :: ReadPrec DeleteSlot
$creadPrec :: ReadPrec DeleteSlot
readList :: ReadS [DeleteSlot]
$creadList :: ReadS [DeleteSlot]
readsPrec :: Int -> ReadS DeleteSlot
$creadsPrec :: Int -> ReadS DeleteSlot
Prelude.Read, Int -> DeleteSlot -> ShowS
[DeleteSlot] -> ShowS
DeleteSlot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSlot] -> ShowS
$cshowList :: [DeleteSlot] -> ShowS
show :: DeleteSlot -> String
$cshow :: DeleteSlot -> String
showsPrec :: Int -> DeleteSlot -> ShowS
$cshowsPrec :: Int -> DeleteSlot -> ShowS
Prelude.Show, forall x. Rep DeleteSlot x -> DeleteSlot
forall x. DeleteSlot -> Rep DeleteSlot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSlot x -> DeleteSlot
$cfrom :: forall x. DeleteSlot -> Rep DeleteSlot x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSlot' 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:
--
-- 'slotId', 'deleteSlot_slotId' - The identifier of the slot to delete.
--
-- 'botId', 'deleteSlot_botId' - The identifier of the bot associated with the slot to delete.
--
-- 'botVersion', 'deleteSlot_botVersion' - The version of the bot associated with the slot to delete.
--
-- 'localeId', 'deleteSlot_localeId' - The identifier of the language and locale that the slot will be deleted
-- from. 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>.
--
-- 'intentId', 'deleteSlot_intentId' - The identifier of the intent associated with the slot.
newDeleteSlot ::
  -- | 'slotId'
  Prelude.Text ->
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  -- | 'intentId'
  Prelude.Text ->
  DeleteSlot
newDeleteSlot :: Text -> Text -> Text -> Text -> Text -> DeleteSlot
newDeleteSlot
  Text
pSlotId_
  Text
pBotId_
  Text
pBotVersion_
  Text
pLocaleId_
  Text
pIntentId_ =
    DeleteSlot'
      { $sel:slotId:DeleteSlot' :: Text
slotId = Text
pSlotId_,
        $sel:botId:DeleteSlot' :: Text
botId = Text
pBotId_,
        $sel:botVersion:DeleteSlot' :: Text
botVersion = Text
pBotVersion_,
        $sel:localeId:DeleteSlot' :: Text
localeId = Text
pLocaleId_,
        $sel:intentId:DeleteSlot' :: Text
intentId = Text
pIntentId_
      }

-- | The identifier of the slot to delete.
deleteSlot_slotId :: Lens.Lens' DeleteSlot Prelude.Text
deleteSlot_slotId :: Lens' DeleteSlot Text
deleteSlot_slotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSlot' {Text
slotId :: Text
$sel:slotId:DeleteSlot' :: DeleteSlot -> Text
slotId} -> Text
slotId) (\s :: DeleteSlot
s@DeleteSlot' {} Text
a -> DeleteSlot
s {$sel:slotId:DeleteSlot' :: Text
slotId = Text
a} :: DeleteSlot)

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

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

-- | The identifier of the language and locale that the slot will be deleted
-- from. 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>.
deleteSlot_localeId :: Lens.Lens' DeleteSlot Prelude.Text
deleteSlot_localeId :: Lens' DeleteSlot Text
deleteSlot_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSlot' {Text
localeId :: Text
$sel:localeId:DeleteSlot' :: DeleteSlot -> Text
localeId} -> Text
localeId) (\s :: DeleteSlot
s@DeleteSlot' {} Text
a -> DeleteSlot
s {$sel:localeId:DeleteSlot' :: Text
localeId = Text
a} :: DeleteSlot)

-- | The identifier of the intent associated with the slot.
deleteSlot_intentId :: Lens.Lens' DeleteSlot Prelude.Text
deleteSlot_intentId :: Lens' DeleteSlot Text
deleteSlot_intentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSlot' {Text
intentId :: Text
$sel:intentId:DeleteSlot' :: DeleteSlot -> Text
intentId} -> Text
intentId) (\s :: DeleteSlot
s@DeleteSlot' {} Text
a -> DeleteSlot
s {$sel:intentId:DeleteSlot' :: Text
intentId = Text
a} :: DeleteSlot)

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

instance Prelude.Hashable DeleteSlot where
  hashWithSalt :: Int -> DeleteSlot -> Int
hashWithSalt Int
_salt DeleteSlot' {Text
intentId :: Text
localeId :: Text
botVersion :: Text
botId :: Text
slotId :: Text
$sel:intentId:DeleteSlot' :: DeleteSlot -> Text
$sel:localeId:DeleteSlot' :: DeleteSlot -> Text
$sel:botVersion:DeleteSlot' :: DeleteSlot -> Text
$sel:botId:DeleteSlot' :: DeleteSlot -> Text
$sel:slotId:DeleteSlot' :: DeleteSlot -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
slotId
      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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
intentId

instance Prelude.NFData DeleteSlot where
  rnf :: DeleteSlot -> ()
rnf DeleteSlot' {Text
intentId :: Text
localeId :: Text
botVersion :: Text
botId :: Text
slotId :: Text
$sel:intentId:DeleteSlot' :: DeleteSlot -> Text
$sel:localeId:DeleteSlot' :: DeleteSlot -> Text
$sel:botVersion:DeleteSlot' :: DeleteSlot -> Text
$sel:botId:DeleteSlot' :: DeleteSlot -> Text
$sel:slotId:DeleteSlot' :: DeleteSlot -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
slotId
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
intentId

instance Data.ToHeaders DeleteSlot where
  toHeaders :: DeleteSlot -> [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 DeleteSlot where
  toPath :: DeleteSlot -> ByteString
toPath DeleteSlot' {Text
intentId :: Text
localeId :: Text
botVersion :: Text
botId :: Text
slotId :: Text
$sel:intentId:DeleteSlot' :: DeleteSlot -> Text
$sel:localeId:DeleteSlot' :: DeleteSlot -> Text
$sel:botVersion:DeleteSlot' :: DeleteSlot -> Text
$sel:botId:DeleteSlot' :: DeleteSlot -> Text
$sel:slotId:DeleteSlot' :: DeleteSlot -> 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
"/slots/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
slotId,
        ByteString
"/"
      ]

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

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

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

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