{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Pinpoint.DeleteEndpoint
(
deleteEndpoint
, DeleteEndpoint
, deApplicationId
, deEndpointId
, deleteEndpointResponse
, DeleteEndpointResponse
, dersResponseStatus
, dersEndpointResponse
) where
import Network.AWS.Lens
import Network.AWS.Pinpoint.Types
import Network.AWS.Pinpoint.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteEndpoint = DeleteEndpoint'
{ _deApplicationId :: !Text
, _deEndpointId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteEndpoint
:: Text
-> Text
-> DeleteEndpoint
deleteEndpoint pApplicationId_ pEndpointId_ =
DeleteEndpoint'
{_deApplicationId = pApplicationId_, _deEndpointId = pEndpointId_}
deApplicationId :: Lens' DeleteEndpoint Text
deApplicationId = lens _deApplicationId (\ s a -> s{_deApplicationId = a})
deEndpointId :: Lens' DeleteEndpoint Text
deEndpointId = lens _deEndpointId (\ s a -> s{_deEndpointId = a})
instance AWSRequest DeleteEndpoint where
type Rs DeleteEndpoint = DeleteEndpointResponse
request = delete pinpoint
response
= receiveJSON
(\ s h x ->
DeleteEndpointResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable DeleteEndpoint where
instance NFData DeleteEndpoint where
instance ToHeaders DeleteEndpoint where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath DeleteEndpoint where
toPath DeleteEndpoint'{..}
= mconcat
["/v1/apps/", toBS _deApplicationId, "/endpoints/",
toBS _deEndpointId]
instance ToQuery DeleteEndpoint where
toQuery = const mempty
data DeleteEndpointResponse = DeleteEndpointResponse'
{ _dersResponseStatus :: !Int
, _dersEndpointResponse :: !EndpointResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteEndpointResponse
:: Int
-> EndpointResponse
-> DeleteEndpointResponse
deleteEndpointResponse pResponseStatus_ pEndpointResponse_ =
DeleteEndpointResponse'
{ _dersResponseStatus = pResponseStatus_
, _dersEndpointResponse = pEndpointResponse_
}
dersResponseStatus :: Lens' DeleteEndpointResponse Int
dersResponseStatus = lens _dersResponseStatus (\ s a -> s{_dersResponseStatus = a})
dersEndpointResponse :: Lens' DeleteEndpointResponse EndpointResponse
dersEndpointResponse = lens _dersEndpointResponse (\ s a -> s{_dersEndpointResponse = a})
instance NFData DeleteEndpointResponse where