module Network.AWS.SNS.Types.Product where
import Network.AWS.Prelude
import Network.AWS.SNS.Types.Sum
data Endpoint = Endpoint'
{ _eAttributes :: !(Maybe (Map Text Text))
, _eEndpointARN :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
endpoint
:: Endpoint
endpoint =
Endpoint'
{ _eAttributes = Nothing
, _eEndpointARN = Nothing
}
eAttributes :: Lens' Endpoint (HashMap Text Text)
eAttributes = lens _eAttributes (\ s a -> s{_eAttributes = a}) . _Default . _Map;
eEndpointARN :: Lens' Endpoint (Maybe Text)
eEndpointARN = lens _eEndpointARN (\ s a -> s{_eEndpointARN = a});
instance FromXML Endpoint where
parseXML x
= Endpoint' <$>
(x .@? "Attributes" .!@ mempty >>=
may (parseXMLMap "entry" "key" "value"))
<*> (x .@? "EndpointArn")
instance ToQuery Endpoint where
toQuery Endpoint'{..}
= mconcat
["Attributes" =:
toQuery
(toQueryMap "entry" "key" "value" <$> _eAttributes),
"EndpointArn" =: _eEndpointARN]
data MessageAttributeValue = MessageAttributeValue'
{ _mavBinaryValue :: !(Maybe Base64)
, _mavStringValue :: !(Maybe Text)
, _mavDataType :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
messageAttributeValue
:: Text
-> MessageAttributeValue
messageAttributeValue pDataType_ =
MessageAttributeValue'
{ _mavBinaryValue = Nothing
, _mavStringValue = Nothing
, _mavDataType = pDataType_
}
mavBinaryValue :: Lens' MessageAttributeValue (Maybe ByteString)
mavBinaryValue = lens _mavBinaryValue (\ s a -> s{_mavBinaryValue = a}) . mapping _Base64;
mavStringValue :: Lens' MessageAttributeValue (Maybe Text)
mavStringValue = lens _mavStringValue (\ s a -> s{_mavStringValue = a});
mavDataType :: Lens' MessageAttributeValue Text
mavDataType = lens _mavDataType (\ s a -> s{_mavDataType = a});
instance ToQuery MessageAttributeValue where
toQuery MessageAttributeValue'{..}
= mconcat
["BinaryValue" =: _mavBinaryValue,
"StringValue" =: _mavStringValue,
"DataType" =: _mavDataType]
data PlatformApplication = PlatformApplication'
{ _paPlatformApplicationARN :: !(Maybe Text)
, _paAttributes :: !(Maybe (Map Text Text))
} deriving (Eq,Read,Show,Data,Typeable,Generic)
platformApplication
:: PlatformApplication
platformApplication =
PlatformApplication'
{ _paPlatformApplicationARN = Nothing
, _paAttributes = Nothing
}
paPlatformApplicationARN :: Lens' PlatformApplication (Maybe Text)
paPlatformApplicationARN = lens _paPlatformApplicationARN (\ s a -> s{_paPlatformApplicationARN = a});
paAttributes :: Lens' PlatformApplication (HashMap Text Text)
paAttributes = lens _paAttributes (\ s a -> s{_paAttributes = a}) . _Default . _Map;
instance FromXML PlatformApplication where
parseXML x
= PlatformApplication' <$>
(x .@? "PlatformApplicationArn") <*>
(x .@? "Attributes" .!@ mempty >>=
may (parseXMLMap "entry" "key" "value"))
data Subscription = Subscription'
{ _sProtocol :: !(Maybe Text)
, _sOwner :: !(Maybe Text)
, _sTopicARN :: !(Maybe Text)
, _sEndpoint :: !(Maybe Endpoint)
, _sSubscriptionARN :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
subscription
:: Subscription
subscription =
Subscription'
{ _sProtocol = Nothing
, _sOwner = Nothing
, _sTopicARN = Nothing
, _sEndpoint = Nothing
, _sSubscriptionARN = Nothing
}
sProtocol :: Lens' Subscription (Maybe Text)
sProtocol = lens _sProtocol (\ s a -> s{_sProtocol = a});
sOwner :: Lens' Subscription (Maybe Text)
sOwner = lens _sOwner (\ s a -> s{_sOwner = a});
sTopicARN :: Lens' Subscription (Maybe Text)
sTopicARN = lens _sTopicARN (\ s a -> s{_sTopicARN = a});
sEndpoint :: Lens' Subscription (Maybe Endpoint)
sEndpoint = lens _sEndpoint (\ s a -> s{_sEndpoint = a});
sSubscriptionARN :: Lens' Subscription (Maybe Text)
sSubscriptionARN = lens _sSubscriptionARN (\ s a -> s{_sSubscriptionARN = a});
instance FromXML Subscription where
parseXML x
= Subscription' <$>
(x .@? "Protocol") <*> (x .@? "Owner") <*>
(x .@? "TopicArn")
<*> (x .@? "Endpoint")
<*> (x .@? "SubscriptionArn")
newtype Topic = Topic'
{ _tTopicARN :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
topic
:: Topic
topic =
Topic'
{ _tTopicARN = Nothing
}
tTopicARN :: Lens' Topic (Maybe Text)
tTopicARN = lens _tTopicARN (\ s a -> s{_tTopicARN = a});
instance FromXML Topic where
parseXML x = Topic' <$> (x .@? "TopicArn")