{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
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
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]
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
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. 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' {$sel:thingTypeName:DeleteThingType' :: Text
thingTypeName = Text
pThingTypeName_}
deleteThingType_thingTypeName :: Lens.Lens' DeleteThingType Prelude.Text
deleteThingType_thingTypeName :: Lens' DeleteThingType Text
deleteThingType_thingTypeName = 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 :: (Service -> Service) -> DeleteThingType -> Request DeleteThingType
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteThingType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteThingType)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteThingTypeResponse
DeleteThingTypeResponse'
forall (f :: * -> *) a b. Functor 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 DeleteThingType where
hashWithSalt :: Int -> DeleteThingType -> Int
hashWithSalt Int
_salt DeleteThingType' {Text
thingTypeName :: Text
$sel:thingTypeName:DeleteThingType' :: DeleteThingType -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
thingTypeName
instance Prelude.NFData DeleteThingType where
rnf :: DeleteThingType -> ()
rnf DeleteThingType' {Text
thingTypeName :: Text
$sel:thingTypeName:DeleteThingType' :: DeleteThingType -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
thingTypeName
instance Data.ToHeaders DeleteThingType where
toHeaders :: DeleteThingType -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteThingType where
toPath :: DeleteThingType -> ByteString
toPath DeleteThingType' {Text
thingTypeName :: Text
$sel:thingTypeName:DeleteThingType' :: DeleteThingType -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/thing-types/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
thingTypeName]
instance Data.ToQuery DeleteThingType where
toQuery :: DeleteThingType -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteThingTypeResponse = DeleteThingTypeResponse'
{
DeleteThingTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteThingTypeResponse -> DeleteThingTypeResponse -> Bool
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]
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
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. 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' {$sel:httpStatus:DeleteThingTypeResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteThingTypeResponse_httpStatus :: Lens.Lens' DeleteThingTypeResponse Prelude.Int
deleteThingTypeResponse_httpStatus :: Lens' DeleteThingTypeResponse Int
deleteThingTypeResponse_httpStatus = 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 where
rnf :: DeleteThingTypeResponse -> ()
rnf DeleteThingTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteThingTypeResponse' :: DeleteThingTypeResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus