{-# 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.CreateFleet
(
createFleet
, CreateFleet
, cfDomainJoinInfo
, cfDisconnectTimeoutInSeconds
, cfMaxUserDurationInSeconds
, cfFleetType
, cfVPCConfig
, cfDisplayName
, cfEnableDefaultInternetAccess
, cfDescription
, cfName
, cfImageName
, cfInstanceType
, cfComputeCapacity
, createFleetResponse
, CreateFleetResponse
, cfrsFleet
, cfrsResponseStatus
) 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 CreateFleet = CreateFleet'
{ _cfDomainJoinInfo :: !(Maybe DomainJoinInfo)
, _cfDisconnectTimeoutInSeconds :: !(Maybe Int)
, _cfMaxUserDurationInSeconds :: !(Maybe Int)
, _cfFleetType :: !(Maybe FleetType)
, _cfVPCConfig :: !(Maybe VPCConfig)
, _cfDisplayName :: !(Maybe Text)
, _cfEnableDefaultInternetAccess :: !(Maybe Bool)
, _cfDescription :: !(Maybe Text)
, _cfName :: !Text
, _cfImageName :: !Text
, _cfInstanceType :: !Text
, _cfComputeCapacity :: !ComputeCapacity
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createFleet
:: Text
-> Text
-> Text
-> ComputeCapacity
-> CreateFleet
createFleet pName_ pImageName_ pInstanceType_ pComputeCapacity_ =
CreateFleet'
{ _cfDomainJoinInfo = Nothing
, _cfDisconnectTimeoutInSeconds = Nothing
, _cfMaxUserDurationInSeconds = Nothing
, _cfFleetType = Nothing
, _cfVPCConfig = Nothing
, _cfDisplayName = Nothing
, _cfEnableDefaultInternetAccess = Nothing
, _cfDescription = Nothing
, _cfName = pName_
, _cfImageName = pImageName_
, _cfInstanceType = pInstanceType_
, _cfComputeCapacity = pComputeCapacity_
}
cfDomainJoinInfo :: Lens' CreateFleet (Maybe DomainJoinInfo)
cfDomainJoinInfo = lens _cfDomainJoinInfo (\ s a -> s{_cfDomainJoinInfo = a})
cfDisconnectTimeoutInSeconds :: Lens' CreateFleet (Maybe Int)
cfDisconnectTimeoutInSeconds = lens _cfDisconnectTimeoutInSeconds (\ s a -> s{_cfDisconnectTimeoutInSeconds = a})
cfMaxUserDurationInSeconds :: Lens' CreateFleet (Maybe Int)
cfMaxUserDurationInSeconds = lens _cfMaxUserDurationInSeconds (\ s a -> s{_cfMaxUserDurationInSeconds = a})
cfFleetType :: Lens' CreateFleet (Maybe FleetType)
cfFleetType = lens _cfFleetType (\ s a -> s{_cfFleetType = a})
cfVPCConfig :: Lens' CreateFleet (Maybe VPCConfig)
cfVPCConfig = lens _cfVPCConfig (\ s a -> s{_cfVPCConfig = a})
cfDisplayName :: Lens' CreateFleet (Maybe Text)
cfDisplayName = lens _cfDisplayName (\ s a -> s{_cfDisplayName = a})
cfEnableDefaultInternetAccess :: Lens' CreateFleet (Maybe Bool)
cfEnableDefaultInternetAccess = lens _cfEnableDefaultInternetAccess (\ s a -> s{_cfEnableDefaultInternetAccess = a})
cfDescription :: Lens' CreateFleet (Maybe Text)
cfDescription = lens _cfDescription (\ s a -> s{_cfDescription = a})
cfName :: Lens' CreateFleet Text
cfName = lens _cfName (\ s a -> s{_cfName = a})
cfImageName :: Lens' CreateFleet Text
cfImageName = lens _cfImageName (\ s a -> s{_cfImageName = a})
cfInstanceType :: Lens' CreateFleet Text
cfInstanceType = lens _cfInstanceType (\ s a -> s{_cfInstanceType = a})
cfComputeCapacity :: Lens' CreateFleet ComputeCapacity
cfComputeCapacity = lens _cfComputeCapacity (\ s a -> s{_cfComputeCapacity = a})
instance AWSRequest CreateFleet where
type Rs CreateFleet = CreateFleetResponse
request = postJSON appStream
response
= receiveJSON
(\ s h x ->
CreateFleetResponse' <$>
(x .?> "Fleet") <*> (pure (fromEnum s)))
instance Hashable CreateFleet where
instance NFData CreateFleet where
instance ToHeaders CreateFleet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.CreateFleet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateFleet where
toJSON CreateFleet'{..}
= object
(catMaybes
[("DomainJoinInfo" .=) <$> _cfDomainJoinInfo,
("DisconnectTimeoutInSeconds" .=) <$>
_cfDisconnectTimeoutInSeconds,
("MaxUserDurationInSeconds" .=) <$>
_cfMaxUserDurationInSeconds,
("FleetType" .=) <$> _cfFleetType,
("VpcConfig" .=) <$> _cfVPCConfig,
("DisplayName" .=) <$> _cfDisplayName,
("EnableDefaultInternetAccess" .=) <$>
_cfEnableDefaultInternetAccess,
("Description" .=) <$> _cfDescription,
Just ("Name" .= _cfName),
Just ("ImageName" .= _cfImageName),
Just ("InstanceType" .= _cfInstanceType),
Just ("ComputeCapacity" .= _cfComputeCapacity)])
instance ToPath CreateFleet where
toPath = const "/"
instance ToQuery CreateFleet where
toQuery = const mempty
data CreateFleetResponse = CreateFleetResponse'
{ _cfrsFleet :: !(Maybe Fleet)
, _cfrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createFleetResponse
:: Int
-> CreateFleetResponse
createFleetResponse pResponseStatus_ =
CreateFleetResponse'
{_cfrsFleet = Nothing, _cfrsResponseStatus = pResponseStatus_}
cfrsFleet :: Lens' CreateFleetResponse (Maybe Fleet)
cfrsFleet = lens _cfrsFleet (\ s a -> s{_cfrsFleet = a})
cfrsResponseStatus :: Lens' CreateFleetResponse Int
cfrsResponseStatus = lens _cfrsResponseStatus (\ s a -> s{_cfrsResponseStatus = a})
instance NFData CreateFleetResponse where