{-# 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.WorkDocs.DescribeNotificationSubscriptions
(
describeNotificationSubscriptions
, DescribeNotificationSubscriptions
, dMarker
, dLimit
, dOrganizationId
, describeNotificationSubscriptionsResponse
, DescribeNotificationSubscriptionsResponse
, dnsrsMarker
, dnsrsSubscriptions
, dnsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WorkDocs.Types
import Network.AWS.WorkDocs.Types.Product
data DescribeNotificationSubscriptions = DescribeNotificationSubscriptions'
{ _dMarker :: !(Maybe Text)
, _dLimit :: !(Maybe Nat)
, _dOrganizationId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeNotificationSubscriptions
:: Text
-> DescribeNotificationSubscriptions
describeNotificationSubscriptions pOrganizationId_ =
DescribeNotificationSubscriptions'
{_dMarker = Nothing, _dLimit = Nothing, _dOrganizationId = pOrganizationId_}
dMarker :: Lens' DescribeNotificationSubscriptions (Maybe Text)
dMarker = lens _dMarker (\ s a -> s{_dMarker = a})
dLimit :: Lens' DescribeNotificationSubscriptions (Maybe Natural)
dLimit = lens _dLimit (\ s a -> s{_dLimit = a}) . mapping _Nat
dOrganizationId :: Lens' DescribeNotificationSubscriptions Text
dOrganizationId = lens _dOrganizationId (\ s a -> s{_dOrganizationId = a})
instance AWSRequest DescribeNotificationSubscriptions
where
type Rs DescribeNotificationSubscriptions =
DescribeNotificationSubscriptionsResponse
request = get workDocs
response
= receiveJSON
(\ s h x ->
DescribeNotificationSubscriptionsResponse' <$>
(x .?> "Marker") <*>
(x .?> "Subscriptions" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeNotificationSubscriptions
where
instance NFData DescribeNotificationSubscriptions
where
instance ToHeaders DescribeNotificationSubscriptions
where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath DescribeNotificationSubscriptions
where
toPath DescribeNotificationSubscriptions'{..}
= mconcat
["/api/v1/organizations/", toBS _dOrganizationId,
"/subscriptions"]
instance ToQuery DescribeNotificationSubscriptions
where
toQuery DescribeNotificationSubscriptions'{..}
= mconcat ["marker" =: _dMarker, "limit" =: _dLimit]
data DescribeNotificationSubscriptionsResponse = DescribeNotificationSubscriptionsResponse'
{ _dnsrsMarker :: !(Maybe Text)
, _dnsrsSubscriptions :: !(Maybe [Subscription])
, _dnsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeNotificationSubscriptionsResponse
:: Int
-> DescribeNotificationSubscriptionsResponse
describeNotificationSubscriptionsResponse pResponseStatus_ =
DescribeNotificationSubscriptionsResponse'
{ _dnsrsMarker = Nothing
, _dnsrsSubscriptions = Nothing
, _dnsrsResponseStatus = pResponseStatus_
}
dnsrsMarker :: Lens' DescribeNotificationSubscriptionsResponse (Maybe Text)
dnsrsMarker = lens _dnsrsMarker (\ s a -> s{_dnsrsMarker = a})
dnsrsSubscriptions :: Lens' DescribeNotificationSubscriptionsResponse [Subscription]
dnsrsSubscriptions = lens _dnsrsSubscriptions (\ s a -> s{_dnsrsSubscriptions = a}) . _Default . _Coerce
dnsrsResponseStatus :: Lens' DescribeNotificationSubscriptionsResponse Int
dnsrsResponseStatus = lens _dnsrsResponseStatus (\ s a -> s{_dnsrsResponseStatus = a})
instance NFData
DescribeNotificationSubscriptionsResponse
where