{-# 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.DeleteOTAUpdate
(
DeleteOTAUpdate (..),
newDeleteOTAUpdate,
deleteOTAUpdate_forceDeleteAWSJob,
deleteOTAUpdate_deleteStream,
deleteOTAUpdate_otaUpdateId,
DeleteOTAUpdateResponse (..),
newDeleteOTAUpdateResponse,
deleteOTAUpdateResponse_httpStatus,
)
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 DeleteOTAUpdate = DeleteOTAUpdate'
{
DeleteOTAUpdate -> Maybe Bool
forceDeleteAWSJob :: Prelude.Maybe Prelude.Bool,
DeleteOTAUpdate -> Maybe Bool
deleteStream :: Prelude.Maybe Prelude.Bool,
DeleteOTAUpdate -> Text
otaUpdateId :: Prelude.Text
}
deriving (DeleteOTAUpdate -> DeleteOTAUpdate -> Bool
(DeleteOTAUpdate -> DeleteOTAUpdate -> Bool)
-> (DeleteOTAUpdate -> DeleteOTAUpdate -> Bool)
-> Eq DeleteOTAUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOTAUpdate -> DeleteOTAUpdate -> Bool
$c/= :: DeleteOTAUpdate -> DeleteOTAUpdate -> Bool
== :: DeleteOTAUpdate -> DeleteOTAUpdate -> Bool
$c== :: DeleteOTAUpdate -> DeleteOTAUpdate -> Bool
Prelude.Eq, ReadPrec [DeleteOTAUpdate]
ReadPrec DeleteOTAUpdate
Int -> ReadS DeleteOTAUpdate
ReadS [DeleteOTAUpdate]
(Int -> ReadS DeleteOTAUpdate)
-> ReadS [DeleteOTAUpdate]
-> ReadPrec DeleteOTAUpdate
-> ReadPrec [DeleteOTAUpdate]
-> Read DeleteOTAUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOTAUpdate]
$creadListPrec :: ReadPrec [DeleteOTAUpdate]
readPrec :: ReadPrec DeleteOTAUpdate
$creadPrec :: ReadPrec DeleteOTAUpdate
readList :: ReadS [DeleteOTAUpdate]
$creadList :: ReadS [DeleteOTAUpdate]
readsPrec :: Int -> ReadS DeleteOTAUpdate
$creadsPrec :: Int -> ReadS DeleteOTAUpdate
Prelude.Read, Int -> DeleteOTAUpdate -> ShowS
[DeleteOTAUpdate] -> ShowS
DeleteOTAUpdate -> String
(Int -> DeleteOTAUpdate -> ShowS)
-> (DeleteOTAUpdate -> String)
-> ([DeleteOTAUpdate] -> ShowS)
-> Show DeleteOTAUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOTAUpdate] -> ShowS
$cshowList :: [DeleteOTAUpdate] -> ShowS
show :: DeleteOTAUpdate -> String
$cshow :: DeleteOTAUpdate -> String
showsPrec :: Int -> DeleteOTAUpdate -> ShowS
$cshowsPrec :: Int -> DeleteOTAUpdate -> ShowS
Prelude.Show, (forall x. DeleteOTAUpdate -> Rep DeleteOTAUpdate x)
-> (forall x. Rep DeleteOTAUpdate x -> DeleteOTAUpdate)
-> Generic DeleteOTAUpdate
forall x. Rep DeleteOTAUpdate x -> DeleteOTAUpdate
forall x. DeleteOTAUpdate -> Rep DeleteOTAUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteOTAUpdate x -> DeleteOTAUpdate
$cfrom :: forall x. DeleteOTAUpdate -> Rep DeleteOTAUpdate x
Prelude.Generic)
newDeleteOTAUpdate ::
Prelude.Text ->
DeleteOTAUpdate
newDeleteOTAUpdate :: Text -> DeleteOTAUpdate
newDeleteOTAUpdate Text
pOtaUpdateId_ =
DeleteOTAUpdate' :: Maybe Bool -> Maybe Bool -> Text -> DeleteOTAUpdate
DeleteOTAUpdate'
{ $sel:forceDeleteAWSJob:DeleteOTAUpdate' :: Maybe Bool
forceDeleteAWSJob =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:deleteStream:DeleteOTAUpdate' :: Maybe Bool
deleteStream = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:otaUpdateId:DeleteOTAUpdate' :: Text
otaUpdateId = Text
pOtaUpdateId_
}
deleteOTAUpdate_forceDeleteAWSJob :: Lens.Lens' DeleteOTAUpdate (Prelude.Maybe Prelude.Bool)
deleteOTAUpdate_forceDeleteAWSJob :: (Maybe Bool -> f (Maybe Bool))
-> DeleteOTAUpdate -> f DeleteOTAUpdate
deleteOTAUpdate_forceDeleteAWSJob = (DeleteOTAUpdate -> Maybe Bool)
-> (DeleteOTAUpdate -> Maybe Bool -> DeleteOTAUpdate)
-> Lens DeleteOTAUpdate DeleteOTAUpdate (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOTAUpdate' {Maybe Bool
forceDeleteAWSJob :: Maybe Bool
$sel:forceDeleteAWSJob:DeleteOTAUpdate' :: DeleteOTAUpdate -> Maybe Bool
forceDeleteAWSJob} -> Maybe Bool
forceDeleteAWSJob) (\s :: DeleteOTAUpdate
s@DeleteOTAUpdate' {} Maybe Bool
a -> DeleteOTAUpdate
s {$sel:forceDeleteAWSJob:DeleteOTAUpdate' :: Maybe Bool
forceDeleteAWSJob = Maybe Bool
a} :: DeleteOTAUpdate)
deleteOTAUpdate_deleteStream :: Lens.Lens' DeleteOTAUpdate (Prelude.Maybe Prelude.Bool)
deleteOTAUpdate_deleteStream :: (Maybe Bool -> f (Maybe Bool))
-> DeleteOTAUpdate -> f DeleteOTAUpdate
deleteOTAUpdate_deleteStream = (DeleteOTAUpdate -> Maybe Bool)
-> (DeleteOTAUpdate -> Maybe Bool -> DeleteOTAUpdate)
-> Lens DeleteOTAUpdate DeleteOTAUpdate (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOTAUpdate' {Maybe Bool
deleteStream :: Maybe Bool
$sel:deleteStream:DeleteOTAUpdate' :: DeleteOTAUpdate -> Maybe Bool
deleteStream} -> Maybe Bool
deleteStream) (\s :: DeleteOTAUpdate
s@DeleteOTAUpdate' {} Maybe Bool
a -> DeleteOTAUpdate
s {$sel:deleteStream:DeleteOTAUpdate' :: Maybe Bool
deleteStream = Maybe Bool
a} :: DeleteOTAUpdate)
deleteOTAUpdate_otaUpdateId :: Lens.Lens' DeleteOTAUpdate Prelude.Text
deleteOTAUpdate_otaUpdateId :: (Text -> f Text) -> DeleteOTAUpdate -> f DeleteOTAUpdate
deleteOTAUpdate_otaUpdateId = (DeleteOTAUpdate -> Text)
-> (DeleteOTAUpdate -> Text -> DeleteOTAUpdate)
-> Lens DeleteOTAUpdate DeleteOTAUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOTAUpdate' {Text
otaUpdateId :: Text
$sel:otaUpdateId:DeleteOTAUpdate' :: DeleteOTAUpdate -> Text
otaUpdateId} -> Text
otaUpdateId) (\s :: DeleteOTAUpdate
s@DeleteOTAUpdate' {} Text
a -> DeleteOTAUpdate
s {$sel:otaUpdateId:DeleteOTAUpdate' :: Text
otaUpdateId = Text
a} :: DeleteOTAUpdate)
instance Core.AWSRequest DeleteOTAUpdate where
type
AWSResponse DeleteOTAUpdate =
DeleteOTAUpdateResponse
request :: DeleteOTAUpdate -> Request DeleteOTAUpdate
request = Service -> DeleteOTAUpdate -> Request DeleteOTAUpdate
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteOTAUpdate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteOTAUpdate)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteOTAUpdate))
-> Logger
-> Service
-> Proxy DeleteOTAUpdate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteOTAUpdate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteOTAUpdateResponse
DeleteOTAUpdateResponse'
(Int -> DeleteOTAUpdateResponse)
-> Either String Int -> Either String DeleteOTAUpdateResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteOTAUpdate
instance Prelude.NFData DeleteOTAUpdate
instance Core.ToHeaders DeleteOTAUpdate where
toHeaders :: DeleteOTAUpdate -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteOTAUpdate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteOTAUpdate where
toPath :: DeleteOTAUpdate -> ByteString
toPath DeleteOTAUpdate' {Maybe Bool
Text
otaUpdateId :: Text
deleteStream :: Maybe Bool
forceDeleteAWSJob :: Maybe Bool
$sel:otaUpdateId:DeleteOTAUpdate' :: DeleteOTAUpdate -> Text
$sel:deleteStream:DeleteOTAUpdate' :: DeleteOTAUpdate -> Maybe Bool
$sel:forceDeleteAWSJob:DeleteOTAUpdate' :: DeleteOTAUpdate -> Maybe Bool
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/otaUpdates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
otaUpdateId]
instance Core.ToQuery DeleteOTAUpdate where
toQuery :: DeleteOTAUpdate -> QueryString
toQuery DeleteOTAUpdate' {Maybe Bool
Text
otaUpdateId :: Text
deleteStream :: Maybe Bool
forceDeleteAWSJob :: Maybe Bool
$sel:otaUpdateId:DeleteOTAUpdate' :: DeleteOTAUpdate -> Text
$sel:deleteStream:DeleteOTAUpdate' :: DeleteOTAUpdate -> Maybe Bool
$sel:forceDeleteAWSJob:DeleteOTAUpdate' :: DeleteOTAUpdate -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"forceDeleteAWSJob" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
forceDeleteAWSJob,
ByteString
"deleteStream" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
deleteStream
]
data DeleteOTAUpdateResponse = DeleteOTAUpdateResponse'
{
DeleteOTAUpdateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteOTAUpdateResponse -> DeleteOTAUpdateResponse -> Bool
(DeleteOTAUpdateResponse -> DeleteOTAUpdateResponse -> Bool)
-> (DeleteOTAUpdateResponse -> DeleteOTAUpdateResponse -> Bool)
-> Eq DeleteOTAUpdateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOTAUpdateResponse -> DeleteOTAUpdateResponse -> Bool
$c/= :: DeleteOTAUpdateResponse -> DeleteOTAUpdateResponse -> Bool
== :: DeleteOTAUpdateResponse -> DeleteOTAUpdateResponse -> Bool
$c== :: DeleteOTAUpdateResponse -> DeleteOTAUpdateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteOTAUpdateResponse]
ReadPrec DeleteOTAUpdateResponse
Int -> ReadS DeleteOTAUpdateResponse
ReadS [DeleteOTAUpdateResponse]
(Int -> ReadS DeleteOTAUpdateResponse)
-> ReadS [DeleteOTAUpdateResponse]
-> ReadPrec DeleteOTAUpdateResponse
-> ReadPrec [DeleteOTAUpdateResponse]
-> Read DeleteOTAUpdateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOTAUpdateResponse]
$creadListPrec :: ReadPrec [DeleteOTAUpdateResponse]
readPrec :: ReadPrec DeleteOTAUpdateResponse
$creadPrec :: ReadPrec DeleteOTAUpdateResponse
readList :: ReadS [DeleteOTAUpdateResponse]
$creadList :: ReadS [DeleteOTAUpdateResponse]
readsPrec :: Int -> ReadS DeleteOTAUpdateResponse
$creadsPrec :: Int -> ReadS DeleteOTAUpdateResponse
Prelude.Read, Int -> DeleteOTAUpdateResponse -> ShowS
[DeleteOTAUpdateResponse] -> ShowS
DeleteOTAUpdateResponse -> String
(Int -> DeleteOTAUpdateResponse -> ShowS)
-> (DeleteOTAUpdateResponse -> String)
-> ([DeleteOTAUpdateResponse] -> ShowS)
-> Show DeleteOTAUpdateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOTAUpdateResponse] -> ShowS
$cshowList :: [DeleteOTAUpdateResponse] -> ShowS
show :: DeleteOTAUpdateResponse -> String
$cshow :: DeleteOTAUpdateResponse -> String
showsPrec :: Int -> DeleteOTAUpdateResponse -> ShowS
$cshowsPrec :: Int -> DeleteOTAUpdateResponse -> ShowS
Prelude.Show, (forall x.
DeleteOTAUpdateResponse -> Rep DeleteOTAUpdateResponse x)
-> (forall x.
Rep DeleteOTAUpdateResponse x -> DeleteOTAUpdateResponse)
-> Generic DeleteOTAUpdateResponse
forall x. Rep DeleteOTAUpdateResponse x -> DeleteOTAUpdateResponse
forall x. DeleteOTAUpdateResponse -> Rep DeleteOTAUpdateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteOTAUpdateResponse x -> DeleteOTAUpdateResponse
$cfrom :: forall x. DeleteOTAUpdateResponse -> Rep DeleteOTAUpdateResponse x
Prelude.Generic)
newDeleteOTAUpdateResponse ::
Prelude.Int ->
DeleteOTAUpdateResponse
newDeleteOTAUpdateResponse :: Int -> DeleteOTAUpdateResponse
newDeleteOTAUpdateResponse Int
pHttpStatus_ =
DeleteOTAUpdateResponse' :: Int -> DeleteOTAUpdateResponse
DeleteOTAUpdateResponse' {$sel:httpStatus:DeleteOTAUpdateResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteOTAUpdateResponse_httpStatus :: Lens.Lens' DeleteOTAUpdateResponse Prelude.Int
deleteOTAUpdateResponse_httpStatus :: (Int -> f Int)
-> DeleteOTAUpdateResponse -> f DeleteOTAUpdateResponse
deleteOTAUpdateResponse_httpStatus = (DeleteOTAUpdateResponse -> Int)
-> (DeleteOTAUpdateResponse -> Int -> DeleteOTAUpdateResponse)
-> Lens DeleteOTAUpdateResponse DeleteOTAUpdateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOTAUpdateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteOTAUpdateResponse' :: DeleteOTAUpdateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteOTAUpdateResponse
s@DeleteOTAUpdateResponse' {} Int
a -> DeleteOTAUpdateResponse
s {$sel:httpStatus:DeleteOTAUpdateResponse' :: Int
httpStatus = Int
a} :: DeleteOTAUpdateResponse)
instance Prelude.NFData DeleteOTAUpdateResponse