module Network.AWS.WorkDocs.GetFolder
(
getFolder
, GetFolder
, gfAuthenticationToken
, gfIncludeCustomMetadata
, gfFolderId
, getFolderResponse
, GetFolderResponse
, gfrsCustomMetadata
, gfrsMetadata
, gfrsResponseStatus
) 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 GetFolder = GetFolder'
{ _gfAuthenticationToken :: !(Maybe (Sensitive Text))
, _gfIncludeCustomMetadata :: !(Maybe Bool)
, _gfFolderId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
getFolder
:: Text
-> GetFolder
getFolder pFolderId_ =
GetFolder'
{ _gfAuthenticationToken = Nothing
, _gfIncludeCustomMetadata = Nothing
, _gfFolderId = pFolderId_
}
gfAuthenticationToken :: Lens' GetFolder (Maybe Text)
gfAuthenticationToken = lens _gfAuthenticationToken (\ s a -> s{_gfAuthenticationToken = a}) . mapping _Sensitive;
gfIncludeCustomMetadata :: Lens' GetFolder (Maybe Bool)
gfIncludeCustomMetadata = lens _gfIncludeCustomMetadata (\ s a -> s{_gfIncludeCustomMetadata = a});
gfFolderId :: Lens' GetFolder Text
gfFolderId = lens _gfFolderId (\ s a -> s{_gfFolderId = a});
instance AWSRequest GetFolder where
type Rs GetFolder = GetFolderResponse
request = get workDocs
response
= receiveJSON
(\ s h x ->
GetFolderResponse' <$>
(x .?> "CustomMetadata" .!@ mempty) <*>
(x .?> "Metadata")
<*> (pure (fromEnum s)))
instance Hashable GetFolder where
instance NFData GetFolder where
instance ToHeaders GetFolder where
toHeaders GetFolder'{..}
= mconcat
["Authentication" =# _gfAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath GetFolder where
toPath GetFolder'{..}
= mconcat ["/api/v1/folders/", toBS _gfFolderId]
instance ToQuery GetFolder where
toQuery GetFolder'{..}
= mconcat
["includeCustomMetadata" =: _gfIncludeCustomMetadata]
data GetFolderResponse = GetFolderResponse'
{ _gfrsCustomMetadata :: !(Maybe (Map Text Text))
, _gfrsMetadata :: !(Maybe FolderMetadata)
, _gfrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getFolderResponse
:: Int
-> GetFolderResponse
getFolderResponse pResponseStatus_ =
GetFolderResponse'
{ _gfrsCustomMetadata = Nothing
, _gfrsMetadata = Nothing
, _gfrsResponseStatus = pResponseStatus_
}
gfrsCustomMetadata :: Lens' GetFolderResponse (HashMap Text Text)
gfrsCustomMetadata = lens _gfrsCustomMetadata (\ s a -> s{_gfrsCustomMetadata = a}) . _Default . _Map;
gfrsMetadata :: Lens' GetFolderResponse (Maybe FolderMetadata)
gfrsMetadata = lens _gfrsMetadata (\ s a -> s{_gfrsMetadata = a});
gfrsResponseStatus :: Lens' GetFolderResponse Int
gfrsResponseStatus = lens _gfrsResponseStatus (\ s a -> s{_gfrsResponseStatus = a});
instance NFData GetFolderResponse where