{-# 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.AppStream.UpdateFleet
(
updateFleet
, UpdateFleet
, ufDomainJoinInfo
, ufDisconnectTimeoutInSeconds
, ufMaxUserDurationInSeconds
, ufAttributesToDelete
, ufDeleteVPCConfig
, ufInstanceType
, ufVPCConfig
, ufDisplayName
, ufEnableDefaultInternetAccess
, ufImageName
, ufDescription
, ufComputeCapacity
, ufName
, updateFleetResponse
, UpdateFleetResponse
, ufrsFleet
, ufrsResponseStatus
) where
import Network.AWS.AppStream.Types
import Network.AWS.AppStream.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateFleet = UpdateFleet'
{ _ufDomainJoinInfo :: !(Maybe DomainJoinInfo)
, _ufDisconnectTimeoutInSeconds :: !(Maybe Int)
, _ufMaxUserDurationInSeconds :: !(Maybe Int)
, _ufAttributesToDelete :: !(Maybe [FleetAttribute])
, _ufDeleteVPCConfig :: !(Maybe Bool)
, _ufInstanceType :: !(Maybe Text)
, _ufVPCConfig :: !(Maybe VPCConfig)
, _ufDisplayName :: !(Maybe Text)
, _ufEnableDefaultInternetAccess :: !(Maybe Bool)
, _ufImageName :: !(Maybe Text)
, _ufDescription :: !(Maybe Text)
, _ufComputeCapacity :: !(Maybe ComputeCapacity)
, _ufName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateFleet
:: Text
-> UpdateFleet
updateFleet pName_ =
UpdateFleet'
{ _ufDomainJoinInfo = Nothing
, _ufDisconnectTimeoutInSeconds = Nothing
, _ufMaxUserDurationInSeconds = Nothing
, _ufAttributesToDelete = Nothing
, _ufDeleteVPCConfig = Nothing
, _ufInstanceType = Nothing
, _ufVPCConfig = Nothing
, _ufDisplayName = Nothing
, _ufEnableDefaultInternetAccess = Nothing
, _ufImageName = Nothing
, _ufDescription = Nothing
, _ufComputeCapacity = Nothing
, _ufName = pName_
}
ufDomainJoinInfo :: Lens' UpdateFleet (Maybe DomainJoinInfo)
ufDomainJoinInfo = lens _ufDomainJoinInfo (\ s a -> s{_ufDomainJoinInfo = a})
ufDisconnectTimeoutInSeconds :: Lens' UpdateFleet (Maybe Int)
ufDisconnectTimeoutInSeconds = lens _ufDisconnectTimeoutInSeconds (\ s a -> s{_ufDisconnectTimeoutInSeconds = a})
ufMaxUserDurationInSeconds :: Lens' UpdateFleet (Maybe Int)
ufMaxUserDurationInSeconds = lens _ufMaxUserDurationInSeconds (\ s a -> s{_ufMaxUserDurationInSeconds = a})
ufAttributesToDelete :: Lens' UpdateFleet [FleetAttribute]
ufAttributesToDelete = lens _ufAttributesToDelete (\ s a -> s{_ufAttributesToDelete = a}) . _Default . _Coerce
ufDeleteVPCConfig :: Lens' UpdateFleet (Maybe Bool)
ufDeleteVPCConfig = lens _ufDeleteVPCConfig (\ s a -> s{_ufDeleteVPCConfig = a})
ufInstanceType :: Lens' UpdateFleet (Maybe Text)
ufInstanceType = lens _ufInstanceType (\ s a -> s{_ufInstanceType = a})
ufVPCConfig :: Lens' UpdateFleet (Maybe VPCConfig)
ufVPCConfig = lens _ufVPCConfig (\ s a -> s{_ufVPCConfig = a})
ufDisplayName :: Lens' UpdateFleet (Maybe Text)
ufDisplayName = lens _ufDisplayName (\ s a -> s{_ufDisplayName = a})
ufEnableDefaultInternetAccess :: Lens' UpdateFleet (Maybe Bool)
ufEnableDefaultInternetAccess = lens _ufEnableDefaultInternetAccess (\ s a -> s{_ufEnableDefaultInternetAccess = a})
ufImageName :: Lens' UpdateFleet (Maybe Text)
ufImageName = lens _ufImageName (\ s a -> s{_ufImageName = a})
ufDescription :: Lens' UpdateFleet (Maybe Text)
ufDescription = lens _ufDescription (\ s a -> s{_ufDescription = a})
ufComputeCapacity :: Lens' UpdateFleet (Maybe ComputeCapacity)
ufComputeCapacity = lens _ufComputeCapacity (\ s a -> s{_ufComputeCapacity = a})
ufName :: Lens' UpdateFleet Text
ufName = lens _ufName (\ s a -> s{_ufName = a})
instance AWSRequest UpdateFleet where
type Rs UpdateFleet = UpdateFleetResponse
request = postJSON appStream
response
= receiveJSON
(\ s h x ->
UpdateFleetResponse' <$>
(x .?> "Fleet") <*> (pure (fromEnum s)))
instance Hashable UpdateFleet where
instance NFData UpdateFleet where
instance ToHeaders UpdateFleet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.UpdateFleet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateFleet where
toJSON UpdateFleet'{..}
= object
(catMaybes
[("DomainJoinInfo" .=) <$> _ufDomainJoinInfo,
("DisconnectTimeoutInSeconds" .=) <$>
_ufDisconnectTimeoutInSeconds,
("MaxUserDurationInSeconds" .=) <$>
_ufMaxUserDurationInSeconds,
("AttributesToDelete" .=) <$> _ufAttributesToDelete,
("DeleteVpcConfig" .=) <$> _ufDeleteVPCConfig,
("InstanceType" .=) <$> _ufInstanceType,
("VpcConfig" .=) <$> _ufVPCConfig,
("DisplayName" .=) <$> _ufDisplayName,
("EnableDefaultInternetAccess" .=) <$>
_ufEnableDefaultInternetAccess,
("ImageName" .=) <$> _ufImageName,
("Description" .=) <$> _ufDescription,
("ComputeCapacity" .=) <$> _ufComputeCapacity,
Just ("Name" .= _ufName)])
instance ToPath UpdateFleet where
toPath = const "/"
instance ToQuery UpdateFleet where
toQuery = const mempty
data UpdateFleetResponse = UpdateFleetResponse'
{ _ufrsFleet :: !(Maybe Fleet)
, _ufrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateFleetResponse
:: Int
-> UpdateFleetResponse
updateFleetResponse pResponseStatus_ =
UpdateFleetResponse'
{_ufrsFleet = Nothing, _ufrsResponseStatus = pResponseStatus_}
ufrsFleet :: Lens' UpdateFleetResponse (Maybe Fleet)
ufrsFleet = lens _ufrsFleet (\ s a -> s{_ufrsFleet = a})
ufrsResponseStatus :: Lens' UpdateFleetResponse Int
ufrsResponseStatus = lens _ufrsResponseStatus (\ s a -> s{_ufrsResponseStatus = a})
instance NFData UpdateFleetResponse where