{-# 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.DeviceFarm.GetTest
(
getTest
, GetTest
, gtArn
, getTestResponse
, GetTestResponse
, gtrsTest
, gtrsResponseStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetTest = GetTest'
{ _gtArn :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getTest
:: Text
-> GetTest
getTest pArn_ = GetTest' {_gtArn = pArn_}
gtArn :: Lens' GetTest Text
gtArn = lens _gtArn (\ s a -> s{_gtArn = a})
instance AWSRequest GetTest where
type Rs GetTest = GetTestResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetTestResponse' <$>
(x .?> "test") <*> (pure (fromEnum s)))
instance Hashable GetTest where
instance NFData GetTest where
instance ToHeaders GetTest where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetTest" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetTest where
toJSON GetTest'{..}
= object (catMaybes [Just ("arn" .= _gtArn)])
instance ToPath GetTest where
toPath = const "/"
instance ToQuery GetTest where
toQuery = const mempty
data GetTestResponse = GetTestResponse'
{ _gtrsTest :: !(Maybe Test)
, _gtrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getTestResponse
:: Int
-> GetTestResponse
getTestResponse pResponseStatus_ =
GetTestResponse' {_gtrsTest = Nothing, _gtrsResponseStatus = pResponseStatus_}
gtrsTest :: Lens' GetTestResponse (Maybe Test)
gtrsTest = lens _gtrsTest (\ s a -> s{_gtrsTest = a})
gtrsResponseStatus :: Lens' GetTestResponse Int
gtrsResponseStatus = lens _gtrsResponseStatus (\ s a -> s{_gtrsResponseStatus = a})
instance NFData GetTestResponse where