{-# 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.LexModels.DeleteBotVersion
-- 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 a specific version of a bot. To delete all versions of a bot,
-- use the DeleteBot operation.
--
-- This operation requires permissions for the @lex:DeleteBotVersion@
-- action.
module Amazonka.LexModels.DeleteBotVersion
  ( -- * Creating a Request
    DeleteBotVersion (..),
    newDeleteBotVersion,

    -- * Request Lenses
    deleteBotVersion_name,
    deleteBotVersion_version,

    -- * Destructuring the Response
    DeleteBotVersionResponse (..),
    newDeleteBotVersionResponse,
  )
where

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

-- | /See:/ 'newDeleteBotVersion' smart constructor.
data DeleteBotVersion = DeleteBotVersion'
  { -- | The name of the bot.
    DeleteBotVersion -> Text
name :: Prelude.Text,
    -- | The version of the bot to delete. You cannot delete the @$LATEST@
    -- version of the bot. To delete the @$LATEST@ version, use the DeleteBot
    -- operation.
    DeleteBotVersion -> Text
version :: Prelude.Text
  }
  deriving (DeleteBotVersion -> DeleteBotVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBotVersion -> DeleteBotVersion -> Bool
$c/= :: DeleteBotVersion -> DeleteBotVersion -> Bool
== :: DeleteBotVersion -> DeleteBotVersion -> Bool
$c== :: DeleteBotVersion -> DeleteBotVersion -> Bool
Prelude.Eq, ReadPrec [DeleteBotVersion]
ReadPrec DeleteBotVersion
Int -> ReadS DeleteBotVersion
ReadS [DeleteBotVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBotVersion]
$creadListPrec :: ReadPrec [DeleteBotVersion]
readPrec :: ReadPrec DeleteBotVersion
$creadPrec :: ReadPrec DeleteBotVersion
readList :: ReadS [DeleteBotVersion]
$creadList :: ReadS [DeleteBotVersion]
readsPrec :: Int -> ReadS DeleteBotVersion
$creadsPrec :: Int -> ReadS DeleteBotVersion
Prelude.Read, Int -> DeleteBotVersion -> ShowS
[DeleteBotVersion] -> ShowS
DeleteBotVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBotVersion] -> ShowS
$cshowList :: [DeleteBotVersion] -> ShowS
show :: DeleteBotVersion -> String
$cshow :: DeleteBotVersion -> String
showsPrec :: Int -> DeleteBotVersion -> ShowS
$cshowsPrec :: Int -> DeleteBotVersion -> ShowS
Prelude.Show, forall x. Rep DeleteBotVersion x -> DeleteBotVersion
forall x. DeleteBotVersion -> Rep DeleteBotVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBotVersion x -> DeleteBotVersion
$cfrom :: forall x. DeleteBotVersion -> Rep DeleteBotVersion x
Prelude.Generic)

-- |
-- Create a value of 'DeleteBotVersion' 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:
--
-- 'name', 'deleteBotVersion_name' - The name of the bot.
--
-- 'version', 'deleteBotVersion_version' - The version of the bot to delete. You cannot delete the @$LATEST@
-- version of the bot. To delete the @$LATEST@ version, use the DeleteBot
-- operation.
newDeleteBotVersion ::
  -- | 'name'
  Prelude.Text ->
  -- | 'version'
  Prelude.Text ->
  DeleteBotVersion
newDeleteBotVersion :: Text -> Text -> DeleteBotVersion
newDeleteBotVersion Text
pName_ Text
pVersion_ =
  DeleteBotVersion'
    { $sel:name:DeleteBotVersion' :: Text
name = Text
pName_,
      $sel:version:DeleteBotVersion' :: Text
version = Text
pVersion_
    }

-- | The name of the bot.
deleteBotVersion_name :: Lens.Lens' DeleteBotVersion Prelude.Text
deleteBotVersion_name :: Lens' DeleteBotVersion Text
deleteBotVersion_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersion' {Text
name :: Text
$sel:name:DeleteBotVersion' :: DeleteBotVersion -> Text
name} -> Text
name) (\s :: DeleteBotVersion
s@DeleteBotVersion' {} Text
a -> DeleteBotVersion
s {$sel:name:DeleteBotVersion' :: Text
name = Text
a} :: DeleteBotVersion)

-- | The version of the bot to delete. You cannot delete the @$LATEST@
-- version of the bot. To delete the @$LATEST@ version, use the DeleteBot
-- operation.
deleteBotVersion_version :: Lens.Lens' DeleteBotVersion Prelude.Text
deleteBotVersion_version :: Lens' DeleteBotVersion Text
deleteBotVersion_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersion' {Text
version :: Text
$sel:version:DeleteBotVersion' :: DeleteBotVersion -> Text
version} -> Text
version) (\s :: DeleteBotVersion
s@DeleteBotVersion' {} Text
a -> DeleteBotVersion
s {$sel:version:DeleteBotVersion' :: Text
version = Text
a} :: DeleteBotVersion)

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

instance Prelude.Hashable DeleteBotVersion where
  hashWithSalt :: Int -> DeleteBotVersion -> Int
hashWithSalt Int
_salt DeleteBotVersion' {Text
version :: Text
name :: Text
$sel:version:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:name:DeleteBotVersion' :: DeleteBotVersion -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
version

instance Prelude.NFData DeleteBotVersion where
  rnf :: DeleteBotVersion -> ()
rnf DeleteBotVersion' {Text
version :: Text
name :: Text
$sel:version:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:name:DeleteBotVersion' :: DeleteBotVersion -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
version

instance Data.ToHeaders DeleteBotVersion where
  toHeaders :: DeleteBotVersion -> [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 DeleteBotVersion where
  toPath :: DeleteBotVersion -> ByteString
toPath DeleteBotVersion' {Text
version :: Text
name :: Text
$sel:version:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:name:DeleteBotVersion' :: DeleteBotVersion -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/bots/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
name,
        ByteString
"/versions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
version
      ]

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

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

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

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