module Network.AWS.WorkDocs.GetFolderPath
(
getFolderPath
, GetFolderPath
, gfpAuthenticationToken
, gfpMarker
, gfpLimit
, gfpFields
, gfpFolderId
, getFolderPathResponse
, GetFolderPathResponse
, gfprsPath
, gfprsResponseStatus
) 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 GetFolderPath = GetFolderPath'
{ _gfpAuthenticationToken :: !(Maybe (Sensitive Text))
, _gfpMarker :: !(Maybe Text)
, _gfpLimit :: !(Maybe Nat)
, _gfpFields :: !(Maybe Text)
, _gfpFolderId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
getFolderPath
:: Text
-> GetFolderPath
getFolderPath pFolderId_ =
GetFolderPath'
{ _gfpAuthenticationToken = Nothing
, _gfpMarker = Nothing
, _gfpLimit = Nothing
, _gfpFields = Nothing
, _gfpFolderId = pFolderId_
}
gfpAuthenticationToken :: Lens' GetFolderPath (Maybe Text)
gfpAuthenticationToken = lens _gfpAuthenticationToken (\ s a -> s{_gfpAuthenticationToken = a}) . mapping _Sensitive;
gfpMarker :: Lens' GetFolderPath (Maybe Text)
gfpMarker = lens _gfpMarker (\ s a -> s{_gfpMarker = a});
gfpLimit :: Lens' GetFolderPath (Maybe Natural)
gfpLimit = lens _gfpLimit (\ s a -> s{_gfpLimit = a}) . mapping _Nat;
gfpFields :: Lens' GetFolderPath (Maybe Text)
gfpFields = lens _gfpFields (\ s a -> s{_gfpFields = a});
gfpFolderId :: Lens' GetFolderPath Text
gfpFolderId = lens _gfpFolderId (\ s a -> s{_gfpFolderId = a});
instance AWSRequest GetFolderPath where
type Rs GetFolderPath = GetFolderPathResponse
request = get workDocs
response
= receiveJSON
(\ s h x ->
GetFolderPathResponse' <$>
(x .?> "Path") <*> (pure (fromEnum s)))
instance Hashable GetFolderPath where
instance NFData GetFolderPath where
instance ToHeaders GetFolderPath where
toHeaders GetFolderPath'{..}
= mconcat
["Authentication" =# _gfpAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath GetFolderPath where
toPath GetFolderPath'{..}
= mconcat
["/api/v1/folders/", toBS _gfpFolderId, "/path"]
instance ToQuery GetFolderPath where
toQuery GetFolderPath'{..}
= mconcat
["marker" =: _gfpMarker, "limit" =: _gfpLimit,
"fields" =: _gfpFields]
data GetFolderPathResponse = GetFolderPathResponse'
{ _gfprsPath :: !(Maybe ResourcePath)
, _gfprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getFolderPathResponse
:: Int
-> GetFolderPathResponse
getFolderPathResponse pResponseStatus_ =
GetFolderPathResponse'
{_gfprsPath = Nothing, _gfprsResponseStatus = pResponseStatus_}
gfprsPath :: Lens' GetFolderPathResponse (Maybe ResourcePath)
gfprsPath = lens _gfprsPath (\ s a -> s{_gfprsPath = a});
gfprsResponseStatus :: Lens' GetFolderPathResponse Int
gfprsResponseStatus = lens _gfprsResponseStatus (\ s a -> s{_gfprsResponseStatus = a});
instance NFData GetFolderPathResponse where