{-# 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 #-}
module Amazonka.LexV2Models.DeleteBotVersion
(
DeleteBotVersion (..),
newDeleteBotVersion,
deleteBotVersion_skipResourceInUseCheck,
deleteBotVersion_botId,
deleteBotVersion_botVersion,
DeleteBotVersionResponse (..),
newDeleteBotVersionResponse,
deleteBotVersionResponse_botId,
deleteBotVersionResponse_botStatus,
deleteBotVersionResponse_botVersion,
deleteBotVersionResponse_httpStatus,
)
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
data DeleteBotVersion = DeleteBotVersion'
{
DeleteBotVersion -> Maybe Bool
skipResourceInUseCheck :: Prelude.Maybe Prelude.Bool,
DeleteBotVersion -> Text
botId :: Prelude.Text,
DeleteBotVersion -> Text
botVersion :: 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)
newDeleteBotVersion ::
Prelude.Text ->
Prelude.Text ->
DeleteBotVersion
newDeleteBotVersion :: Text -> Text -> DeleteBotVersion
newDeleteBotVersion Text
pBotId_ Text
pBotVersion_ =
DeleteBotVersion'
{ $sel:skipResourceInUseCheck:DeleteBotVersion' :: Maybe Bool
skipResourceInUseCheck =
forall a. Maybe a
Prelude.Nothing,
$sel:botId:DeleteBotVersion' :: Text
botId = Text
pBotId_,
$sel:botVersion:DeleteBotVersion' :: Text
botVersion = Text
pBotVersion_
}
deleteBotVersion_skipResourceInUseCheck :: Lens.Lens' DeleteBotVersion (Prelude.Maybe Prelude.Bool)
deleteBotVersion_skipResourceInUseCheck :: Lens' DeleteBotVersion (Maybe Bool)
deleteBotVersion_skipResourceInUseCheck = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersion' {Maybe Bool
skipResourceInUseCheck :: Maybe Bool
$sel:skipResourceInUseCheck:DeleteBotVersion' :: DeleteBotVersion -> Maybe Bool
skipResourceInUseCheck} -> Maybe Bool
skipResourceInUseCheck) (\s :: DeleteBotVersion
s@DeleteBotVersion' {} Maybe Bool
a -> DeleteBotVersion
s {$sel:skipResourceInUseCheck:DeleteBotVersion' :: Maybe Bool
skipResourceInUseCheck = Maybe Bool
a} :: DeleteBotVersion)
deleteBotVersion_botId :: Lens.Lens' DeleteBotVersion Prelude.Text
deleteBotVersion_botId :: Lens' DeleteBotVersion Text
deleteBotVersion_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersion' {Text
botId :: Text
$sel:botId:DeleteBotVersion' :: DeleteBotVersion -> Text
botId} -> Text
botId) (\s :: DeleteBotVersion
s@DeleteBotVersion' {} Text
a -> DeleteBotVersion
s {$sel:botId:DeleteBotVersion' :: Text
botId = Text
a} :: DeleteBotVersion)
deleteBotVersion_botVersion :: Lens.Lens' DeleteBotVersion Prelude.Text
deleteBotVersion_botVersion :: Lens' DeleteBotVersion Text
deleteBotVersion_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersion' {Text
botVersion :: Text
$sel:botVersion:DeleteBotVersion' :: DeleteBotVersion -> Text
botVersion} -> Text
botVersion) (\s :: DeleteBotVersion
s@DeleteBotVersion' {} Text
a -> DeleteBotVersion
s {$sel:botVersion:DeleteBotVersion' :: Text
botVersion = 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 =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe BotStatus -> Maybe Text -> Int -> DeleteBotVersionResponse
DeleteBotVersionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botVersion")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteBotVersion where
hashWithSalt :: Int -> DeleteBotVersion -> Int
hashWithSalt Int
_salt DeleteBotVersion' {Maybe Bool
Text
botVersion :: Text
botId :: Text
skipResourceInUseCheck :: Maybe Bool
$sel:botVersion:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:botId:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:skipResourceInUseCheck:DeleteBotVersion' :: DeleteBotVersion -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
skipResourceInUseCheck
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botVersion
instance Prelude.NFData DeleteBotVersion where
rnf :: DeleteBotVersion -> ()
rnf DeleteBotVersion' {Maybe Bool
Text
botVersion :: Text
botId :: Text
skipResourceInUseCheck :: Maybe Bool
$sel:botVersion:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:botId:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:skipResourceInUseCheck:DeleteBotVersion' :: DeleteBotVersion -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
skipResourceInUseCheck
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
instance Data.ToHeaders DeleteBotVersion where
toHeaders :: DeleteBotVersion -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteBotVersion where
toPath :: DeleteBotVersion -> ByteString
toPath DeleteBotVersion' {Maybe Bool
Text
botVersion :: Text
botId :: Text
skipResourceInUseCheck :: Maybe Bool
$sel:botVersion:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:botId:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:skipResourceInUseCheck:DeleteBotVersion' :: DeleteBotVersion -> Maybe Bool
..} =
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
"/"
]
instance Data.ToQuery DeleteBotVersion where
toQuery :: DeleteBotVersion -> QueryString
toQuery DeleteBotVersion' {Maybe Bool
Text
botVersion :: Text
botId :: Text
skipResourceInUseCheck :: Maybe Bool
$sel:botVersion:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:botId:DeleteBotVersion' :: DeleteBotVersion -> Text
$sel:skipResourceInUseCheck:DeleteBotVersion' :: DeleteBotVersion -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"skipResourceInUseCheck"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
skipResourceInUseCheck
]
data DeleteBotVersionResponse = DeleteBotVersionResponse'
{
DeleteBotVersionResponse -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
DeleteBotVersionResponse -> Maybe BotStatus
botStatus :: Prelude.Maybe BotStatus,
DeleteBotVersionResponse -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
DeleteBotVersionResponse -> Int
httpStatus :: Prelude.Int
}
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)
newDeleteBotVersionResponse ::
Prelude.Int ->
DeleteBotVersionResponse
newDeleteBotVersionResponse :: Int -> DeleteBotVersionResponse
newDeleteBotVersionResponse Int
pHttpStatus_ =
DeleteBotVersionResponse'
{ $sel:botId:DeleteBotVersionResponse' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
$sel:botStatus:DeleteBotVersionResponse' :: Maybe BotStatus
botStatus = forall a. Maybe a
Prelude.Nothing,
$sel:botVersion:DeleteBotVersionResponse' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteBotVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteBotVersionResponse_botId :: Lens.Lens' DeleteBotVersionResponse (Prelude.Maybe Prelude.Text)
deleteBotVersionResponse_botId :: Lens' DeleteBotVersionResponse (Maybe Text)
deleteBotVersionResponse_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersionResponse' {Maybe Text
botId :: Maybe Text
$sel:botId:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Maybe Text
botId} -> Maybe Text
botId) (\s :: DeleteBotVersionResponse
s@DeleteBotVersionResponse' {} Maybe Text
a -> DeleteBotVersionResponse
s {$sel:botId:DeleteBotVersionResponse' :: Maybe Text
botId = Maybe Text
a} :: DeleteBotVersionResponse)
deleteBotVersionResponse_botStatus :: Lens.Lens' DeleteBotVersionResponse (Prelude.Maybe BotStatus)
deleteBotVersionResponse_botStatus :: Lens' DeleteBotVersionResponse (Maybe BotStatus)
deleteBotVersionResponse_botStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersionResponse' {Maybe BotStatus
botStatus :: Maybe BotStatus
$sel:botStatus:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Maybe BotStatus
botStatus} -> Maybe BotStatus
botStatus) (\s :: DeleteBotVersionResponse
s@DeleteBotVersionResponse' {} Maybe BotStatus
a -> DeleteBotVersionResponse
s {$sel:botStatus:DeleteBotVersionResponse' :: Maybe BotStatus
botStatus = Maybe BotStatus
a} :: DeleteBotVersionResponse)
deleteBotVersionResponse_botVersion :: Lens.Lens' DeleteBotVersionResponse (Prelude.Maybe Prelude.Text)
deleteBotVersionResponse_botVersion :: Lens' DeleteBotVersionResponse (Maybe Text)
deleteBotVersionResponse_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersionResponse' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: DeleteBotVersionResponse
s@DeleteBotVersionResponse' {} Maybe Text
a -> DeleteBotVersionResponse
s {$sel:botVersion:DeleteBotVersionResponse' :: Maybe Text
botVersion = Maybe Text
a} :: DeleteBotVersionResponse)
deleteBotVersionResponse_httpStatus :: Lens.Lens' DeleteBotVersionResponse Prelude.Int
deleteBotVersionResponse_httpStatus :: Lens' DeleteBotVersionResponse Int
deleteBotVersionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBotVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteBotVersionResponse
s@DeleteBotVersionResponse' {} Int
a -> DeleteBotVersionResponse
s {$sel:httpStatus:DeleteBotVersionResponse' :: Int
httpStatus = Int
a} :: DeleteBotVersionResponse)
instance Prelude.NFData DeleteBotVersionResponse where
rnf :: DeleteBotVersionResponse -> ()
rnf DeleteBotVersionResponse' {Int
Maybe Text
Maybe BotStatus
httpStatus :: Int
botVersion :: Maybe Text
botStatus :: Maybe BotStatus
botId :: Maybe Text
$sel:httpStatus:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Int
$sel:botVersion:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Maybe Text
$sel:botStatus:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Maybe BotStatus
$sel:botId:DeleteBotVersionResponse' :: DeleteBotVersionResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BotStatus
botStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus