{-# 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.Greengrass.DeleteDeviceDefinition
(
DeleteDeviceDefinition (..),
newDeleteDeviceDefinition,
deleteDeviceDefinition_deviceDefinitionId,
DeleteDeviceDefinitionResponse (..),
newDeleteDeviceDefinitionResponse,
deleteDeviceDefinitionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Greengrass.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 DeleteDeviceDefinition = DeleteDeviceDefinition'
{
DeleteDeviceDefinition -> Text
deviceDefinitionId :: Prelude.Text
}
deriving (DeleteDeviceDefinition -> DeleteDeviceDefinition -> Bool
(DeleteDeviceDefinition -> DeleteDeviceDefinition -> Bool)
-> (DeleteDeviceDefinition -> DeleteDeviceDefinition -> Bool)
-> Eq DeleteDeviceDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeviceDefinition -> DeleteDeviceDefinition -> Bool
$c/= :: DeleteDeviceDefinition -> DeleteDeviceDefinition -> Bool
== :: DeleteDeviceDefinition -> DeleteDeviceDefinition -> Bool
$c== :: DeleteDeviceDefinition -> DeleteDeviceDefinition -> Bool
Prelude.Eq, ReadPrec [DeleteDeviceDefinition]
ReadPrec DeleteDeviceDefinition
Int -> ReadS DeleteDeviceDefinition
ReadS [DeleteDeviceDefinition]
(Int -> ReadS DeleteDeviceDefinition)
-> ReadS [DeleteDeviceDefinition]
-> ReadPrec DeleteDeviceDefinition
-> ReadPrec [DeleteDeviceDefinition]
-> Read DeleteDeviceDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeviceDefinition]
$creadListPrec :: ReadPrec [DeleteDeviceDefinition]
readPrec :: ReadPrec DeleteDeviceDefinition
$creadPrec :: ReadPrec DeleteDeviceDefinition
readList :: ReadS [DeleteDeviceDefinition]
$creadList :: ReadS [DeleteDeviceDefinition]
readsPrec :: Int -> ReadS DeleteDeviceDefinition
$creadsPrec :: Int -> ReadS DeleteDeviceDefinition
Prelude.Read, Int -> DeleteDeviceDefinition -> ShowS
[DeleteDeviceDefinition] -> ShowS
DeleteDeviceDefinition -> String
(Int -> DeleteDeviceDefinition -> ShowS)
-> (DeleteDeviceDefinition -> String)
-> ([DeleteDeviceDefinition] -> ShowS)
-> Show DeleteDeviceDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeviceDefinition] -> ShowS
$cshowList :: [DeleteDeviceDefinition] -> ShowS
show :: DeleteDeviceDefinition -> String
$cshow :: DeleteDeviceDefinition -> String
showsPrec :: Int -> DeleteDeviceDefinition -> ShowS
$cshowsPrec :: Int -> DeleteDeviceDefinition -> ShowS
Prelude.Show, (forall x. DeleteDeviceDefinition -> Rep DeleteDeviceDefinition x)
-> (forall x.
Rep DeleteDeviceDefinition x -> DeleteDeviceDefinition)
-> Generic DeleteDeviceDefinition
forall x. Rep DeleteDeviceDefinition x -> DeleteDeviceDefinition
forall x. DeleteDeviceDefinition -> Rep DeleteDeviceDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDeviceDefinition x -> DeleteDeviceDefinition
$cfrom :: forall x. DeleteDeviceDefinition -> Rep DeleteDeviceDefinition x
Prelude.Generic)
newDeleteDeviceDefinition ::
Prelude.Text ->
DeleteDeviceDefinition
newDeleteDeviceDefinition :: Text -> DeleteDeviceDefinition
newDeleteDeviceDefinition Text
pDeviceDefinitionId_ =
DeleteDeviceDefinition' :: Text -> DeleteDeviceDefinition
DeleteDeviceDefinition'
{ $sel:deviceDefinitionId:DeleteDeviceDefinition' :: Text
deviceDefinitionId =
Text
pDeviceDefinitionId_
}
deleteDeviceDefinition_deviceDefinitionId :: Lens.Lens' DeleteDeviceDefinition Prelude.Text
deleteDeviceDefinition_deviceDefinitionId :: (Text -> f Text)
-> DeleteDeviceDefinition -> f DeleteDeviceDefinition
deleteDeviceDefinition_deviceDefinitionId = (DeleteDeviceDefinition -> Text)
-> (DeleteDeviceDefinition -> Text -> DeleteDeviceDefinition)
-> Lens DeleteDeviceDefinition DeleteDeviceDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeviceDefinition' {Text
deviceDefinitionId :: Text
$sel:deviceDefinitionId:DeleteDeviceDefinition' :: DeleteDeviceDefinition -> Text
deviceDefinitionId} -> Text
deviceDefinitionId) (\s :: DeleteDeviceDefinition
s@DeleteDeviceDefinition' {} Text
a -> DeleteDeviceDefinition
s {$sel:deviceDefinitionId:DeleteDeviceDefinition' :: Text
deviceDefinitionId = Text
a} :: DeleteDeviceDefinition)
instance Core.AWSRequest DeleteDeviceDefinition where
type
AWSResponse DeleteDeviceDefinition =
DeleteDeviceDefinitionResponse
request :: DeleteDeviceDefinition -> Request DeleteDeviceDefinition
request = Service -> DeleteDeviceDefinition -> Request DeleteDeviceDefinition
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDeviceDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeviceDefinition)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteDeviceDefinition))
-> Logger
-> Service
-> Proxy DeleteDeviceDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeviceDefinition)))
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 -> DeleteDeviceDefinitionResponse
DeleteDeviceDefinitionResponse'
(Int -> DeleteDeviceDefinitionResponse)
-> Either String Int
-> Either String DeleteDeviceDefinitionResponse
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 DeleteDeviceDefinition
instance Prelude.NFData DeleteDeviceDefinition
instance Core.ToHeaders DeleteDeviceDefinition where
toHeaders :: DeleteDeviceDefinition -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDeviceDefinition -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteDeviceDefinition where
toPath :: DeleteDeviceDefinition -> ByteString
toPath DeleteDeviceDefinition' {Text
deviceDefinitionId :: Text
$sel:deviceDefinitionId:DeleteDeviceDefinition' :: DeleteDeviceDefinition -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/definition/devices/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deviceDefinitionId
]
instance Core.ToQuery DeleteDeviceDefinition where
toQuery :: DeleteDeviceDefinition -> QueryString
toQuery = QueryString -> DeleteDeviceDefinition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDeviceDefinitionResponse = DeleteDeviceDefinitionResponse'
{
DeleteDeviceDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDeviceDefinitionResponse
-> DeleteDeviceDefinitionResponse -> Bool
(DeleteDeviceDefinitionResponse
-> DeleteDeviceDefinitionResponse -> Bool)
-> (DeleteDeviceDefinitionResponse
-> DeleteDeviceDefinitionResponse -> Bool)
-> Eq DeleteDeviceDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeviceDefinitionResponse
-> DeleteDeviceDefinitionResponse -> Bool
$c/= :: DeleteDeviceDefinitionResponse
-> DeleteDeviceDefinitionResponse -> Bool
== :: DeleteDeviceDefinitionResponse
-> DeleteDeviceDefinitionResponse -> Bool
$c== :: DeleteDeviceDefinitionResponse
-> DeleteDeviceDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDeviceDefinitionResponse]
ReadPrec DeleteDeviceDefinitionResponse
Int -> ReadS DeleteDeviceDefinitionResponse
ReadS [DeleteDeviceDefinitionResponse]
(Int -> ReadS DeleteDeviceDefinitionResponse)
-> ReadS [DeleteDeviceDefinitionResponse]
-> ReadPrec DeleteDeviceDefinitionResponse
-> ReadPrec [DeleteDeviceDefinitionResponse]
-> Read DeleteDeviceDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeviceDefinitionResponse]
$creadListPrec :: ReadPrec [DeleteDeviceDefinitionResponse]
readPrec :: ReadPrec DeleteDeviceDefinitionResponse
$creadPrec :: ReadPrec DeleteDeviceDefinitionResponse
readList :: ReadS [DeleteDeviceDefinitionResponse]
$creadList :: ReadS [DeleteDeviceDefinitionResponse]
readsPrec :: Int -> ReadS DeleteDeviceDefinitionResponse
$creadsPrec :: Int -> ReadS DeleteDeviceDefinitionResponse
Prelude.Read, Int -> DeleteDeviceDefinitionResponse -> ShowS
[DeleteDeviceDefinitionResponse] -> ShowS
DeleteDeviceDefinitionResponse -> String
(Int -> DeleteDeviceDefinitionResponse -> ShowS)
-> (DeleteDeviceDefinitionResponse -> String)
-> ([DeleteDeviceDefinitionResponse] -> ShowS)
-> Show DeleteDeviceDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeviceDefinitionResponse] -> ShowS
$cshowList :: [DeleteDeviceDefinitionResponse] -> ShowS
show :: DeleteDeviceDefinitionResponse -> String
$cshow :: DeleteDeviceDefinitionResponse -> String
showsPrec :: Int -> DeleteDeviceDefinitionResponse -> ShowS
$cshowsPrec :: Int -> DeleteDeviceDefinitionResponse -> ShowS
Prelude.Show, (forall x.
DeleteDeviceDefinitionResponse
-> Rep DeleteDeviceDefinitionResponse x)
-> (forall x.
Rep DeleteDeviceDefinitionResponse x
-> DeleteDeviceDefinitionResponse)
-> Generic DeleteDeviceDefinitionResponse
forall x.
Rep DeleteDeviceDefinitionResponse x
-> DeleteDeviceDefinitionResponse
forall x.
DeleteDeviceDefinitionResponse
-> Rep DeleteDeviceDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDeviceDefinitionResponse x
-> DeleteDeviceDefinitionResponse
$cfrom :: forall x.
DeleteDeviceDefinitionResponse
-> Rep DeleteDeviceDefinitionResponse x
Prelude.Generic)
newDeleteDeviceDefinitionResponse ::
Prelude.Int ->
DeleteDeviceDefinitionResponse
newDeleteDeviceDefinitionResponse :: Int -> DeleteDeviceDefinitionResponse
newDeleteDeviceDefinitionResponse Int
pHttpStatus_ =
DeleteDeviceDefinitionResponse' :: Int -> DeleteDeviceDefinitionResponse
DeleteDeviceDefinitionResponse'
{ $sel:httpStatus:DeleteDeviceDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteDeviceDefinitionResponse_httpStatus :: Lens.Lens' DeleteDeviceDefinitionResponse Prelude.Int
deleteDeviceDefinitionResponse_httpStatus :: (Int -> f Int)
-> DeleteDeviceDefinitionResponse
-> f DeleteDeviceDefinitionResponse
deleteDeviceDefinitionResponse_httpStatus = (DeleteDeviceDefinitionResponse -> Int)
-> (DeleteDeviceDefinitionResponse
-> Int -> DeleteDeviceDefinitionResponse)
-> Lens
DeleteDeviceDefinitionResponse
DeleteDeviceDefinitionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeviceDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDeviceDefinitionResponse' :: DeleteDeviceDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDeviceDefinitionResponse
s@DeleteDeviceDefinitionResponse' {} Int
a -> DeleteDeviceDefinitionResponse
s {$sel:httpStatus:DeleteDeviceDefinitionResponse' :: Int
httpStatus = Int
a} :: DeleteDeviceDefinitionResponse)
instance
Prelude.NFData
DeleteDeviceDefinitionResponse