{-# 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.DeleteSegment
(
deleteSegment
, DeleteSegment
, dsSegmentId
, dsApplicationId
, deleteSegmentResponse
, DeleteSegmentResponse
, dsrsResponseStatus
, dsrsSegmentResponse
) 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 DeleteSegment = DeleteSegment'
{ _dsSegmentId :: !Text
, _dsApplicationId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteSegment
:: Text
-> Text
-> DeleteSegment
deleteSegment pSegmentId_ pApplicationId_ =
DeleteSegment'
{_dsSegmentId = pSegmentId_, _dsApplicationId = pApplicationId_}
dsSegmentId :: Lens' DeleteSegment Text
dsSegmentId = lens _dsSegmentId (\ s a -> s{_dsSegmentId = a})
dsApplicationId :: Lens' DeleteSegment Text
dsApplicationId = lens _dsApplicationId (\ s a -> s{_dsApplicationId = a})
instance AWSRequest DeleteSegment where
type Rs DeleteSegment = DeleteSegmentResponse
request = delete pinpoint
response
= receiveJSON
(\ s h x ->
DeleteSegmentResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable DeleteSegment where
instance NFData DeleteSegment where
instance ToHeaders DeleteSegment where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath DeleteSegment where
toPath DeleteSegment'{..}
= mconcat
["/v1/apps/", toBS _dsApplicationId, "/segments/",
toBS _dsSegmentId]
instance ToQuery DeleteSegment where
toQuery = const mempty
data DeleteSegmentResponse = DeleteSegmentResponse'
{ _dsrsResponseStatus :: !Int
, _dsrsSegmentResponse :: !SegmentResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteSegmentResponse
:: Int
-> SegmentResponse
-> DeleteSegmentResponse
deleteSegmentResponse pResponseStatus_ pSegmentResponse_ =
DeleteSegmentResponse'
{ _dsrsResponseStatus = pResponseStatus_
, _dsrsSegmentResponse = pSegmentResponse_
}
dsrsResponseStatus :: Lens' DeleteSegmentResponse Int
dsrsResponseStatus = lens _dsrsResponseStatus (\ s a -> s{_dsrsResponseStatus = a})
dsrsSegmentResponse :: Lens' DeleteSegmentResponse SegmentResponse
dsrsSegmentResponse = lens _dsrsSegmentResponse (\ s a -> s{_dsrsSegmentResponse = a})
instance NFData DeleteSegmentResponse where