module Network.AWS.DeviceFarm.GetProject
(
getProject
, GetProject
, gpArn
, getProjectResponse
, GetProjectResponse
, gprsProject
, gprsStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetProject = GetProject'
{ _gpArn :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getProject
:: Text
-> GetProject
getProject pArn_ =
GetProject'
{ _gpArn = pArn_
}
gpArn :: Lens' GetProject Text
gpArn = lens _gpArn (\ s a -> s{_gpArn = a});
instance AWSRequest GetProject where
type Sv GetProject = DeviceFarm
type Rs GetProject = GetProjectResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
GetProjectResponse' <$>
(x .?> "project") <*> (pure (fromEnum s)))
instance ToHeaders GetProject where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetProject" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetProject where
toJSON GetProject'{..} = object ["arn" .= _gpArn]
instance ToPath GetProject where
toPath = const "/"
instance ToQuery GetProject where
toQuery = const mempty
data GetProjectResponse = GetProjectResponse'
{ _gprsProject :: !(Maybe Project)
, _gprsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getProjectResponse
:: Int
-> GetProjectResponse
getProjectResponse pStatus_ =
GetProjectResponse'
{ _gprsProject = Nothing
, _gprsStatus = pStatus_
}
gprsProject :: Lens' GetProjectResponse (Maybe Project)
gprsProject = lens _gprsProject (\ s a -> s{_gprsProject = a});
gprsStatus :: Lens' GetProjectResponse Int
gprsStatus = lens _gprsStatus (\ s a -> s{_gprsStatus = a});