{-# 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.MachineLearning.DeleteRealtimeEndpoint
(
DeleteRealtimeEndpoint (..),
newDeleteRealtimeEndpoint,
deleteRealtimeEndpoint_mLModelId,
DeleteRealtimeEndpointResponse (..),
newDeleteRealtimeEndpointResponse,
deleteRealtimeEndpointResponse_mLModelId,
deleteRealtimeEndpointResponse_realtimeEndpointInfo,
deleteRealtimeEndpointResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MachineLearning.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteRealtimeEndpoint = DeleteRealtimeEndpoint'
{
DeleteRealtimeEndpoint -> Text
mLModelId :: Prelude.Text
}
deriving (DeleteRealtimeEndpoint -> DeleteRealtimeEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRealtimeEndpoint -> DeleteRealtimeEndpoint -> Bool
$c/= :: DeleteRealtimeEndpoint -> DeleteRealtimeEndpoint -> Bool
== :: DeleteRealtimeEndpoint -> DeleteRealtimeEndpoint -> Bool
$c== :: DeleteRealtimeEndpoint -> DeleteRealtimeEndpoint -> Bool
Prelude.Eq, ReadPrec [DeleteRealtimeEndpoint]
ReadPrec DeleteRealtimeEndpoint
Int -> ReadS DeleteRealtimeEndpoint
ReadS [DeleteRealtimeEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRealtimeEndpoint]
$creadListPrec :: ReadPrec [DeleteRealtimeEndpoint]
readPrec :: ReadPrec DeleteRealtimeEndpoint
$creadPrec :: ReadPrec DeleteRealtimeEndpoint
readList :: ReadS [DeleteRealtimeEndpoint]
$creadList :: ReadS [DeleteRealtimeEndpoint]
readsPrec :: Int -> ReadS DeleteRealtimeEndpoint
$creadsPrec :: Int -> ReadS DeleteRealtimeEndpoint
Prelude.Read, Int -> DeleteRealtimeEndpoint -> ShowS
[DeleteRealtimeEndpoint] -> ShowS
DeleteRealtimeEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRealtimeEndpoint] -> ShowS
$cshowList :: [DeleteRealtimeEndpoint] -> ShowS
show :: DeleteRealtimeEndpoint -> String
$cshow :: DeleteRealtimeEndpoint -> String
showsPrec :: Int -> DeleteRealtimeEndpoint -> ShowS
$cshowsPrec :: Int -> DeleteRealtimeEndpoint -> ShowS
Prelude.Show, forall x. Rep DeleteRealtimeEndpoint x -> DeleteRealtimeEndpoint
forall x. DeleteRealtimeEndpoint -> Rep DeleteRealtimeEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRealtimeEndpoint x -> DeleteRealtimeEndpoint
$cfrom :: forall x. DeleteRealtimeEndpoint -> Rep DeleteRealtimeEndpoint x
Prelude.Generic)
newDeleteRealtimeEndpoint ::
Prelude.Text ->
DeleteRealtimeEndpoint
newDeleteRealtimeEndpoint :: Text -> DeleteRealtimeEndpoint
newDeleteRealtimeEndpoint Text
pMLModelId_ =
DeleteRealtimeEndpoint' {$sel:mLModelId:DeleteRealtimeEndpoint' :: Text
mLModelId = Text
pMLModelId_}
deleteRealtimeEndpoint_mLModelId :: Lens.Lens' DeleteRealtimeEndpoint Prelude.Text
deleteRealtimeEndpoint_mLModelId :: Lens' DeleteRealtimeEndpoint Text
deleteRealtimeEndpoint_mLModelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRealtimeEndpoint' {Text
mLModelId :: Text
$sel:mLModelId:DeleteRealtimeEndpoint' :: DeleteRealtimeEndpoint -> Text
mLModelId} -> Text
mLModelId) (\s :: DeleteRealtimeEndpoint
s@DeleteRealtimeEndpoint' {} Text
a -> DeleteRealtimeEndpoint
s {$sel:mLModelId:DeleteRealtimeEndpoint' :: Text
mLModelId = Text
a} :: DeleteRealtimeEndpoint)
instance Core.AWSRequest DeleteRealtimeEndpoint where
type
AWSResponse DeleteRealtimeEndpoint =
DeleteRealtimeEndpointResponse
request :: (Service -> Service)
-> DeleteRealtimeEndpoint -> Request DeleteRealtimeEndpoint
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteRealtimeEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteRealtimeEndpoint)))
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 RealtimeEndpointInfo
-> Int
-> DeleteRealtimeEndpointResponse
DeleteRealtimeEndpointResponse'
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
"MLModelId")
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
"RealtimeEndpointInfo")
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 DeleteRealtimeEndpoint where
hashWithSalt :: Int -> DeleteRealtimeEndpoint -> Int
hashWithSalt Int
_salt DeleteRealtimeEndpoint' {Text
mLModelId :: Text
$sel:mLModelId:DeleteRealtimeEndpoint' :: DeleteRealtimeEndpoint -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
mLModelId
instance Prelude.NFData DeleteRealtimeEndpoint where
rnf :: DeleteRealtimeEndpoint -> ()
rnf DeleteRealtimeEndpoint' {Text
mLModelId :: Text
$sel:mLModelId:DeleteRealtimeEndpoint' :: DeleteRealtimeEndpoint -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
mLModelId
instance Data.ToHeaders DeleteRealtimeEndpoint where
toHeaders :: DeleteRealtimeEndpoint -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonML_20141212.DeleteRealtimeEndpoint" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteRealtimeEndpoint where
toJSON :: DeleteRealtimeEndpoint -> Value
toJSON DeleteRealtimeEndpoint' {Text
mLModelId :: Text
$sel:mLModelId:DeleteRealtimeEndpoint' :: DeleteRealtimeEndpoint -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"MLModelId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
mLModelId)]
)
instance Data.ToPath DeleteRealtimeEndpoint where
toPath :: DeleteRealtimeEndpoint -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteRealtimeEndpoint where
toQuery :: DeleteRealtimeEndpoint -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteRealtimeEndpointResponse = DeleteRealtimeEndpointResponse'
{
DeleteRealtimeEndpointResponse -> Maybe Text
mLModelId :: Prelude.Maybe Prelude.Text,
DeleteRealtimeEndpointResponse -> Maybe RealtimeEndpointInfo
realtimeEndpointInfo :: Prelude.Maybe RealtimeEndpointInfo,
DeleteRealtimeEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteRealtimeEndpointResponse
-> DeleteRealtimeEndpointResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRealtimeEndpointResponse
-> DeleteRealtimeEndpointResponse -> Bool
$c/= :: DeleteRealtimeEndpointResponse
-> DeleteRealtimeEndpointResponse -> Bool
== :: DeleteRealtimeEndpointResponse
-> DeleteRealtimeEndpointResponse -> Bool
$c== :: DeleteRealtimeEndpointResponse
-> DeleteRealtimeEndpointResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRealtimeEndpointResponse]
ReadPrec DeleteRealtimeEndpointResponse
Int -> ReadS DeleteRealtimeEndpointResponse
ReadS [DeleteRealtimeEndpointResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRealtimeEndpointResponse]
$creadListPrec :: ReadPrec [DeleteRealtimeEndpointResponse]
readPrec :: ReadPrec DeleteRealtimeEndpointResponse
$creadPrec :: ReadPrec DeleteRealtimeEndpointResponse
readList :: ReadS [DeleteRealtimeEndpointResponse]
$creadList :: ReadS [DeleteRealtimeEndpointResponse]
readsPrec :: Int -> ReadS DeleteRealtimeEndpointResponse
$creadsPrec :: Int -> ReadS DeleteRealtimeEndpointResponse
Prelude.Read, Int -> DeleteRealtimeEndpointResponse -> ShowS
[DeleteRealtimeEndpointResponse] -> ShowS
DeleteRealtimeEndpointResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRealtimeEndpointResponse] -> ShowS
$cshowList :: [DeleteRealtimeEndpointResponse] -> ShowS
show :: DeleteRealtimeEndpointResponse -> String
$cshow :: DeleteRealtimeEndpointResponse -> String
showsPrec :: Int -> DeleteRealtimeEndpointResponse -> ShowS
$cshowsPrec :: Int -> DeleteRealtimeEndpointResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteRealtimeEndpointResponse x
-> DeleteRealtimeEndpointResponse
forall x.
DeleteRealtimeEndpointResponse
-> Rep DeleteRealtimeEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRealtimeEndpointResponse x
-> DeleteRealtimeEndpointResponse
$cfrom :: forall x.
DeleteRealtimeEndpointResponse
-> Rep DeleteRealtimeEndpointResponse x
Prelude.Generic)
newDeleteRealtimeEndpointResponse ::
Prelude.Int ->
DeleteRealtimeEndpointResponse
newDeleteRealtimeEndpointResponse :: Int -> DeleteRealtimeEndpointResponse
newDeleteRealtimeEndpointResponse Int
pHttpStatus_ =
DeleteRealtimeEndpointResponse'
{ $sel:mLModelId:DeleteRealtimeEndpointResponse' :: Maybe Text
mLModelId =
forall a. Maybe a
Prelude.Nothing,
$sel:realtimeEndpointInfo:DeleteRealtimeEndpointResponse' :: Maybe RealtimeEndpointInfo
realtimeEndpointInfo = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteRealtimeEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteRealtimeEndpointResponse_mLModelId :: Lens.Lens' DeleteRealtimeEndpointResponse (Prelude.Maybe Prelude.Text)
deleteRealtimeEndpointResponse_mLModelId :: Lens' DeleteRealtimeEndpointResponse (Maybe Text)
deleteRealtimeEndpointResponse_mLModelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRealtimeEndpointResponse' {Maybe Text
mLModelId :: Maybe Text
$sel:mLModelId:DeleteRealtimeEndpointResponse' :: DeleteRealtimeEndpointResponse -> Maybe Text
mLModelId} -> Maybe Text
mLModelId) (\s :: DeleteRealtimeEndpointResponse
s@DeleteRealtimeEndpointResponse' {} Maybe Text
a -> DeleteRealtimeEndpointResponse
s {$sel:mLModelId:DeleteRealtimeEndpointResponse' :: Maybe Text
mLModelId = Maybe Text
a} :: DeleteRealtimeEndpointResponse)
deleteRealtimeEndpointResponse_realtimeEndpointInfo :: Lens.Lens' DeleteRealtimeEndpointResponse (Prelude.Maybe RealtimeEndpointInfo)
deleteRealtimeEndpointResponse_realtimeEndpointInfo :: Lens' DeleteRealtimeEndpointResponse (Maybe RealtimeEndpointInfo)
deleteRealtimeEndpointResponse_realtimeEndpointInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRealtimeEndpointResponse' {Maybe RealtimeEndpointInfo
realtimeEndpointInfo :: Maybe RealtimeEndpointInfo
$sel:realtimeEndpointInfo:DeleteRealtimeEndpointResponse' :: DeleteRealtimeEndpointResponse -> Maybe RealtimeEndpointInfo
realtimeEndpointInfo} -> Maybe RealtimeEndpointInfo
realtimeEndpointInfo) (\s :: DeleteRealtimeEndpointResponse
s@DeleteRealtimeEndpointResponse' {} Maybe RealtimeEndpointInfo
a -> DeleteRealtimeEndpointResponse
s {$sel:realtimeEndpointInfo:DeleteRealtimeEndpointResponse' :: Maybe RealtimeEndpointInfo
realtimeEndpointInfo = Maybe RealtimeEndpointInfo
a} :: DeleteRealtimeEndpointResponse)
deleteRealtimeEndpointResponse_httpStatus :: Lens.Lens' DeleteRealtimeEndpointResponse Prelude.Int
deleteRealtimeEndpointResponse_httpStatus :: Lens' DeleteRealtimeEndpointResponse Int
deleteRealtimeEndpointResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRealtimeEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRealtimeEndpointResponse' :: DeleteRealtimeEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteRealtimeEndpointResponse
s@DeleteRealtimeEndpointResponse' {} Int
a -> DeleteRealtimeEndpointResponse
s {$sel:httpStatus:DeleteRealtimeEndpointResponse' :: Int
httpStatus = Int
a} :: DeleteRealtimeEndpointResponse)
instance
Prelude.NFData
DeleteRealtimeEndpointResponse
where
rnf :: DeleteRealtimeEndpointResponse -> ()
rnf DeleteRealtimeEndpointResponse' {Int
Maybe Text
Maybe RealtimeEndpointInfo
httpStatus :: Int
realtimeEndpointInfo :: Maybe RealtimeEndpointInfo
mLModelId :: Maybe Text
$sel:httpStatus:DeleteRealtimeEndpointResponse' :: DeleteRealtimeEndpointResponse -> Int
$sel:realtimeEndpointInfo:DeleteRealtimeEndpointResponse' :: DeleteRealtimeEndpointResponse -> Maybe RealtimeEndpointInfo
$sel:mLModelId:DeleteRealtimeEndpointResponse' :: DeleteRealtimeEndpointResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mLModelId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RealtimeEndpointInfo
realtimeEndpointInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus