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

    -- * Request Lenses
    deleteSlotTypeVersion_name,
    deleteSlotTypeVersion_version,

    -- * Destructuring the Response
    DeleteSlotTypeVersionResponse (..),
    newDeleteSlotTypeVersionResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteSlotTypeVersion' 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', 'deleteSlotTypeVersion_name' - The name of the slot type.
--
-- 'version', 'deleteSlotTypeVersion_version' - The version of the slot type to delete. You cannot delete the @$LATEST@
-- version of the slot type. To delete the @$LATEST@ version, use the
-- DeleteSlotType operation.
newDeleteSlotTypeVersion ::
  -- | 'name'
  Prelude.Text ->
  -- | 'version'
  Prelude.Text ->
  DeleteSlotTypeVersion
newDeleteSlotTypeVersion :: Text -> Text -> DeleteSlotTypeVersion
newDeleteSlotTypeVersion Text
pName_ Text
pVersion_ =
  DeleteSlotTypeVersion' :: Text -> Text -> DeleteSlotTypeVersion
DeleteSlotTypeVersion'
    { $sel:name:DeleteSlotTypeVersion' :: Text
name = Text
pName_,
      $sel:version:DeleteSlotTypeVersion' :: Text
version = Text
pVersion_
    }

-- | The name of the slot type.
deleteSlotTypeVersion_name :: Lens.Lens' DeleteSlotTypeVersion Prelude.Text
deleteSlotTypeVersion_name :: (Text -> f Text)
-> DeleteSlotTypeVersion -> f DeleteSlotTypeVersion
deleteSlotTypeVersion_name = (DeleteSlotTypeVersion -> Text)
-> (DeleteSlotTypeVersion -> Text -> DeleteSlotTypeVersion)
-> Lens DeleteSlotTypeVersion DeleteSlotTypeVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSlotTypeVersion' {Text
name :: Text
$sel:name:DeleteSlotTypeVersion' :: DeleteSlotTypeVersion -> Text
name} -> Text
name) (\s :: DeleteSlotTypeVersion
s@DeleteSlotTypeVersion' {} Text
a -> DeleteSlotTypeVersion
s {$sel:name:DeleteSlotTypeVersion' :: Text
name = Text
a} :: DeleteSlotTypeVersion)

-- | The version of the slot type to delete. You cannot delete the @$LATEST@
-- version of the slot type. To delete the @$LATEST@ version, use the
-- DeleteSlotType operation.
deleteSlotTypeVersion_version :: Lens.Lens' DeleteSlotTypeVersion Prelude.Text
deleteSlotTypeVersion_version :: (Text -> f Text)
-> DeleteSlotTypeVersion -> f DeleteSlotTypeVersion
deleteSlotTypeVersion_version = (DeleteSlotTypeVersion -> Text)
-> (DeleteSlotTypeVersion -> Text -> DeleteSlotTypeVersion)
-> Lens DeleteSlotTypeVersion DeleteSlotTypeVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSlotTypeVersion' {Text
version :: Text
$sel:version:DeleteSlotTypeVersion' :: DeleteSlotTypeVersion -> Text
version} -> Text
version) (\s :: DeleteSlotTypeVersion
s@DeleteSlotTypeVersion' {} Text
a -> DeleteSlotTypeVersion
s {$sel:version:DeleteSlotTypeVersion' :: Text
version = Text
a} :: DeleteSlotTypeVersion)

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

instance Prelude.Hashable DeleteSlotTypeVersion

instance Prelude.NFData DeleteSlotTypeVersion

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

instance Core.ToPath DeleteSlotTypeVersion where
  toPath :: DeleteSlotTypeVersion -> ByteString
toPath DeleteSlotTypeVersion' {Text
version :: Text
name :: Text
$sel:version:DeleteSlotTypeVersion' :: DeleteSlotTypeVersion -> Text
$sel:name:DeleteSlotTypeVersion' :: DeleteSlotTypeVersion -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/slottypes/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name,
        ByteString
"/version/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
version
      ]

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

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

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

instance Prelude.NFData DeleteSlotTypeVersionResponse