{-# 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.IoT.DeleteJob
(
DeleteJob (..),
newDeleteJob,
deleteJob_force,
deleteJob_namespaceId,
deleteJob_jobId,
DeleteJobResponse (..),
newDeleteJobResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteJob = DeleteJob'
{
DeleteJob -> Maybe Bool
force :: Prelude.Maybe Prelude.Bool,
DeleteJob -> Maybe Text
namespaceId :: Prelude.Maybe Prelude.Text,
DeleteJob -> Text
jobId :: Prelude.Text
}
deriving (DeleteJob -> DeleteJob -> Bool
(DeleteJob -> DeleteJob -> Bool)
-> (DeleteJob -> DeleteJob -> Bool) -> Eq DeleteJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteJob -> DeleteJob -> Bool
$c/= :: DeleteJob -> DeleteJob -> Bool
== :: DeleteJob -> DeleteJob -> Bool
$c== :: DeleteJob -> DeleteJob -> Bool
Prelude.Eq, ReadPrec [DeleteJob]
ReadPrec DeleteJob
Int -> ReadS DeleteJob
ReadS [DeleteJob]
(Int -> ReadS DeleteJob)
-> ReadS [DeleteJob]
-> ReadPrec DeleteJob
-> ReadPrec [DeleteJob]
-> Read DeleteJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteJob]
$creadListPrec :: ReadPrec [DeleteJob]
readPrec :: ReadPrec DeleteJob
$creadPrec :: ReadPrec DeleteJob
readList :: ReadS [DeleteJob]
$creadList :: ReadS [DeleteJob]
readsPrec :: Int -> ReadS DeleteJob
$creadsPrec :: Int -> ReadS DeleteJob
Prelude.Read, Int -> DeleteJob -> ShowS
[DeleteJob] -> ShowS
DeleteJob -> String
(Int -> DeleteJob -> ShowS)
-> (DeleteJob -> String)
-> ([DeleteJob] -> ShowS)
-> Show DeleteJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteJob] -> ShowS
$cshowList :: [DeleteJob] -> ShowS
show :: DeleteJob -> String
$cshow :: DeleteJob -> String
showsPrec :: Int -> DeleteJob -> ShowS
$cshowsPrec :: Int -> DeleteJob -> ShowS
Prelude.Show, (forall x. DeleteJob -> Rep DeleteJob x)
-> (forall x. Rep DeleteJob x -> DeleteJob) -> Generic DeleteJob
forall x. Rep DeleteJob x -> DeleteJob
forall x. DeleteJob -> Rep DeleteJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteJob x -> DeleteJob
$cfrom :: forall x. DeleteJob -> Rep DeleteJob x
Prelude.Generic)
newDeleteJob ::
Prelude.Text ->
DeleteJob
newDeleteJob :: Text -> DeleteJob
newDeleteJob Text
pJobId_ =
DeleteJob' :: Maybe Bool -> Maybe Text -> Text -> DeleteJob
DeleteJob'
{ $sel:force:DeleteJob' :: Maybe Bool
force = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:namespaceId:DeleteJob' :: Maybe Text
namespaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:jobId:DeleteJob' :: Text
jobId = Text
pJobId_
}
deleteJob_force :: Lens.Lens' DeleteJob (Prelude.Maybe Prelude.Bool)
deleteJob_force :: (Maybe Bool -> f (Maybe Bool)) -> DeleteJob -> f DeleteJob
deleteJob_force = (DeleteJob -> Maybe Bool)
-> (DeleteJob -> Maybe Bool -> DeleteJob)
-> Lens DeleteJob DeleteJob (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJob' {Maybe Bool
force :: Maybe Bool
$sel:force:DeleteJob' :: DeleteJob -> Maybe Bool
force} -> Maybe Bool
force) (\s :: DeleteJob
s@DeleteJob' {} Maybe Bool
a -> DeleteJob
s {$sel:force:DeleteJob' :: Maybe Bool
force = Maybe Bool
a} :: DeleteJob)
deleteJob_namespaceId :: Lens.Lens' DeleteJob (Prelude.Maybe Prelude.Text)
deleteJob_namespaceId :: (Maybe Text -> f (Maybe Text)) -> DeleteJob -> f DeleteJob
deleteJob_namespaceId = (DeleteJob -> Maybe Text)
-> (DeleteJob -> Maybe Text -> DeleteJob)
-> Lens DeleteJob DeleteJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJob' {Maybe Text
namespaceId :: Maybe Text
$sel:namespaceId:DeleteJob' :: DeleteJob -> Maybe Text
namespaceId} -> Maybe Text
namespaceId) (\s :: DeleteJob
s@DeleteJob' {} Maybe Text
a -> DeleteJob
s {$sel:namespaceId:DeleteJob' :: Maybe Text
namespaceId = Maybe Text
a} :: DeleteJob)
deleteJob_jobId :: Lens.Lens' DeleteJob Prelude.Text
deleteJob_jobId :: (Text -> f Text) -> DeleteJob -> f DeleteJob
deleteJob_jobId = (DeleteJob -> Text)
-> (DeleteJob -> Text -> DeleteJob)
-> Lens DeleteJob DeleteJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJob' {Text
jobId :: Text
$sel:jobId:DeleteJob' :: DeleteJob -> Text
jobId} -> Text
jobId) (\s :: DeleteJob
s@DeleteJob' {} Text
a -> DeleteJob
s {$sel:jobId:DeleteJob' :: Text
jobId = Text
a} :: DeleteJob)
instance Core.AWSRequest DeleteJob where
type AWSResponse DeleteJob = DeleteJobResponse
request :: DeleteJob -> Request DeleteJob
request = Service -> DeleteJob -> Request DeleteJob
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteJob)))
response = AWSResponse DeleteJob
-> Logger
-> Service
-> Proxy DeleteJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteJob)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteJob
DeleteJobResponse
DeleteJobResponse'
instance Prelude.Hashable DeleteJob
instance Prelude.NFData DeleteJob
instance Core.ToHeaders DeleteJob where
toHeaders :: DeleteJob -> [Header]
toHeaders = [Header] -> DeleteJob -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteJob where
toPath :: DeleteJob -> ByteString
toPath DeleteJob' {Maybe Bool
Maybe Text
Text
jobId :: Text
namespaceId :: Maybe Text
force :: Maybe Bool
$sel:jobId:DeleteJob' :: DeleteJob -> Text
$sel:namespaceId:DeleteJob' :: DeleteJob -> Maybe Text
$sel:force:DeleteJob' :: DeleteJob -> Maybe Bool
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/jobs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobId]
instance Core.ToQuery DeleteJob where
toQuery :: DeleteJob -> QueryString
toQuery DeleteJob' {Maybe Bool
Maybe Text
Text
jobId :: Text
namespaceId :: Maybe Text
force :: Maybe Bool
$sel:jobId:DeleteJob' :: DeleteJob -> Text
$sel:namespaceId:DeleteJob' :: DeleteJob -> Maybe Text
$sel:force:DeleteJob' :: DeleteJob -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"force" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
force,
ByteString
"namespaceId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
namespaceId
]
data DeleteJobResponse = DeleteJobResponse'
{
}
deriving (DeleteJobResponse -> DeleteJobResponse -> Bool
(DeleteJobResponse -> DeleteJobResponse -> Bool)
-> (DeleteJobResponse -> DeleteJobResponse -> Bool)
-> Eq DeleteJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteJobResponse -> DeleteJobResponse -> Bool
$c/= :: DeleteJobResponse -> DeleteJobResponse -> Bool
== :: DeleteJobResponse -> DeleteJobResponse -> Bool
$c== :: DeleteJobResponse -> DeleteJobResponse -> Bool
Prelude.Eq, ReadPrec [DeleteJobResponse]
ReadPrec DeleteJobResponse
Int -> ReadS DeleteJobResponse
ReadS [DeleteJobResponse]
(Int -> ReadS DeleteJobResponse)
-> ReadS [DeleteJobResponse]
-> ReadPrec DeleteJobResponse
-> ReadPrec [DeleteJobResponse]
-> Read DeleteJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteJobResponse]
$creadListPrec :: ReadPrec [DeleteJobResponse]
readPrec :: ReadPrec DeleteJobResponse
$creadPrec :: ReadPrec DeleteJobResponse
readList :: ReadS [DeleteJobResponse]
$creadList :: ReadS [DeleteJobResponse]
readsPrec :: Int -> ReadS DeleteJobResponse
$creadsPrec :: Int -> ReadS DeleteJobResponse
Prelude.Read, Int -> DeleteJobResponse -> ShowS
[DeleteJobResponse] -> ShowS
DeleteJobResponse -> String
(Int -> DeleteJobResponse -> ShowS)
-> (DeleteJobResponse -> String)
-> ([DeleteJobResponse] -> ShowS)
-> Show DeleteJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteJobResponse] -> ShowS
$cshowList :: [DeleteJobResponse] -> ShowS
show :: DeleteJobResponse -> String
$cshow :: DeleteJobResponse -> String
showsPrec :: Int -> DeleteJobResponse -> ShowS
$cshowsPrec :: Int -> DeleteJobResponse -> ShowS
Prelude.Show, (forall x. DeleteJobResponse -> Rep DeleteJobResponse x)
-> (forall x. Rep DeleteJobResponse x -> DeleteJobResponse)
-> Generic DeleteJobResponse
forall x. Rep DeleteJobResponse x -> DeleteJobResponse
forall x. DeleteJobResponse -> Rep DeleteJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteJobResponse x -> DeleteJobResponse
$cfrom :: forall x. DeleteJobResponse -> Rep DeleteJobResponse x
Prelude.Generic)
newDeleteJobResponse ::
DeleteJobResponse
newDeleteJobResponse :: DeleteJobResponse
newDeleteJobResponse = DeleteJobResponse
DeleteJobResponse'
instance Prelude.NFData DeleteJobResponse