{-# 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.UpdateInstanceProfile
(
updateInstanceProfile
, UpdateInstanceProfile
, uipRebootAfterUse
, uipName
, uipPackageCleanup
, uipExcludeAppPackagesFromCleanup
, uipDescription
, uipArn
, updateInstanceProfileResponse
, UpdateInstanceProfileResponse
, uiprsInstanceProfile
, uiprsResponseStatus
) 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
data UpdateInstanceProfile = UpdateInstanceProfile'
{ _uipRebootAfterUse :: !(Maybe Bool)
, _uipName :: !(Maybe Text)
, _uipPackageCleanup :: !(Maybe Bool)
, _uipExcludeAppPackagesFromCleanup :: !(Maybe [Text])
, _uipDescription :: !(Maybe Text)
, _uipArn :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateInstanceProfile
:: Text
-> UpdateInstanceProfile
updateInstanceProfile pArn_ =
UpdateInstanceProfile'
{ _uipRebootAfterUse = Nothing
, _uipName = Nothing
, _uipPackageCleanup = Nothing
, _uipExcludeAppPackagesFromCleanup = Nothing
, _uipDescription = Nothing
, _uipArn = pArn_
}
uipRebootAfterUse :: Lens' UpdateInstanceProfile (Maybe Bool)
uipRebootAfterUse = lens _uipRebootAfterUse (\ s a -> s{_uipRebootAfterUse = a})
uipName :: Lens' UpdateInstanceProfile (Maybe Text)
uipName = lens _uipName (\ s a -> s{_uipName = a})
uipPackageCleanup :: Lens' UpdateInstanceProfile (Maybe Bool)
uipPackageCleanup = lens _uipPackageCleanup (\ s a -> s{_uipPackageCleanup = a})
uipExcludeAppPackagesFromCleanup :: Lens' UpdateInstanceProfile [Text]
uipExcludeAppPackagesFromCleanup = lens _uipExcludeAppPackagesFromCleanup (\ s a -> s{_uipExcludeAppPackagesFromCleanup = a}) . _Default . _Coerce
uipDescription :: Lens' UpdateInstanceProfile (Maybe Text)
uipDescription = lens _uipDescription (\ s a -> s{_uipDescription = a})
uipArn :: Lens' UpdateInstanceProfile Text
uipArn = lens _uipArn (\ s a -> s{_uipArn = a})
instance AWSRequest UpdateInstanceProfile where
type Rs UpdateInstanceProfile =
UpdateInstanceProfileResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
UpdateInstanceProfileResponse' <$>
(x .?> "instanceProfile") <*> (pure (fromEnum s)))
instance Hashable UpdateInstanceProfile where
instance NFData UpdateInstanceProfile where
instance ToHeaders UpdateInstanceProfile where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.UpdateInstanceProfile" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateInstanceProfile where
toJSON UpdateInstanceProfile'{..}
= object
(catMaybes
[("rebootAfterUse" .=) <$> _uipRebootAfterUse,
("name" .=) <$> _uipName,
("packageCleanup" .=) <$> _uipPackageCleanup,
("excludeAppPackagesFromCleanup" .=) <$>
_uipExcludeAppPackagesFromCleanup,
("description" .=) <$> _uipDescription,
Just ("arn" .= _uipArn)])
instance ToPath UpdateInstanceProfile where
toPath = const "/"
instance ToQuery UpdateInstanceProfile where
toQuery = const mempty
data UpdateInstanceProfileResponse = UpdateInstanceProfileResponse'
{ _uiprsInstanceProfile :: !(Maybe InstanceProfile)
, _uiprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateInstanceProfileResponse
:: Int
-> UpdateInstanceProfileResponse
updateInstanceProfileResponse pResponseStatus_ =
UpdateInstanceProfileResponse'
{_uiprsInstanceProfile = Nothing, _uiprsResponseStatus = pResponseStatus_}
uiprsInstanceProfile :: Lens' UpdateInstanceProfileResponse (Maybe InstanceProfile)
uiprsInstanceProfile = lens _uiprsInstanceProfile (\ s a -> s{_uiprsInstanceProfile = a})
uiprsResponseStatus :: Lens' UpdateInstanceProfileResponse Int
uiprsResponseStatus = lens _uiprsResponseStatus (\ s a -> s{_uiprsResponseStatus = a})
instance NFData UpdateInstanceProfileResponse where