{-# 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.DeleteDynamicThingGroup
(
DeleteDynamicThingGroup (..),
newDeleteDynamicThingGroup,
deleteDynamicThingGroup_expectedVersion,
deleteDynamicThingGroup_thingGroupName,
DeleteDynamicThingGroupResponse (..),
newDeleteDynamicThingGroupResponse,
deleteDynamicThingGroupResponse_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 DeleteDynamicThingGroup = DeleteDynamicThingGroup'
{
DeleteDynamicThingGroup -> Maybe Integer
expectedVersion :: Prelude.Maybe Prelude.Integer,
DeleteDynamicThingGroup -> Text
thingGroupName :: Prelude.Text
}
deriving (DeleteDynamicThingGroup -> DeleteDynamicThingGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDynamicThingGroup -> DeleteDynamicThingGroup -> Bool
$c/= :: DeleteDynamicThingGroup -> DeleteDynamicThingGroup -> Bool
== :: DeleteDynamicThingGroup -> DeleteDynamicThingGroup -> Bool
$c== :: DeleteDynamicThingGroup -> DeleteDynamicThingGroup -> Bool
Prelude.Eq, ReadPrec [DeleteDynamicThingGroup]
ReadPrec DeleteDynamicThingGroup
Int -> ReadS DeleteDynamicThingGroup
ReadS [DeleteDynamicThingGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDynamicThingGroup]
$creadListPrec :: ReadPrec [DeleteDynamicThingGroup]
readPrec :: ReadPrec DeleteDynamicThingGroup
$creadPrec :: ReadPrec DeleteDynamicThingGroup
readList :: ReadS [DeleteDynamicThingGroup]
$creadList :: ReadS [DeleteDynamicThingGroup]
readsPrec :: Int -> ReadS DeleteDynamicThingGroup
$creadsPrec :: Int -> ReadS DeleteDynamicThingGroup
Prelude.Read, Int -> DeleteDynamicThingGroup -> ShowS
[DeleteDynamicThingGroup] -> ShowS
DeleteDynamicThingGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDynamicThingGroup] -> ShowS
$cshowList :: [DeleteDynamicThingGroup] -> ShowS
show :: DeleteDynamicThingGroup -> String
$cshow :: DeleteDynamicThingGroup -> String
showsPrec :: Int -> DeleteDynamicThingGroup -> ShowS
$cshowsPrec :: Int -> DeleteDynamicThingGroup -> ShowS
Prelude.Show, forall x. Rep DeleteDynamicThingGroup x -> DeleteDynamicThingGroup
forall x. DeleteDynamicThingGroup -> Rep DeleteDynamicThingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDynamicThingGroup x -> DeleteDynamicThingGroup
$cfrom :: forall x. DeleteDynamicThingGroup -> Rep DeleteDynamicThingGroup x
Prelude.Generic)
newDeleteDynamicThingGroup ::
Prelude.Text ->
DeleteDynamicThingGroup
newDeleteDynamicThingGroup :: Text -> DeleteDynamicThingGroup
newDeleteDynamicThingGroup Text
pThingGroupName_ =
DeleteDynamicThingGroup'
{ $sel:expectedVersion:DeleteDynamicThingGroup' :: Maybe Integer
expectedVersion =
forall a. Maybe a
Prelude.Nothing,
$sel:thingGroupName:DeleteDynamicThingGroup' :: Text
thingGroupName = Text
pThingGroupName_
}
deleteDynamicThingGroup_expectedVersion :: Lens.Lens' DeleteDynamicThingGroup (Prelude.Maybe Prelude.Integer)
deleteDynamicThingGroup_expectedVersion :: Lens' DeleteDynamicThingGroup (Maybe Integer)
deleteDynamicThingGroup_expectedVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDynamicThingGroup' {Maybe Integer
expectedVersion :: Maybe Integer
$sel:expectedVersion:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Maybe Integer
expectedVersion} -> Maybe Integer
expectedVersion) (\s :: DeleteDynamicThingGroup
s@DeleteDynamicThingGroup' {} Maybe Integer
a -> DeleteDynamicThingGroup
s {$sel:expectedVersion:DeleteDynamicThingGroup' :: Maybe Integer
expectedVersion = Maybe Integer
a} :: DeleteDynamicThingGroup)
deleteDynamicThingGroup_thingGroupName :: Lens.Lens' DeleteDynamicThingGroup Prelude.Text
deleteDynamicThingGroup_thingGroupName :: Lens' DeleteDynamicThingGroup Text
deleteDynamicThingGroup_thingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDynamicThingGroup' {Text
thingGroupName :: Text
$sel:thingGroupName:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Text
thingGroupName} -> Text
thingGroupName) (\s :: DeleteDynamicThingGroup
s@DeleteDynamicThingGroup' {} Text
a -> DeleteDynamicThingGroup
s {$sel:thingGroupName:DeleteDynamicThingGroup' :: Text
thingGroupName = Text
a} :: DeleteDynamicThingGroup)
instance Core.AWSRequest DeleteDynamicThingGroup where
type
AWSResponse DeleteDynamicThingGroup =
DeleteDynamicThingGroupResponse
request :: (Service -> Service)
-> DeleteDynamicThingGroup -> Request DeleteDynamicThingGroup
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 DeleteDynamicThingGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDynamicThingGroup)))
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 -> DeleteDynamicThingGroupResponse
DeleteDynamicThingGroupResponse'
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 DeleteDynamicThingGroup where
hashWithSalt :: Int -> DeleteDynamicThingGroup -> Int
hashWithSalt Int
_salt DeleteDynamicThingGroup' {Maybe Integer
Text
thingGroupName :: Text
expectedVersion :: Maybe Integer
$sel:thingGroupName:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Text
$sel:expectedVersion:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
expectedVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
thingGroupName
instance Prelude.NFData DeleteDynamicThingGroup where
rnf :: DeleteDynamicThingGroup -> ()
rnf DeleteDynamicThingGroup' {Maybe Integer
Text
thingGroupName :: Text
expectedVersion :: Maybe Integer
$sel:thingGroupName:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Text
$sel:expectedVersion:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Maybe Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
expectedVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
thingGroupName
instance Data.ToHeaders DeleteDynamicThingGroup where
toHeaders :: DeleteDynamicThingGroup -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteDynamicThingGroup where
toPath :: DeleteDynamicThingGroup -> ByteString
toPath DeleteDynamicThingGroup' {Maybe Integer
Text
thingGroupName :: Text
expectedVersion :: Maybe Integer
$sel:thingGroupName:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Text
$sel:expectedVersion:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Maybe Integer
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/dynamic-thing-groups/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
thingGroupName]
instance Data.ToQuery DeleteDynamicThingGroup where
toQuery :: DeleteDynamicThingGroup -> QueryString
toQuery DeleteDynamicThingGroup' {Maybe Integer
Text
thingGroupName :: Text
expectedVersion :: Maybe Integer
$sel:thingGroupName:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Text
$sel:expectedVersion:DeleteDynamicThingGroup' :: DeleteDynamicThingGroup -> Maybe Integer
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"expectedVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Integer
expectedVersion]
data DeleteDynamicThingGroupResponse = DeleteDynamicThingGroupResponse'
{
DeleteDynamicThingGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDynamicThingGroupResponse
-> DeleteDynamicThingGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDynamicThingGroupResponse
-> DeleteDynamicThingGroupResponse -> Bool
$c/= :: DeleteDynamicThingGroupResponse
-> DeleteDynamicThingGroupResponse -> Bool
== :: DeleteDynamicThingGroupResponse
-> DeleteDynamicThingGroupResponse -> Bool
$c== :: DeleteDynamicThingGroupResponse
-> DeleteDynamicThingGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDynamicThingGroupResponse]
ReadPrec DeleteDynamicThingGroupResponse
Int -> ReadS DeleteDynamicThingGroupResponse
ReadS [DeleteDynamicThingGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDynamicThingGroupResponse]
$creadListPrec :: ReadPrec [DeleteDynamicThingGroupResponse]
readPrec :: ReadPrec DeleteDynamicThingGroupResponse
$creadPrec :: ReadPrec DeleteDynamicThingGroupResponse
readList :: ReadS [DeleteDynamicThingGroupResponse]
$creadList :: ReadS [DeleteDynamicThingGroupResponse]
readsPrec :: Int -> ReadS DeleteDynamicThingGroupResponse
$creadsPrec :: Int -> ReadS DeleteDynamicThingGroupResponse
Prelude.Read, Int -> DeleteDynamicThingGroupResponse -> ShowS
[DeleteDynamicThingGroupResponse] -> ShowS
DeleteDynamicThingGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDynamicThingGroupResponse] -> ShowS
$cshowList :: [DeleteDynamicThingGroupResponse] -> ShowS
show :: DeleteDynamicThingGroupResponse -> String
$cshow :: DeleteDynamicThingGroupResponse -> String
showsPrec :: Int -> DeleteDynamicThingGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteDynamicThingGroupResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteDynamicThingGroupResponse x
-> DeleteDynamicThingGroupResponse
forall x.
DeleteDynamicThingGroupResponse
-> Rep DeleteDynamicThingGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDynamicThingGroupResponse x
-> DeleteDynamicThingGroupResponse
$cfrom :: forall x.
DeleteDynamicThingGroupResponse
-> Rep DeleteDynamicThingGroupResponse x
Prelude.Generic)
newDeleteDynamicThingGroupResponse ::
Prelude.Int ->
DeleteDynamicThingGroupResponse
newDeleteDynamicThingGroupResponse :: Int -> DeleteDynamicThingGroupResponse
newDeleteDynamicThingGroupResponse Int
pHttpStatus_ =
DeleteDynamicThingGroupResponse'
{ $sel:httpStatus:DeleteDynamicThingGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteDynamicThingGroupResponse_httpStatus :: Lens.Lens' DeleteDynamicThingGroupResponse Prelude.Int
deleteDynamicThingGroupResponse_httpStatus :: Lens' DeleteDynamicThingGroupResponse Int
deleteDynamicThingGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDynamicThingGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDynamicThingGroupResponse' :: DeleteDynamicThingGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDynamicThingGroupResponse
s@DeleteDynamicThingGroupResponse' {} Int
a -> DeleteDynamicThingGroupResponse
s {$sel:httpStatus:DeleteDynamicThingGroupResponse' :: Int
httpStatus = Int
a} :: DeleteDynamicThingGroupResponse)
instance
Prelude.NFData
DeleteDynamicThingGroupResponse
where
rnf :: DeleteDynamicThingGroupResponse -> ()
rnf DeleteDynamicThingGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDynamicThingGroupResponse' :: DeleteDynamicThingGroupResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus