{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.AppStream.Types.Product where
import Network.AWS.AppStream.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
data Application = Application'
{ _aEnabled :: !(Maybe Bool)
, _aLaunchPath :: !(Maybe Text)
, _aLaunchParameters :: !(Maybe Text)
, _aName :: !(Maybe Text)
, _aDisplayName :: !(Maybe Text)
, _aMetadata :: !(Maybe (Map Text Text))
, _aIconURL :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
application
:: Application
application =
Application'
{ _aEnabled = Nothing
, _aLaunchPath = Nothing
, _aLaunchParameters = Nothing
, _aName = Nothing
, _aDisplayName = Nothing
, _aMetadata = Nothing
, _aIconURL = Nothing
}
aEnabled :: Lens' Application (Maybe Bool)
aEnabled = lens _aEnabled (\ s a -> s{_aEnabled = a});
aLaunchPath :: Lens' Application (Maybe Text)
aLaunchPath = lens _aLaunchPath (\ s a -> s{_aLaunchPath = a});
aLaunchParameters :: Lens' Application (Maybe Text)
aLaunchParameters = lens _aLaunchParameters (\ s a -> s{_aLaunchParameters = a});
aName :: Lens' Application (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a});
aDisplayName :: Lens' Application (Maybe Text)
aDisplayName = lens _aDisplayName (\ s a -> s{_aDisplayName = a});
aMetadata :: Lens' Application (HashMap Text Text)
aMetadata = lens _aMetadata (\ s a -> s{_aMetadata = a}) . _Default . _Map;
aIconURL :: Lens' Application (Maybe Text)
aIconURL = lens _aIconURL (\ s a -> s{_aIconURL = a});
instance FromJSON Application where
parseJSON
= withObject "Application"
(\ x ->
Application' <$>
(x .:? "Enabled") <*> (x .:? "LaunchPath") <*>
(x .:? "LaunchParameters")
<*> (x .:? "Name")
<*> (x .:? "DisplayName")
<*> (x .:? "Metadata" .!= mempty)
<*> (x .:? "IconURL"))
instance Hashable Application
instance NFData Application
newtype ComputeCapacity = ComputeCapacity'
{ _ccDesiredInstances :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
computeCapacity
:: Int
-> ComputeCapacity
computeCapacity pDesiredInstances_ =
ComputeCapacity'
{ _ccDesiredInstances = pDesiredInstances_
}
ccDesiredInstances :: Lens' ComputeCapacity Int
ccDesiredInstances = lens _ccDesiredInstances (\ s a -> s{_ccDesiredInstances = a});
instance Hashable ComputeCapacity
instance NFData ComputeCapacity
instance ToJSON ComputeCapacity where
toJSON ComputeCapacity'{..}
= object
(catMaybes
[Just ("DesiredInstances" .= _ccDesiredInstances)])
data ComputeCapacityStatus = ComputeCapacityStatus'
{ _ccsInUse :: !(Maybe Int)
, _ccsRunning :: !(Maybe Int)
, _ccsAvailable :: !(Maybe Int)
, _ccsDesired :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
computeCapacityStatus
:: Int
-> ComputeCapacityStatus
computeCapacityStatus pDesired_ =
ComputeCapacityStatus'
{ _ccsInUse = Nothing
, _ccsRunning = Nothing
, _ccsAvailable = Nothing
, _ccsDesired = pDesired_
}
ccsInUse :: Lens' ComputeCapacityStatus (Maybe Int)
ccsInUse = lens _ccsInUse (\ s a -> s{_ccsInUse = a});
ccsRunning :: Lens' ComputeCapacityStatus (Maybe Int)
ccsRunning = lens _ccsRunning (\ s a -> s{_ccsRunning = a});
ccsAvailable :: Lens' ComputeCapacityStatus (Maybe Int)
ccsAvailable = lens _ccsAvailable (\ s a -> s{_ccsAvailable = a});
ccsDesired :: Lens' ComputeCapacityStatus Int
ccsDesired = lens _ccsDesired (\ s a -> s{_ccsDesired = a});
instance FromJSON ComputeCapacityStatus where
parseJSON
= withObject "ComputeCapacityStatus"
(\ x ->
ComputeCapacityStatus' <$>
(x .:? "InUse") <*> (x .:? "Running") <*>
(x .:? "Available")
<*> (x .: "Desired"))
instance Hashable ComputeCapacityStatus
instance NFData ComputeCapacityStatus
data Fleet = Fleet'
{ _fDisconnectTimeoutInSeconds :: !(Maybe Int)
, _fMaxUserDurationInSeconds :: !(Maybe Int)
, _fCreatedTime :: !(Maybe POSIX)
, _fVPCConfig :: !(Maybe VPCConfig)
, _fFleetErrors :: !(Maybe [FleetError])
, _fDisplayName :: !(Maybe Text)
, _fDescription :: !(Maybe Text)
, _fARN :: !Text
, _fName :: !Text
, _fImageName :: !Text
, _fInstanceType :: !Text
, _fComputeCapacityStatus :: !ComputeCapacityStatus
, _fState :: !FleetState
} deriving (Eq,Read,Show,Data,Typeable,Generic)
fleet
:: Text
-> Text
-> Text
-> Text
-> ComputeCapacityStatus
-> FleetState
-> Fleet
fleet pARN_ pName_ pImageName_ pInstanceType_ pComputeCapacityStatus_ pState_ =
Fleet'
{ _fDisconnectTimeoutInSeconds = Nothing
, _fMaxUserDurationInSeconds = Nothing
, _fCreatedTime = Nothing
, _fVPCConfig = Nothing
, _fFleetErrors = Nothing
, _fDisplayName = Nothing
, _fDescription = Nothing
, _fARN = pARN_
, _fName = pName_
, _fImageName = pImageName_
, _fInstanceType = pInstanceType_
, _fComputeCapacityStatus = pComputeCapacityStatus_
, _fState = pState_
}
fDisconnectTimeoutInSeconds :: Lens' Fleet (Maybe Int)
fDisconnectTimeoutInSeconds = lens _fDisconnectTimeoutInSeconds (\ s a -> s{_fDisconnectTimeoutInSeconds = a});
fMaxUserDurationInSeconds :: Lens' Fleet (Maybe Int)
fMaxUserDurationInSeconds = lens _fMaxUserDurationInSeconds (\ s a -> s{_fMaxUserDurationInSeconds = a});
fCreatedTime :: Lens' Fleet (Maybe UTCTime)
fCreatedTime = lens _fCreatedTime (\ s a -> s{_fCreatedTime = a}) . mapping _Time;
fVPCConfig :: Lens' Fleet (Maybe VPCConfig)
fVPCConfig = lens _fVPCConfig (\ s a -> s{_fVPCConfig = a});
fFleetErrors :: Lens' Fleet [FleetError]
fFleetErrors = lens _fFleetErrors (\ s a -> s{_fFleetErrors = a}) . _Default . _Coerce;
fDisplayName :: Lens' Fleet (Maybe Text)
fDisplayName = lens _fDisplayName (\ s a -> s{_fDisplayName = a});
fDescription :: Lens' Fleet (Maybe Text)
fDescription = lens _fDescription (\ s a -> s{_fDescription = a});
fARN :: Lens' Fleet Text
fARN = lens _fARN (\ s a -> s{_fARN = a});
fName :: Lens' Fleet Text
fName = lens _fName (\ s a -> s{_fName = a});
fImageName :: Lens' Fleet Text
fImageName = lens _fImageName (\ s a -> s{_fImageName = a});
fInstanceType :: Lens' Fleet Text
fInstanceType = lens _fInstanceType (\ s a -> s{_fInstanceType = a});
fComputeCapacityStatus :: Lens' Fleet ComputeCapacityStatus
fComputeCapacityStatus = lens _fComputeCapacityStatus (\ s a -> s{_fComputeCapacityStatus = a});
fState :: Lens' Fleet FleetState
fState = lens _fState (\ s a -> s{_fState = a});
instance FromJSON Fleet where
parseJSON
= withObject "Fleet"
(\ x ->
Fleet' <$>
(x .:? "DisconnectTimeoutInSeconds") <*>
(x .:? "MaxUserDurationInSeconds")
<*> (x .:? "CreatedTime")
<*> (x .:? "VpcConfig")
<*> (x .:? "FleetErrors" .!= mempty)
<*> (x .:? "DisplayName")
<*> (x .:? "Description")
<*> (x .: "Arn")
<*> (x .: "Name")
<*> (x .: "ImageName")
<*> (x .: "InstanceType")
<*> (x .: "ComputeCapacityStatus")
<*> (x .: "State"))
instance Hashable Fleet
instance NFData Fleet
data FleetError = FleetError'
{ _feErrorCode :: !(Maybe FleetErrorCode)
, _feErrorMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
fleetError
:: FleetError
fleetError =
FleetError'
{ _feErrorCode = Nothing
, _feErrorMessage = Nothing
}
feErrorCode :: Lens' FleetError (Maybe FleetErrorCode)
feErrorCode = lens _feErrorCode (\ s a -> s{_feErrorCode = a});
feErrorMessage :: Lens' FleetError (Maybe Text)
feErrorMessage = lens _feErrorMessage (\ s a -> s{_feErrorMessage = a});
instance FromJSON FleetError where
parseJSON
= withObject "FleetError"
(\ x ->
FleetError' <$>
(x .:? "ErrorCode") <*> (x .:? "ErrorMessage"))
instance Hashable FleetError
instance NFData FleetError
data Image = Image'
{ _iState :: !(Maybe ImageState)
, _iPlatform :: !(Maybe PlatformType)
, _iStateChangeReason :: !(Maybe ImageStateChangeReason)
, _iARN :: !(Maybe Text)
, _iCreatedTime :: !(Maybe POSIX)
, _iVisibility :: !(Maybe VisibilityType)
, _iBaseImageARN :: !(Maybe Text)
, _iDisplayName :: !(Maybe Text)
, _iDescription :: !(Maybe Text)
, _iApplications :: !(Maybe [Application])
, _iName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
image
:: Text
-> Image
image pName_ =
Image'
{ _iState = Nothing
, _iPlatform = Nothing
, _iStateChangeReason = Nothing
, _iARN = Nothing
, _iCreatedTime = Nothing
, _iVisibility = Nothing
, _iBaseImageARN = Nothing
, _iDisplayName = Nothing
, _iDescription = Nothing
, _iApplications = Nothing
, _iName = pName_
}
iState :: Lens' Image (Maybe ImageState)
iState = lens _iState (\ s a -> s{_iState = a});
iPlatform :: Lens' Image (Maybe PlatformType)
iPlatform = lens _iPlatform (\ s a -> s{_iPlatform = a});
iStateChangeReason :: Lens' Image (Maybe ImageStateChangeReason)
iStateChangeReason = lens _iStateChangeReason (\ s a -> s{_iStateChangeReason = a});
iARN :: Lens' Image (Maybe Text)
iARN = lens _iARN (\ s a -> s{_iARN = a});
iCreatedTime :: Lens' Image (Maybe UTCTime)
iCreatedTime = lens _iCreatedTime (\ s a -> s{_iCreatedTime = a}) . mapping _Time;
iVisibility :: Lens' Image (Maybe VisibilityType)
iVisibility = lens _iVisibility (\ s a -> s{_iVisibility = a});
iBaseImageARN :: Lens' Image (Maybe Text)
iBaseImageARN = lens _iBaseImageARN (\ s a -> s{_iBaseImageARN = a});
iDisplayName :: Lens' Image (Maybe Text)
iDisplayName = lens _iDisplayName (\ s a -> s{_iDisplayName = a});
iDescription :: Lens' Image (Maybe Text)
iDescription = lens _iDescription (\ s a -> s{_iDescription = a});
iApplications :: Lens' Image [Application]
iApplications = lens _iApplications (\ s a -> s{_iApplications = a}) . _Default . _Coerce;
iName :: Lens' Image Text
iName = lens _iName (\ s a -> s{_iName = a});
instance FromJSON Image where
parseJSON
= withObject "Image"
(\ x ->
Image' <$>
(x .:? "State") <*> (x .:? "Platform") <*>
(x .:? "StateChangeReason")
<*> (x .:? "Arn")
<*> (x .:? "CreatedTime")
<*> (x .:? "Visibility")
<*> (x .:? "BaseImageArn")
<*> (x .:? "DisplayName")
<*> (x .:? "Description")
<*> (x .:? "Applications" .!= mempty)
<*> (x .: "Name"))
instance Hashable Image
instance NFData Image
data ImageStateChangeReason = ImageStateChangeReason'
{ _iscrCode :: !(Maybe ImageStateChangeReasonCode)
, _iscrMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
imageStateChangeReason
:: ImageStateChangeReason
imageStateChangeReason =
ImageStateChangeReason'
{ _iscrCode = Nothing
, _iscrMessage = Nothing
}
iscrCode :: Lens' ImageStateChangeReason (Maybe ImageStateChangeReasonCode)
iscrCode = lens _iscrCode (\ s a -> s{_iscrCode = a});
iscrMessage :: Lens' ImageStateChangeReason (Maybe Text)
iscrMessage = lens _iscrMessage (\ s a -> s{_iscrMessage = a});
instance FromJSON ImageStateChangeReason where
parseJSON
= withObject "ImageStateChangeReason"
(\ x ->
ImageStateChangeReason' <$>
(x .:? "Code") <*> (x .:? "Message"))
instance Hashable ImageStateChangeReason
instance NFData ImageStateChangeReason
data Session = Session'
{ _sId :: !Text
, _sUserId :: !Text
, _sStackName :: !Text
, _sFleetName :: !Text
, _sState :: !SessionState
} deriving (Eq,Read,Show,Data,Typeable,Generic)
session
:: Text
-> Text
-> Text
-> Text
-> SessionState
-> Session
session pId_ pUserId_ pStackName_ pFleetName_ pState_ =
Session'
{ _sId = pId_
, _sUserId = pUserId_
, _sStackName = pStackName_
, _sFleetName = pFleetName_
, _sState = pState_
}
sId :: Lens' Session Text
sId = lens _sId (\ s a -> s{_sId = a});
sUserId :: Lens' Session Text
sUserId = lens _sUserId (\ s a -> s{_sUserId = a});
sStackName :: Lens' Session Text
sStackName = lens _sStackName (\ s a -> s{_sStackName = a});
sFleetName :: Lens' Session Text
sFleetName = lens _sFleetName (\ s a -> s{_sFleetName = a});
sState :: Lens' Session SessionState
sState = lens _sState (\ s a -> s{_sState = a});
instance FromJSON Session where
parseJSON
= withObject "Session"
(\ x ->
Session' <$>
(x .: "Id") <*> (x .: "UserId") <*>
(x .: "StackName")
<*> (x .: "FleetName")
<*> (x .: "State"))
instance Hashable Session
instance NFData Session
data Stack = Stack'
{ _sARN :: !(Maybe Text)
, _sCreatedTime :: !(Maybe POSIX)
, _sDisplayName :: !(Maybe Text)
, _sDescription :: !(Maybe Text)
, _sName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stack
:: Text
-> Stack
stack pName_ =
Stack'
{ _sARN = Nothing
, _sCreatedTime = Nothing
, _sDisplayName = Nothing
, _sDescription = Nothing
, _sName = pName_
}
sARN :: Lens' Stack (Maybe Text)
sARN = lens _sARN (\ s a -> s{_sARN = a});
sCreatedTime :: Lens' Stack (Maybe UTCTime)
sCreatedTime = lens _sCreatedTime (\ s a -> s{_sCreatedTime = a}) . mapping _Time;
sDisplayName :: Lens' Stack (Maybe Text)
sDisplayName = lens _sDisplayName (\ s a -> s{_sDisplayName = a});
sDescription :: Lens' Stack (Maybe Text)
sDescription = lens _sDescription (\ s a -> s{_sDescription = a});
sName :: Lens' Stack Text
sName = lens _sName (\ s a -> s{_sName = a});
instance FromJSON Stack where
parseJSON
= withObject "Stack"
(\ x ->
Stack' <$>
(x .:? "Arn") <*> (x .:? "CreatedTime") <*>
(x .:? "DisplayName")
<*> (x .:? "Description")
<*> (x .: "Name"))
instance Hashable Stack
instance NFData Stack
newtype VPCConfig = VPCConfig'
{ _vcSubnetIds :: List1 Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
vpcConfig
:: NonEmpty Text
-> VPCConfig
vpcConfig pSubnetIds_ =
VPCConfig'
{ _vcSubnetIds = _List1 # pSubnetIds_
}
vcSubnetIds :: Lens' VPCConfig (NonEmpty Text)
vcSubnetIds = lens _vcSubnetIds (\ s a -> s{_vcSubnetIds = a}) . _List1;
instance FromJSON VPCConfig where
parseJSON
= withObject "VPCConfig"
(\ x -> VPCConfig' <$> (x .: "SubnetIds"))
instance Hashable VPCConfig
instance NFData VPCConfig
instance ToJSON VPCConfig where
toJSON VPCConfig'{..}
= object
(catMaybes [Just ("SubnetIds" .= _vcSubnetIds)])