{-# 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.DeleteThingType
(
DeleteThingType (..),
newDeleteThingType,
deleteThingType_thingTypeName,
DeleteThingTypeResponse (..),
newDeleteThingTypeResponse,
deleteThingTypeResponse_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 DeleteThingType = DeleteThingType'
{
DeleteThingType -> Text
thingTypeName :: Prelude.Text
}
deriving (DeleteThingType -> DeleteThingType -> Bool
(DeleteThingType -> DeleteThingType -> Bool)
-> (DeleteThingType -> DeleteThingType -> Bool)
-> Eq DeleteThingType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteThingType -> DeleteThingType -> Bool
$c/= :: DeleteThingType -> DeleteThingType -> Bool
== :: DeleteThingType -> DeleteThingType -> Bool
$c== :: DeleteThingType -> DeleteThingType -> Bool
Prelude.Eq, ReadPrec [DeleteThingType]
ReadPrec DeleteThingType
Int -> ReadS DeleteThingType
ReadS [DeleteThingType]
(Int -> ReadS DeleteThingType)
-> ReadS [DeleteThingType]
-> ReadPrec DeleteThingType
-> ReadPrec [DeleteThingType]
-> Read DeleteThingType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteThingType]
$creadListPrec :: ReadPrec [DeleteThingType]
readPrec :: ReadPrec DeleteThingType
$creadPrec :: ReadPrec DeleteThingType
readList :: ReadS [DeleteThingType]
$creadList :: ReadS [DeleteThingType]
readsPrec :: Int -> ReadS DeleteThingType
$creadsPrec :: Int -> ReadS DeleteThingType
Prelude.Read, Int -> DeleteThingType -> ShowS
[DeleteThingType] -> ShowS
DeleteThingType -> String
(Int -> DeleteThingType -> ShowS)
-> (DeleteThingType -> String)
-> ([DeleteThingType] -> ShowS)
-> Show DeleteThingType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteThingType] -> ShowS
$cshowList :: [DeleteThingType] -> ShowS
show :: DeleteThingType -> String
$cshow :: DeleteThingType -> String
showsPrec :: Int -> DeleteThingType -> ShowS
$cshowsPrec :: Int -> DeleteThingType -> ShowS
Prelude.Show, (forall x. DeleteThingType -> Rep DeleteThingType x)
-> (forall x. Rep DeleteThingType x -> DeleteThingType)
-> Generic DeleteThingType
forall x. Rep DeleteThingType x -> DeleteThingType
forall x. DeleteThingType -> Rep DeleteThingType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteThingType x -> DeleteThingType
$cfrom :: forall x. DeleteThingType -> Rep DeleteThingType x
Prelude.Generic)
newDeleteThingType ::
Prelude.Text ->
DeleteThingType
newDeleteThingType :: Text -> DeleteThingType
newDeleteThingType Text
pThingTypeName_ =
DeleteThingType' :: Text -> DeleteThingType
DeleteThingType' {$sel:thingTypeName:DeleteThingType' :: Text
thingTypeName = Text
pThingTypeName_}
deleteThingType_thingTypeName :: Lens.Lens' DeleteThingType Prelude.Text
deleteThingType_thingTypeName :: (Text -> f Text) -> DeleteThingType -> f DeleteThingType
deleteThingType_thingTypeName = (DeleteThingType -> Text)
-> (DeleteThingType -> Text -> DeleteThingType)
-> Lens DeleteThingType DeleteThingType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThingType' {Text
thingTypeName :: Text
$sel:thingTypeName:DeleteThingType' :: DeleteThingType -> Text
thingTypeName} -> Text
thingTypeName) (\s :: DeleteThingType
s@DeleteThingType' {} Text
a -> DeleteThingType
s {$sel:thingTypeName:DeleteThingType' :: Text
thingTypeName = Text
a} :: DeleteThingType)
instance Core.AWSRequest DeleteThingType where
type
AWSResponse DeleteThingType =
DeleteThingTypeResponse
request :: DeleteThingType -> Request DeleteThingType
request = Service -> DeleteThingType -> Request DeleteThingType
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteThingType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteThingType)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteThingType))
-> Logger
-> Service
-> Proxy DeleteThingType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteThingType)))
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 -> DeleteThingTypeResponse
DeleteThingTypeResponse'
(Int -> DeleteThingTypeResponse)
-> Either String Int -> Either String DeleteThingTypeResponse
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 DeleteThingType
instance Prelude.NFData DeleteThingType
instance Core.ToHeaders DeleteThingType where
toHeaders :: DeleteThingType -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteThingType -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteThingType where
toPath :: DeleteThingType -> ByteString
toPath DeleteThingType' {Text
thingTypeName :: Text
$sel:thingTypeName:DeleteThingType' :: DeleteThingType -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/thing-types/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
thingTypeName]
instance Core.ToQuery DeleteThingType where
toQuery :: DeleteThingType -> QueryString
toQuery = QueryString -> DeleteThingType -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteThingTypeResponse = DeleteThingTypeResponse'
{
DeleteThingTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool
(DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool)
-> (DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool)
-> Eq DeleteThingTypeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool
$c/= :: DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool
== :: DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool
$c== :: DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool
Prelude.Eq, ReadPrec [DeleteThingTypeResponse]
ReadPrec DeleteThingTypeResponse
Int -> ReadS DeleteThingTypeResponse
ReadS [DeleteThingTypeResponse]
(Int -> ReadS DeleteThingTypeResponse)
-> ReadS [DeleteThingTypeResponse]
-> ReadPrec DeleteThingTypeResponse
-> ReadPrec [DeleteThingTypeResponse]
-> Read DeleteThingTypeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteThingTypeResponse]
$creadListPrec :: ReadPrec [DeleteThingTypeResponse]
readPrec :: ReadPrec DeleteThingTypeResponse
$creadPrec :: ReadPrec DeleteThingTypeResponse
readList :: ReadS [DeleteThingTypeResponse]
$creadList :: ReadS [DeleteThingTypeResponse]
readsPrec :: Int -> ReadS DeleteThingTypeResponse
$creadsPrec :: Int -> ReadS DeleteThingTypeResponse
Prelude.Read, Int -> DeleteThingTypeResponse -> ShowS
[DeleteThingTypeResponse] -> ShowS
DeleteThingTypeResponse -> String
(Int -> DeleteThingTypeResponse -> ShowS)
-> (DeleteThingTypeResponse -> String)
-> ([DeleteThingTypeResponse] -> ShowS)
-> Show DeleteThingTypeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteThingTypeResponse] -> ShowS
$cshowList :: [DeleteThingTypeResponse] -> ShowS
show :: DeleteThingTypeResponse -> String
$cshow :: DeleteThingTypeResponse -> String
showsPrec :: Int -> DeleteThingTypeResponse -> ShowS
$cshowsPrec :: Int -> DeleteThingTypeResponse -> ShowS
Prelude.Show, (forall x.
DeleteThingTypeResponse -> Rep DeleteThingTypeResponse x)
-> (forall x.
Rep DeleteThingTypeResponse x -> DeleteThingTypeResponse)
-> Generic DeleteThingTypeResponse
forall x. Rep DeleteThingTypeResponse x -> DeleteThingTypeResponse
forall x. DeleteThingTypeResponse -> Rep DeleteThingTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteThingTypeResponse x -> DeleteThingTypeResponse
$cfrom :: forall x. DeleteThingTypeResponse -> Rep DeleteThingTypeResponse x
Prelude.Generic)
newDeleteThingTypeResponse ::
Prelude.Int ->
DeleteThingTypeResponse
newDeleteThingTypeResponse :: Int -> DeleteThingTypeResponse
newDeleteThingTypeResponse Int
pHttpStatus_ =
DeleteThingTypeResponse' :: Int -> DeleteThingTypeResponse
DeleteThingTypeResponse' {$sel:httpStatus:DeleteThingTypeResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteThingTypeResponse_httpStatus :: Lens.Lens' DeleteThingTypeResponse Prelude.Int
deleteThingTypeResponse_httpStatus :: (Int -> f Int)
-> DeleteThingTypeResponse -> f DeleteThingTypeResponse
deleteThingTypeResponse_httpStatus = (DeleteThingTypeResponse -> Int)
-> (DeleteThingTypeResponse -> Int -> DeleteThingTypeResponse)
-> Lens DeleteThingTypeResponse DeleteThingTypeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThingTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteThingTypeResponse' :: DeleteThingTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteThingTypeResponse
s@DeleteThingTypeResponse' {} Int
a -> DeleteThingTypeResponse
s {$sel:httpStatus:DeleteThingTypeResponse' :: Int
httpStatus = Int
a} :: DeleteThingTypeResponse)
instance Prelude.NFData DeleteThingTypeResponse