{-# 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.GetNetworkProfile
(
getNetworkProfile
, GetNetworkProfile
, gnpArn
, getNetworkProfileResponse
, GetNetworkProfileResponse
, gnprsNetworkProfile
, gnprsResponseStatus
) 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 GetNetworkProfile = GetNetworkProfile'
{ _gnpArn :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getNetworkProfile
:: Text
-> GetNetworkProfile
getNetworkProfile pArn_ = GetNetworkProfile' {_gnpArn = pArn_}
gnpArn :: Lens' GetNetworkProfile Text
gnpArn = lens _gnpArn (\ s a -> s{_gnpArn = a})
instance AWSRequest GetNetworkProfile where
type Rs GetNetworkProfile = GetNetworkProfileResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetNetworkProfileResponse' <$>
(x .?> "networkProfile") <*> (pure (fromEnum s)))
instance Hashable GetNetworkProfile where
instance NFData GetNetworkProfile where
instance ToHeaders GetNetworkProfile where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetNetworkProfile" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetNetworkProfile where
toJSON GetNetworkProfile'{..}
= object (catMaybes [Just ("arn" .= _gnpArn)])
instance ToPath GetNetworkProfile where
toPath = const "/"
instance ToQuery GetNetworkProfile where
toQuery = const mempty
data GetNetworkProfileResponse = GetNetworkProfileResponse'
{ _gnprsNetworkProfile :: !(Maybe NetworkProfile)
, _gnprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getNetworkProfileResponse
:: Int
-> GetNetworkProfileResponse
getNetworkProfileResponse pResponseStatus_ =
GetNetworkProfileResponse'
{_gnprsNetworkProfile = Nothing, _gnprsResponseStatus = pResponseStatus_}
gnprsNetworkProfile :: Lens' GetNetworkProfileResponse (Maybe NetworkProfile)
gnprsNetworkProfile = lens _gnprsNetworkProfile (\ s a -> s{_gnprsNetworkProfile = a})
gnprsResponseStatus :: Lens' GetNetworkProfileResponse Int
gnprsResponseStatus = lens _gnprsResponseStatus (\ s a -> s{_gnprsResponseStatus = a})
instance NFData GetNetworkProfileResponse where