module Network.AWS.WorkDocs.GetDocumentPath
(
getDocumentPath
, GetDocumentPath
, gdpAuthenticationToken
, gdpMarker
, gdpLimit
, gdpFields
, gdpDocumentId
, getDocumentPathResponse
, GetDocumentPathResponse
, gdprsPath
, gdprsResponseStatus
) 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 GetDocumentPath = GetDocumentPath'
{ _gdpAuthenticationToken :: !(Maybe (Sensitive Text))
, _gdpMarker :: !(Maybe Text)
, _gdpLimit :: !(Maybe Nat)
, _gdpFields :: !(Maybe Text)
, _gdpDocumentId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
getDocumentPath
:: Text
-> GetDocumentPath
getDocumentPath pDocumentId_ =
GetDocumentPath'
{ _gdpAuthenticationToken = Nothing
, _gdpMarker = Nothing
, _gdpLimit = Nothing
, _gdpFields = Nothing
, _gdpDocumentId = pDocumentId_
}
gdpAuthenticationToken :: Lens' GetDocumentPath (Maybe Text)
gdpAuthenticationToken = lens _gdpAuthenticationToken (\ s a -> s{_gdpAuthenticationToken = a}) . mapping _Sensitive;
gdpMarker :: Lens' GetDocumentPath (Maybe Text)
gdpMarker = lens _gdpMarker (\ s a -> s{_gdpMarker = a});
gdpLimit :: Lens' GetDocumentPath (Maybe Natural)
gdpLimit = lens _gdpLimit (\ s a -> s{_gdpLimit = a}) . mapping _Nat;
gdpFields :: Lens' GetDocumentPath (Maybe Text)
gdpFields = lens _gdpFields (\ s a -> s{_gdpFields = a});
gdpDocumentId :: Lens' GetDocumentPath Text
gdpDocumentId = lens _gdpDocumentId (\ s a -> s{_gdpDocumentId = a});
instance AWSRequest GetDocumentPath where
type Rs GetDocumentPath = GetDocumentPathResponse
request = get workDocs
response
= receiveJSON
(\ s h x ->
GetDocumentPathResponse' <$>
(x .?> "Path") <*> (pure (fromEnum s)))
instance Hashable GetDocumentPath where
instance NFData GetDocumentPath where
instance ToHeaders GetDocumentPath where
toHeaders GetDocumentPath'{..}
= mconcat
["Authentication" =# _gdpAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath GetDocumentPath where
toPath GetDocumentPath'{..}
= mconcat
["/api/v1/documents/", toBS _gdpDocumentId, "/path"]
instance ToQuery GetDocumentPath where
toQuery GetDocumentPath'{..}
= mconcat
["marker" =: _gdpMarker, "limit" =: _gdpLimit,
"fields" =: _gdpFields]
data GetDocumentPathResponse = GetDocumentPathResponse'
{ _gdprsPath :: !(Maybe ResourcePath)
, _gdprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDocumentPathResponse
:: Int
-> GetDocumentPathResponse
getDocumentPathResponse pResponseStatus_ =
GetDocumentPathResponse'
{_gdprsPath = Nothing, _gdprsResponseStatus = pResponseStatus_}
gdprsPath :: Lens' GetDocumentPathResponse (Maybe ResourcePath)
gdprsPath = lens _gdprsPath (\ s a -> s{_gdprsPath = a});
gdprsResponseStatus :: Lens' GetDocumentPathResponse Int
gdprsResponseStatus = lens _gdprsResponseStatus (\ s a -> s{_gdprsResponseStatus = a});
instance NFData GetDocumentPathResponse where