{-# 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.Mobile.DescribeProject
(
describeProject
, DescribeProject
, dSyncFromResources
, dProjectId
, describeProjectResponse
, DescribeProjectResponse
, drsDetails
, drsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Mobile.Types
import Network.AWS.Mobile.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeProject = DescribeProject'
{ _dSyncFromResources :: !(Maybe Bool)
, _dProjectId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeProject
:: Text
-> DescribeProject
describeProject pProjectId_ =
DescribeProject' {_dSyncFromResources = Nothing, _dProjectId = pProjectId_}
dSyncFromResources :: Lens' DescribeProject (Maybe Bool)
dSyncFromResources = lens _dSyncFromResources (\ s a -> s{_dSyncFromResources = a})
dProjectId :: Lens' DescribeProject Text
dProjectId = lens _dProjectId (\ s a -> s{_dProjectId = a})
instance AWSRequest DescribeProject where
type Rs DescribeProject = DescribeProjectResponse
request = get mobile
response
= receiveJSON
(\ s h x ->
DescribeProjectResponse' <$>
(x .?> "details") <*> (pure (fromEnum s)))
instance Hashable DescribeProject where
instance NFData DescribeProject where
instance ToHeaders DescribeProject where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath DescribeProject where
toPath = const "/project"
instance ToQuery DescribeProject where
toQuery DescribeProject'{..}
= mconcat
["syncFromResources" =: _dSyncFromResources,
"projectId" =: _dProjectId]
data DescribeProjectResponse = DescribeProjectResponse'
{ _drsDetails :: !(Maybe ProjectDetails)
, _drsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeProjectResponse
:: Int
-> DescribeProjectResponse
describeProjectResponse pResponseStatus_ =
DescribeProjectResponse'
{_drsDetails = Nothing, _drsResponseStatus = pResponseStatus_}
drsDetails :: Lens' DescribeProjectResponse (Maybe ProjectDetails)
drsDetails = lens _drsDetails (\ s a -> s{_drsDetails = a})
drsResponseStatus :: Lens' DescribeProjectResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a})
instance NFData DescribeProjectResponse where