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