{-# 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.GetDeviceInstance
(
getDeviceInstance
, GetDeviceInstance
, gdiArn
, getDeviceInstanceResponse
, GetDeviceInstanceResponse
, gdirsDeviceInstance
, gdirsResponseStatus
) 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 GetDeviceInstance = GetDeviceInstance'
{ _gdiArn :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeviceInstance
:: Text
-> GetDeviceInstance
getDeviceInstance pArn_ = GetDeviceInstance' {_gdiArn = pArn_}
gdiArn :: Lens' GetDeviceInstance Text
gdiArn = lens _gdiArn (\ s a -> s{_gdiArn = a})
instance AWSRequest GetDeviceInstance where
type Rs GetDeviceInstance = GetDeviceInstanceResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetDeviceInstanceResponse' <$>
(x .?> "deviceInstance") <*> (pure (fromEnum s)))
instance Hashable GetDeviceInstance where
instance NFData GetDeviceInstance where
instance ToHeaders GetDeviceInstance where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetDeviceInstance" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDeviceInstance where
toJSON GetDeviceInstance'{..}
= object (catMaybes [Just ("arn" .= _gdiArn)])
instance ToPath GetDeviceInstance where
toPath = const "/"
instance ToQuery GetDeviceInstance where
toQuery = const mempty
data GetDeviceInstanceResponse = GetDeviceInstanceResponse'
{ _gdirsDeviceInstance :: !(Maybe DeviceInstance)
, _gdirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeviceInstanceResponse
:: Int
-> GetDeviceInstanceResponse
getDeviceInstanceResponse pResponseStatus_ =
GetDeviceInstanceResponse'
{_gdirsDeviceInstance = Nothing, _gdirsResponseStatus = pResponseStatus_}
gdirsDeviceInstance :: Lens' GetDeviceInstanceResponse (Maybe DeviceInstance)
gdirsDeviceInstance = lens _gdirsDeviceInstance (\ s a -> s{_gdirsDeviceInstance = a})
gdirsResponseStatus :: Lens' GetDeviceInstanceResponse Int
gdirsResponseStatus = lens _gdirsResponseStatus (\ s a -> s{_gdirsResponseStatus = a})
instance NFData GetDeviceInstanceResponse where