module Network.AWS.Pinpoint.GetSegment
(
getSegment
, GetSegment
, gsSegmentId
, gsApplicationId
, getSegmentResponse
, GetSegmentResponse
, getrsResponseStatus
, getrsSegmentResponse
) 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 GetSegment = GetSegment'
{ _gsSegmentId :: !Text
, _gsApplicationId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSegment
:: Text
-> Text
-> GetSegment
getSegment pSegmentId_ pApplicationId_ =
GetSegment' {_gsSegmentId = pSegmentId_, _gsApplicationId = pApplicationId_}
gsSegmentId :: Lens' GetSegment Text
gsSegmentId = lens _gsSegmentId (\ s a -> s{_gsSegmentId = a});
gsApplicationId :: Lens' GetSegment Text
gsApplicationId = lens _gsApplicationId (\ s a -> s{_gsApplicationId = a});
instance AWSRequest GetSegment where
type Rs GetSegment = GetSegmentResponse
request = get pinpoint
response
= receiveJSON
(\ s h x ->
GetSegmentResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable GetSegment where
instance NFData GetSegment where
instance ToHeaders GetSegment where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetSegment where
toPath GetSegment'{..}
= mconcat
["/v1/apps/", toBS _gsApplicationId, "/segments/",
toBS _gsSegmentId]
instance ToQuery GetSegment where
toQuery = const mempty
data GetSegmentResponse = GetSegmentResponse'
{ _getrsResponseStatus :: !Int
, _getrsSegmentResponse :: !SegmentResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSegmentResponse
:: Int
-> SegmentResponse
-> GetSegmentResponse
getSegmentResponse pResponseStatus_ pSegmentResponse_ =
GetSegmentResponse'
{ _getrsResponseStatus = pResponseStatus_
, _getrsSegmentResponse = pSegmentResponse_
}
getrsResponseStatus :: Lens' GetSegmentResponse Int
getrsResponseStatus = lens _getrsResponseStatus (\ s a -> s{_getrsResponseStatus = a});
getrsSegmentResponse :: Lens' GetSegmentResponse SegmentResponse
getrsSegmentResponse = lens _getrsSegmentResponse (\ s a -> s{_getrsSegmentResponse = a});
instance NFData GetSegmentResponse where