{-# 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.GetInstanceProfile
(
getInstanceProfile
, GetInstanceProfile
, gipArn
, getInstanceProfileResponse
, GetInstanceProfileResponse
, giprsInstanceProfile
, giprsResponseStatus
) 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 GetInstanceProfile = GetInstanceProfile'
{ _gipArn :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getInstanceProfile
:: Text
-> GetInstanceProfile
getInstanceProfile pArn_ = GetInstanceProfile' {_gipArn = pArn_}
gipArn :: Lens' GetInstanceProfile Text
gipArn = lens _gipArn (\ s a -> s{_gipArn = a})
instance AWSRequest GetInstanceProfile where
type Rs GetInstanceProfile =
GetInstanceProfileResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetInstanceProfileResponse' <$>
(x .?> "instanceProfile") <*> (pure (fromEnum s)))
instance Hashable GetInstanceProfile where
instance NFData GetInstanceProfile where
instance ToHeaders GetInstanceProfile where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetInstanceProfile" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetInstanceProfile where
toJSON GetInstanceProfile'{..}
= object (catMaybes [Just ("arn" .= _gipArn)])
instance ToPath GetInstanceProfile where
toPath = const "/"
instance ToQuery GetInstanceProfile where
toQuery = const mempty
data GetInstanceProfileResponse = GetInstanceProfileResponse'
{ _giprsInstanceProfile :: !(Maybe InstanceProfile)
, _giprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getInstanceProfileResponse
:: Int
-> GetInstanceProfileResponse
getInstanceProfileResponse pResponseStatus_ =
GetInstanceProfileResponse'
{_giprsInstanceProfile = Nothing, _giprsResponseStatus = pResponseStatus_}
giprsInstanceProfile :: Lens' GetInstanceProfileResponse (Maybe InstanceProfile)
giprsInstanceProfile = lens _giprsInstanceProfile (\ s a -> s{_giprsInstanceProfile = a})
giprsResponseStatus :: Lens' GetInstanceProfileResponse Int
giprsResponseStatus = lens _giprsResponseStatus (\ s a -> s{_giprsResponseStatus = a})
instance NFData GetInstanceProfileResponse where