{-# 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.IoTData.DeleteThingShadow
(
DeleteThingShadow (..),
newDeleteThingShadow,
deleteThingShadow_shadowName,
deleteThingShadow_thingName,
DeleteThingShadowResponse (..),
newDeleteThingShadowResponse,
deleteThingShadowResponse_httpStatus,
deleteThingShadowResponse_payload,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTData.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 DeleteThingShadow = DeleteThingShadow'
{
DeleteThingShadow -> Maybe Text
shadowName :: Prelude.Maybe Prelude.Text,
DeleteThingShadow -> Text
thingName :: Prelude.Text
}
deriving (DeleteThingShadow -> DeleteThingShadow -> Bool
(DeleteThingShadow -> DeleteThingShadow -> Bool)
-> (DeleteThingShadow -> DeleteThingShadow -> Bool)
-> Eq DeleteThingShadow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteThingShadow -> DeleteThingShadow -> Bool
$c/= :: DeleteThingShadow -> DeleteThingShadow -> Bool
== :: DeleteThingShadow -> DeleteThingShadow -> Bool
$c== :: DeleteThingShadow -> DeleteThingShadow -> Bool
Prelude.Eq, ReadPrec [DeleteThingShadow]
ReadPrec DeleteThingShadow
Int -> ReadS DeleteThingShadow
ReadS [DeleteThingShadow]
(Int -> ReadS DeleteThingShadow)
-> ReadS [DeleteThingShadow]
-> ReadPrec DeleteThingShadow
-> ReadPrec [DeleteThingShadow]
-> Read DeleteThingShadow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteThingShadow]
$creadListPrec :: ReadPrec [DeleteThingShadow]
readPrec :: ReadPrec DeleteThingShadow
$creadPrec :: ReadPrec DeleteThingShadow
readList :: ReadS [DeleteThingShadow]
$creadList :: ReadS [DeleteThingShadow]
readsPrec :: Int -> ReadS DeleteThingShadow
$creadsPrec :: Int -> ReadS DeleteThingShadow
Prelude.Read, Int -> DeleteThingShadow -> ShowS
[DeleteThingShadow] -> ShowS
DeleteThingShadow -> String
(Int -> DeleteThingShadow -> ShowS)
-> (DeleteThingShadow -> String)
-> ([DeleteThingShadow] -> ShowS)
-> Show DeleteThingShadow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteThingShadow] -> ShowS
$cshowList :: [DeleteThingShadow] -> ShowS
show :: DeleteThingShadow -> String
$cshow :: DeleteThingShadow -> String
showsPrec :: Int -> DeleteThingShadow -> ShowS
$cshowsPrec :: Int -> DeleteThingShadow -> ShowS
Prelude.Show, (forall x. DeleteThingShadow -> Rep DeleteThingShadow x)
-> (forall x. Rep DeleteThingShadow x -> DeleteThingShadow)
-> Generic DeleteThingShadow
forall x. Rep DeleteThingShadow x -> DeleteThingShadow
forall x. DeleteThingShadow -> Rep DeleteThingShadow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteThingShadow x -> DeleteThingShadow
$cfrom :: forall x. DeleteThingShadow -> Rep DeleteThingShadow x
Prelude.Generic)
newDeleteThingShadow ::
Prelude.Text ->
DeleteThingShadow
newDeleteThingShadow :: Text -> DeleteThingShadow
newDeleteThingShadow Text
pThingName_ =
DeleteThingShadow' :: Maybe Text -> Text -> DeleteThingShadow
DeleteThingShadow'
{ $sel:shadowName:DeleteThingShadow' :: Maybe Text
shadowName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thingName:DeleteThingShadow' :: Text
thingName = Text
pThingName_
}
deleteThingShadow_shadowName :: Lens.Lens' DeleteThingShadow (Prelude.Maybe Prelude.Text)
deleteThingShadow_shadowName :: (Maybe Text -> f (Maybe Text))
-> DeleteThingShadow -> f DeleteThingShadow
deleteThingShadow_shadowName = (DeleteThingShadow -> Maybe Text)
-> (DeleteThingShadow -> Maybe Text -> DeleteThingShadow)
-> Lens
DeleteThingShadow DeleteThingShadow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThingShadow' {Maybe Text
shadowName :: Maybe Text
$sel:shadowName:DeleteThingShadow' :: DeleteThingShadow -> Maybe Text
shadowName} -> Maybe Text
shadowName) (\s :: DeleteThingShadow
s@DeleteThingShadow' {} Maybe Text
a -> DeleteThingShadow
s {$sel:shadowName:DeleteThingShadow' :: Maybe Text
shadowName = Maybe Text
a} :: DeleteThingShadow)
deleteThingShadow_thingName :: Lens.Lens' DeleteThingShadow Prelude.Text
deleteThingShadow_thingName :: (Text -> f Text) -> DeleteThingShadow -> f DeleteThingShadow
deleteThingShadow_thingName = (DeleteThingShadow -> Text)
-> (DeleteThingShadow -> Text -> DeleteThingShadow)
-> Lens DeleteThingShadow DeleteThingShadow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThingShadow' {Text
thingName :: Text
$sel:thingName:DeleteThingShadow' :: DeleteThingShadow -> Text
thingName} -> Text
thingName) (\s :: DeleteThingShadow
s@DeleteThingShadow' {} Text
a -> DeleteThingShadow
s {$sel:thingName:DeleteThingShadow' :: Text
thingName = Text
a} :: DeleteThingShadow)
instance Core.AWSRequest DeleteThingShadow where
type
AWSResponse DeleteThingShadow =
DeleteThingShadowResponse
request :: DeleteThingShadow -> Request DeleteThingShadow
request = Service -> DeleteThingShadow -> Request DeleteThingShadow
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteThingShadow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteThingShadow)))
response =
(Int
-> ResponseHeaders
-> ByteString
-> Either String (AWSResponse DeleteThingShadow))
-> Logger
-> Service
-> Proxy DeleteThingShadow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteThingShadow)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
-> ResponseHeaders -> ByteString -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBytes
( \Int
s ResponseHeaders
h ByteString
x ->
Int -> ByteString -> DeleteThingShadowResponse
DeleteThingShadowResponse'
(Int -> ByteString -> DeleteThingShadowResponse)
-> Either String Int
-> Either String (ByteString -> DeleteThingShadowResponse)
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))
Either String (ByteString -> DeleteThingShadowResponse)
-> Either String ByteString
-> Either String DeleteThingShadowResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ByteString -> Either String ByteString
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure ByteString
x)
)
instance Prelude.Hashable DeleteThingShadow
instance Prelude.NFData DeleteThingShadow
instance Core.ToHeaders DeleteThingShadow where
toHeaders :: DeleteThingShadow -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteThingShadow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteThingShadow where
toPath :: DeleteThingShadow -> ByteString
toPath DeleteThingShadow' {Maybe Text
Text
thingName :: Text
shadowName :: Maybe Text
$sel:thingName:DeleteThingShadow' :: DeleteThingShadow -> Text
$sel:shadowName:DeleteThingShadow' :: DeleteThingShadow -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/things/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
thingName, ByteString
"/shadow"]
instance Core.ToQuery DeleteThingShadow where
toQuery :: DeleteThingShadow -> QueryString
toQuery DeleteThingShadow' {Maybe Text
Text
thingName :: Text
shadowName :: Maybe Text
$sel:thingName:DeleteThingShadow' :: DeleteThingShadow -> Text
$sel:shadowName:DeleteThingShadow' :: DeleteThingShadow -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"name" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
shadowName]
data DeleteThingShadowResponse = DeleteThingShadowResponse'
{
DeleteThingShadowResponse -> Int
httpStatus :: Prelude.Int,
DeleteThingShadowResponse -> ByteString
payload :: Prelude.ByteString
}
deriving (DeleteThingShadowResponse -> DeleteThingShadowResponse -> Bool
(DeleteThingShadowResponse -> DeleteThingShadowResponse -> Bool)
-> (DeleteThingShadowResponse -> DeleteThingShadowResponse -> Bool)
-> Eq DeleteThingShadowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteThingShadowResponse -> DeleteThingShadowResponse -> Bool
$c/= :: DeleteThingShadowResponse -> DeleteThingShadowResponse -> Bool
== :: DeleteThingShadowResponse -> DeleteThingShadowResponse -> Bool
$c== :: DeleteThingShadowResponse -> DeleteThingShadowResponse -> Bool
Prelude.Eq, Int -> DeleteThingShadowResponse -> ShowS
[DeleteThingShadowResponse] -> ShowS
DeleteThingShadowResponse -> String
(Int -> DeleteThingShadowResponse -> ShowS)
-> (DeleteThingShadowResponse -> String)
-> ([DeleteThingShadowResponse] -> ShowS)
-> Show DeleteThingShadowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteThingShadowResponse] -> ShowS
$cshowList :: [DeleteThingShadowResponse] -> ShowS
show :: DeleteThingShadowResponse -> String
$cshow :: DeleteThingShadowResponse -> String
showsPrec :: Int -> DeleteThingShadowResponse -> ShowS
$cshowsPrec :: Int -> DeleteThingShadowResponse -> ShowS
Prelude.Show, (forall x.
DeleteThingShadowResponse -> Rep DeleteThingShadowResponse x)
-> (forall x.
Rep DeleteThingShadowResponse x -> DeleteThingShadowResponse)
-> Generic DeleteThingShadowResponse
forall x.
Rep DeleteThingShadowResponse x -> DeleteThingShadowResponse
forall x.
DeleteThingShadowResponse -> Rep DeleteThingShadowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteThingShadowResponse x -> DeleteThingShadowResponse
$cfrom :: forall x.
DeleteThingShadowResponse -> Rep DeleteThingShadowResponse x
Prelude.Generic)
newDeleteThingShadowResponse ::
Prelude.Int ->
Prelude.ByteString ->
DeleteThingShadowResponse
newDeleteThingShadowResponse :: Int -> ByteString -> DeleteThingShadowResponse
newDeleteThingShadowResponse Int
pHttpStatus_ ByteString
pPayload_ =
DeleteThingShadowResponse' :: Int -> ByteString -> DeleteThingShadowResponse
DeleteThingShadowResponse'
{ $sel:httpStatus:DeleteThingShadowResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:payload:DeleteThingShadowResponse' :: ByteString
payload = ByteString
pPayload_
}
deleteThingShadowResponse_httpStatus :: Lens.Lens' DeleteThingShadowResponse Prelude.Int
deleteThingShadowResponse_httpStatus :: (Int -> f Int)
-> DeleteThingShadowResponse -> f DeleteThingShadowResponse
deleteThingShadowResponse_httpStatus = (DeleteThingShadowResponse -> Int)
-> (DeleteThingShadowResponse -> Int -> DeleteThingShadowResponse)
-> Lens DeleteThingShadowResponse DeleteThingShadowResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThingShadowResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteThingShadowResponse' :: DeleteThingShadowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteThingShadowResponse
s@DeleteThingShadowResponse' {} Int
a -> DeleteThingShadowResponse
s {$sel:httpStatus:DeleteThingShadowResponse' :: Int
httpStatus = Int
a} :: DeleteThingShadowResponse)
deleteThingShadowResponse_payload :: Lens.Lens' DeleteThingShadowResponse Prelude.ByteString
deleteThingShadowResponse_payload :: (ByteString -> f ByteString)
-> DeleteThingShadowResponse -> f DeleteThingShadowResponse
deleteThingShadowResponse_payload = (DeleteThingShadowResponse -> ByteString)
-> (DeleteThingShadowResponse
-> ByteString -> DeleteThingShadowResponse)
-> Lens
DeleteThingShadowResponse
DeleteThingShadowResponse
ByteString
ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteThingShadowResponse' {ByteString
payload :: ByteString
$sel:payload:DeleteThingShadowResponse' :: DeleteThingShadowResponse -> ByteString
payload} -> ByteString
payload) (\s :: DeleteThingShadowResponse
s@DeleteThingShadowResponse' {} ByteString
a -> DeleteThingShadowResponse
s {$sel:payload:DeleteThingShadowResponse' :: ByteString
payload = ByteString
a} :: DeleteThingShadowResponse)
instance Prelude.NFData DeleteThingShadowResponse