{-# 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.SNS.GetEndpointAttributes
(
getEndpointAttributes
, GetEndpointAttributes
, geaEndpointARN
, getEndpointAttributesResponse
, GetEndpointAttributesResponse
, gearsAttributes
, gearsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SNS.Types
import Network.AWS.SNS.Types.Product
newtype GetEndpointAttributes = GetEndpointAttributes'
{ _geaEndpointARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getEndpointAttributes
:: Text
-> GetEndpointAttributes
getEndpointAttributes pEndpointARN_ =
GetEndpointAttributes'
{ _geaEndpointARN = pEndpointARN_
}
geaEndpointARN :: Lens' GetEndpointAttributes Text
geaEndpointARN = lens _geaEndpointARN (\ s a -> s{_geaEndpointARN = a});
instance AWSRequest GetEndpointAttributes where
type Rs GetEndpointAttributes =
GetEndpointAttributesResponse
request = postQuery sns
response
= receiveXMLWrapper "GetEndpointAttributesResult"
(\ s h x ->
GetEndpointAttributesResponse' <$>
(x .@? "Attributes" .!@ mempty >>=
may (parseXMLMap "entry" "key" "value"))
<*> (pure (fromEnum s)))
instance Hashable GetEndpointAttributes
instance NFData GetEndpointAttributes
instance ToHeaders GetEndpointAttributes where
toHeaders = const mempty
instance ToPath GetEndpointAttributes where
toPath = const "/"
instance ToQuery GetEndpointAttributes where
toQuery GetEndpointAttributes'{..}
= mconcat
["Action" =: ("GetEndpointAttributes" :: ByteString),
"Version" =: ("2010-03-31" :: ByteString),
"EndpointArn" =: _geaEndpointARN]
data GetEndpointAttributesResponse = GetEndpointAttributesResponse'
{ _gearsAttributes :: !(Maybe (Map Text Text))
, _gearsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getEndpointAttributesResponse
:: Int
-> GetEndpointAttributesResponse
getEndpointAttributesResponse pResponseStatus_ =
GetEndpointAttributesResponse'
{ _gearsAttributes = Nothing
, _gearsResponseStatus = pResponseStatus_
}
gearsAttributes :: Lens' GetEndpointAttributesResponse (HashMap Text Text)
gearsAttributes = lens _gearsAttributes (\ s a -> s{_gearsAttributes = a}) . _Default . _Map;
gearsResponseStatus :: Lens' GetEndpointAttributesResponse Int
gearsResponseStatus = lens _gearsResponseStatus (\ s a -> s{_gearsResponseStatus = a});
instance NFData GetEndpointAttributesResponse