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