module Network.AWS.WorkDocs.DescribeActivities
(
describeActivities
, DescribeActivities
, daStartTime
, daAuthenticationToken
, daUserId
, daMarker
, daEndTime
, daLimit
, daOrganizationId
, describeActivitiesResponse
, DescribeActivitiesResponse
, darsUserActivities
, darsMarker
, darsResponseStatus
) 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 DescribeActivities = DescribeActivities'
{ _daStartTime :: !(Maybe POSIX)
, _daAuthenticationToken :: !(Maybe (Sensitive Text))
, _daUserId :: !(Maybe Text)
, _daMarker :: !(Maybe Text)
, _daEndTime :: !(Maybe POSIX)
, _daLimit :: !(Maybe Nat)
, _daOrganizationId :: !(Maybe Text)
} deriving (Eq, Show, Data, Typeable, Generic)
describeActivities
:: DescribeActivities
describeActivities =
DescribeActivities'
{ _daStartTime = Nothing
, _daAuthenticationToken = Nothing
, _daUserId = Nothing
, _daMarker = Nothing
, _daEndTime = Nothing
, _daLimit = Nothing
, _daOrganizationId = Nothing
}
daStartTime :: Lens' DescribeActivities (Maybe UTCTime)
daStartTime = lens _daStartTime (\ s a -> s{_daStartTime = a}) . mapping _Time;
daAuthenticationToken :: Lens' DescribeActivities (Maybe Text)
daAuthenticationToken = lens _daAuthenticationToken (\ s a -> s{_daAuthenticationToken = a}) . mapping _Sensitive;
daUserId :: Lens' DescribeActivities (Maybe Text)
daUserId = lens _daUserId (\ s a -> s{_daUserId = a});
daMarker :: Lens' DescribeActivities (Maybe Text)
daMarker = lens _daMarker (\ s a -> s{_daMarker = a});
daEndTime :: Lens' DescribeActivities (Maybe UTCTime)
daEndTime = lens _daEndTime (\ s a -> s{_daEndTime = a}) . mapping _Time;
daLimit :: Lens' DescribeActivities (Maybe Natural)
daLimit = lens _daLimit (\ s a -> s{_daLimit = a}) . mapping _Nat;
daOrganizationId :: Lens' DescribeActivities (Maybe Text)
daOrganizationId = lens _daOrganizationId (\ s a -> s{_daOrganizationId = a});
instance AWSRequest DescribeActivities where
type Rs DescribeActivities =
DescribeActivitiesResponse
request = get workDocs
response
= receiveJSON
(\ s h x ->
DescribeActivitiesResponse' <$>
(x .?> "UserActivities" .!@ mempty) <*>
(x .?> "Marker")
<*> (pure (fromEnum s)))
instance Hashable DescribeActivities where
instance NFData DescribeActivities where
instance ToHeaders DescribeActivities where
toHeaders DescribeActivities'{..}
= mconcat
["Authentication" =# _daAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath DescribeActivities where
toPath = const "/api/v1/activities"
instance ToQuery DescribeActivities where
toQuery DescribeActivities'{..}
= mconcat
["startTime" =: _daStartTime, "userId" =: _daUserId,
"marker" =: _daMarker, "endTime" =: _daEndTime,
"limit" =: _daLimit,
"organizationId" =: _daOrganizationId]
data DescribeActivitiesResponse = DescribeActivitiesResponse'
{ _darsUserActivities :: !(Maybe [Activity])
, _darsMarker :: !(Maybe Text)
, _darsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeActivitiesResponse
:: Int
-> DescribeActivitiesResponse
describeActivitiesResponse pResponseStatus_ =
DescribeActivitiesResponse'
{ _darsUserActivities = Nothing
, _darsMarker = Nothing
, _darsResponseStatus = pResponseStatus_
}
darsUserActivities :: Lens' DescribeActivitiesResponse [Activity]
darsUserActivities = lens _darsUserActivities (\ s a -> s{_darsUserActivities = a}) . _Default . _Coerce;
darsMarker :: Lens' DescribeActivitiesResponse (Maybe Text)
darsMarker = lens _darsMarker (\ s a -> s{_darsMarker = a});
darsResponseStatus :: Lens' DescribeActivitiesResponse Int
darsResponseStatus = lens _darsResponseStatus (\ s a -> s{_darsResponseStatus = a});
instance NFData DescribeActivitiesResponse where