{-# 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 where
instance NFData Application where
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 where
instance NFData ComputeCapacity where
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 where
instance NFData ComputeCapacityStatus where
data DirectoryConfig = DirectoryConfig'
{ _dcCreatedTime :: !(Maybe POSIX)
, _dcServiceAccountCredentials :: !(Maybe ServiceAccountCredentials)
, _dcOrganizationalUnitDistinguishedNames :: !(Maybe [Text])
, _dcDirectoryName :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
directoryConfig
:: Text
-> DirectoryConfig
directoryConfig pDirectoryName_ =
DirectoryConfig'
{ _dcCreatedTime = Nothing
, _dcServiceAccountCredentials = Nothing
, _dcOrganizationalUnitDistinguishedNames = Nothing
, _dcDirectoryName = pDirectoryName_
}
dcCreatedTime :: Lens' DirectoryConfig (Maybe UTCTime)
dcCreatedTime = lens _dcCreatedTime (\ s a -> s{_dcCreatedTime = a}) . mapping _Time
dcServiceAccountCredentials :: Lens' DirectoryConfig (Maybe ServiceAccountCredentials)
dcServiceAccountCredentials = lens _dcServiceAccountCredentials (\ s a -> s{_dcServiceAccountCredentials = a})
dcOrganizationalUnitDistinguishedNames :: Lens' DirectoryConfig [Text]
dcOrganizationalUnitDistinguishedNames = lens _dcOrganizationalUnitDistinguishedNames (\ s a -> s{_dcOrganizationalUnitDistinguishedNames = a}) . _Default . _Coerce
dcDirectoryName :: Lens' DirectoryConfig Text
dcDirectoryName = lens _dcDirectoryName (\ s a -> s{_dcDirectoryName = a})
instance FromJSON DirectoryConfig where
parseJSON
= withObject "DirectoryConfig"
(\ x ->
DirectoryConfig' <$>
(x .:? "CreatedTime") <*>
(x .:? "ServiceAccountCredentials")
<*>
(x .:? "OrganizationalUnitDistinguishedNames" .!=
mempty)
<*> (x .: "DirectoryName"))
instance Hashable DirectoryConfig where
instance NFData DirectoryConfig where
data DomainJoinInfo = DomainJoinInfo'
{ _djiOrganizationalUnitDistinguishedName :: !(Maybe Text)
, _djiDirectoryName :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
domainJoinInfo
:: DomainJoinInfo
domainJoinInfo =
DomainJoinInfo'
{ _djiOrganizationalUnitDistinguishedName = Nothing
, _djiDirectoryName = Nothing
}
djiOrganizationalUnitDistinguishedName :: Lens' DomainJoinInfo (Maybe Text)
djiOrganizationalUnitDistinguishedName = lens _djiOrganizationalUnitDistinguishedName (\ s a -> s{_djiOrganizationalUnitDistinguishedName = a})
djiDirectoryName :: Lens' DomainJoinInfo (Maybe Text)
djiDirectoryName = lens _djiDirectoryName (\ s a -> s{_djiDirectoryName = a})
instance FromJSON DomainJoinInfo where
parseJSON
= withObject "DomainJoinInfo"
(\ x ->
DomainJoinInfo' <$>
(x .:? "OrganizationalUnitDistinguishedName") <*>
(x .:? "DirectoryName"))
instance Hashable DomainJoinInfo where
instance NFData DomainJoinInfo where
instance ToJSON DomainJoinInfo where
toJSON DomainJoinInfo'{..}
= object
(catMaybes
[("OrganizationalUnitDistinguishedName" .=) <$>
_djiOrganizationalUnitDistinguishedName,
("DirectoryName" .=) <$> _djiDirectoryName])
data Fleet = Fleet'
{ _fDomainJoinInfo :: !(Maybe DomainJoinInfo)
, _fDisconnectTimeoutInSeconds :: !(Maybe Int)
, _fMaxUserDurationInSeconds :: !(Maybe Int)
, _fCreatedTime :: !(Maybe POSIX)
, _fFleetType :: !(Maybe FleetType)
, _fVPCConfig :: !(Maybe VPCConfig)
, _fFleetErrors :: !(Maybe [FleetError])
, _fDisplayName :: !(Maybe Text)
, _fEnableDefaultInternetAccess :: !(Maybe Bool)
, _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'
{ _fDomainJoinInfo = Nothing
, _fDisconnectTimeoutInSeconds = Nothing
, _fMaxUserDurationInSeconds = Nothing
, _fCreatedTime = Nothing
, _fFleetType = Nothing
, _fVPCConfig = Nothing
, _fFleetErrors = Nothing
, _fDisplayName = Nothing
, _fEnableDefaultInternetAccess = Nothing
, _fDescription = Nothing
, _fARN = pARN_
, _fName = pName_
, _fImageName = pImageName_
, _fInstanceType = pInstanceType_
, _fComputeCapacityStatus = pComputeCapacityStatus_
, _fState = pState_
}
fDomainJoinInfo :: Lens' Fleet (Maybe DomainJoinInfo)
fDomainJoinInfo = lens _fDomainJoinInfo (\ s a -> s{_fDomainJoinInfo = a})
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
fFleetType :: Lens' Fleet (Maybe FleetType)
fFleetType = lens _fFleetType (\ s a -> s{_fFleetType = a})
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})
fEnableDefaultInternetAccess :: Lens' Fleet (Maybe Bool)
fEnableDefaultInternetAccess = lens _fEnableDefaultInternetAccess (\ s a -> s{_fEnableDefaultInternetAccess = 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 .:? "DomainJoinInfo") <*>
(x .:? "DisconnectTimeoutInSeconds")
<*> (x .:? "MaxUserDurationInSeconds")
<*> (x .:? "CreatedTime")
<*> (x .:? "FleetType")
<*> (x .:? "VpcConfig")
<*> (x .:? "FleetErrors" .!= mempty)
<*> (x .:? "DisplayName")
<*> (x .:? "EnableDefaultInternetAccess")
<*> (x .:? "Description")
<*> (x .: "Arn")
<*> (x .: "Name")
<*> (x .: "ImageName")
<*> (x .: "InstanceType")
<*> (x .: "ComputeCapacityStatus")
<*> (x .: "State"))
instance Hashable Fleet where
instance NFData Fleet where
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 where
instance NFData FleetError where
data Image = Image'
{ _iState :: !(Maybe ImageState)
, _iPlatform :: !(Maybe PlatformType)
, _iPublicBaseImageReleasedDate :: !(Maybe POSIX)
, _iStateChangeReason :: !(Maybe ImageStateChangeReason)
, _iARN :: !(Maybe Text)
, _iCreatedTime :: !(Maybe POSIX)
, _iImageBuilderSupported :: !(Maybe Bool)
, _iVisibility :: !(Maybe VisibilityType)
, _iBaseImageARN :: !(Maybe Text)
, _iDisplayName :: !(Maybe Text)
, _iDescription :: !(Maybe Text)
, _iAppstreamAgentVersion :: !(Maybe Text)
, _iApplications :: !(Maybe [Application])
, _iName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
image
:: Text
-> Image
image pName_ =
Image'
{ _iState = Nothing
, _iPlatform = Nothing
, _iPublicBaseImageReleasedDate = Nothing
, _iStateChangeReason = Nothing
, _iARN = Nothing
, _iCreatedTime = Nothing
, _iImageBuilderSupported = Nothing
, _iVisibility = Nothing
, _iBaseImageARN = Nothing
, _iDisplayName = Nothing
, _iDescription = Nothing
, _iAppstreamAgentVersion = 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})
iPublicBaseImageReleasedDate :: Lens' Image (Maybe UTCTime)
iPublicBaseImageReleasedDate = lens _iPublicBaseImageReleasedDate (\ s a -> s{_iPublicBaseImageReleasedDate = a}) . mapping _Time
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
iImageBuilderSupported :: Lens' Image (Maybe Bool)
iImageBuilderSupported = lens _iImageBuilderSupported (\ s a -> s{_iImageBuilderSupported = a})
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})
iAppstreamAgentVersion :: Lens' Image (Maybe Text)
iAppstreamAgentVersion = lens _iAppstreamAgentVersion (\ s a -> s{_iAppstreamAgentVersion = 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 .:? "PublicBaseImageReleasedDate")
<*> (x .:? "StateChangeReason")
<*> (x .:? "Arn")
<*> (x .:? "CreatedTime")
<*> (x .:? "ImageBuilderSupported")
<*> (x .:? "Visibility")
<*> (x .:? "BaseImageArn")
<*> (x .:? "DisplayName")
<*> (x .:? "Description")
<*> (x .:? "AppstreamAgentVersion")
<*> (x .:? "Applications" .!= mempty)
<*> (x .: "Name"))
instance Hashable Image where
instance NFData Image where
data ImageBuilder = ImageBuilder'
{ _ibDomainJoinInfo :: !(Maybe DomainJoinInfo)
, _ibState :: !(Maybe ImageBuilderState)
, _ibPlatform :: !(Maybe PlatformType)
, _ibStateChangeReason :: !(Maybe ImageBuilderStateChangeReason)
, _ibARN :: !(Maybe Text)
, _ibCreatedTime :: !(Maybe POSIX)
, _ibImageBuilderErrors :: !(Maybe [ResourceError])
, _ibInstanceType :: !(Maybe Text)
, _ibVPCConfig :: !(Maybe VPCConfig)
, _ibImageARN :: !(Maybe Text)
, _ibDisplayName :: !(Maybe Text)
, _ibEnableDefaultInternetAccess :: !(Maybe Bool)
, _ibDescription :: !(Maybe Text)
, _ibAppstreamAgentVersion :: !(Maybe Text)
, _ibName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
imageBuilder
:: Text
-> ImageBuilder
imageBuilder pName_ =
ImageBuilder'
{ _ibDomainJoinInfo = Nothing
, _ibState = Nothing
, _ibPlatform = Nothing
, _ibStateChangeReason = Nothing
, _ibARN = Nothing
, _ibCreatedTime = Nothing
, _ibImageBuilderErrors = Nothing
, _ibInstanceType = Nothing
, _ibVPCConfig = Nothing
, _ibImageARN = Nothing
, _ibDisplayName = Nothing
, _ibEnableDefaultInternetAccess = Nothing
, _ibDescription = Nothing
, _ibAppstreamAgentVersion = Nothing
, _ibName = pName_
}
ibDomainJoinInfo :: Lens' ImageBuilder (Maybe DomainJoinInfo)
ibDomainJoinInfo = lens _ibDomainJoinInfo (\ s a -> s{_ibDomainJoinInfo = a})
ibState :: Lens' ImageBuilder (Maybe ImageBuilderState)
ibState = lens _ibState (\ s a -> s{_ibState = a})
ibPlatform :: Lens' ImageBuilder (Maybe PlatformType)
ibPlatform = lens _ibPlatform (\ s a -> s{_ibPlatform = a})
ibStateChangeReason :: Lens' ImageBuilder (Maybe ImageBuilderStateChangeReason)
ibStateChangeReason = lens _ibStateChangeReason (\ s a -> s{_ibStateChangeReason = a})
ibARN :: Lens' ImageBuilder (Maybe Text)
ibARN = lens _ibARN (\ s a -> s{_ibARN = a})
ibCreatedTime :: Lens' ImageBuilder (Maybe UTCTime)
ibCreatedTime = lens _ibCreatedTime (\ s a -> s{_ibCreatedTime = a}) . mapping _Time
ibImageBuilderErrors :: Lens' ImageBuilder [ResourceError]
ibImageBuilderErrors = lens _ibImageBuilderErrors (\ s a -> s{_ibImageBuilderErrors = a}) . _Default . _Coerce
ibInstanceType :: Lens' ImageBuilder (Maybe Text)
ibInstanceType = lens _ibInstanceType (\ s a -> s{_ibInstanceType = a})
ibVPCConfig :: Lens' ImageBuilder (Maybe VPCConfig)
ibVPCConfig = lens _ibVPCConfig (\ s a -> s{_ibVPCConfig = a})
ibImageARN :: Lens' ImageBuilder (Maybe Text)
ibImageARN = lens _ibImageARN (\ s a -> s{_ibImageARN = a})
ibDisplayName :: Lens' ImageBuilder (Maybe Text)
ibDisplayName = lens _ibDisplayName (\ s a -> s{_ibDisplayName = a})
ibEnableDefaultInternetAccess :: Lens' ImageBuilder (Maybe Bool)
ibEnableDefaultInternetAccess = lens _ibEnableDefaultInternetAccess (\ s a -> s{_ibEnableDefaultInternetAccess = a})
ibDescription :: Lens' ImageBuilder (Maybe Text)
ibDescription = lens _ibDescription (\ s a -> s{_ibDescription = a})
ibAppstreamAgentVersion :: Lens' ImageBuilder (Maybe Text)
ibAppstreamAgentVersion = lens _ibAppstreamAgentVersion (\ s a -> s{_ibAppstreamAgentVersion = a})
ibName :: Lens' ImageBuilder Text
ibName = lens _ibName (\ s a -> s{_ibName = a})
instance FromJSON ImageBuilder where
parseJSON
= withObject "ImageBuilder"
(\ x ->
ImageBuilder' <$>
(x .:? "DomainJoinInfo") <*> (x .:? "State") <*>
(x .:? "Platform")
<*> (x .:? "StateChangeReason")
<*> (x .:? "Arn")
<*> (x .:? "CreatedTime")
<*> (x .:? "ImageBuilderErrors" .!= mempty)
<*> (x .:? "InstanceType")
<*> (x .:? "VpcConfig")
<*> (x .:? "ImageArn")
<*> (x .:? "DisplayName")
<*> (x .:? "EnableDefaultInternetAccess")
<*> (x .:? "Description")
<*> (x .:? "AppstreamAgentVersion")
<*> (x .: "Name"))
instance Hashable ImageBuilder where
instance NFData ImageBuilder where
data ImageBuilderStateChangeReason = ImageBuilderStateChangeReason'
{ _ibscrCode :: !(Maybe ImageBuilderStateChangeReasonCode)
, _ibscrMessage :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
imageBuilderStateChangeReason
:: ImageBuilderStateChangeReason
imageBuilderStateChangeReason =
ImageBuilderStateChangeReason' {_ibscrCode = Nothing, _ibscrMessage = Nothing}
ibscrCode :: Lens' ImageBuilderStateChangeReason (Maybe ImageBuilderStateChangeReasonCode)
ibscrCode = lens _ibscrCode (\ s a -> s{_ibscrCode = a})
ibscrMessage :: Lens' ImageBuilderStateChangeReason (Maybe Text)
ibscrMessage = lens _ibscrMessage (\ s a -> s{_ibscrMessage = a})
instance FromJSON ImageBuilderStateChangeReason where
parseJSON
= withObject "ImageBuilderStateChangeReason"
(\ x ->
ImageBuilderStateChangeReason' <$>
(x .:? "Code") <*> (x .:? "Message"))
instance Hashable ImageBuilderStateChangeReason where
instance NFData ImageBuilderStateChangeReason where
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 where
instance NFData ImageStateChangeReason where
data ResourceError = ResourceError'
{ _reErrorCode :: !(Maybe FleetErrorCode)
, _reErrorMessage :: !(Maybe Text)
, _reErrorTimestamp :: !(Maybe POSIX)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resourceError
:: ResourceError
resourceError =
ResourceError'
{ _reErrorCode = Nothing
, _reErrorMessage = Nothing
, _reErrorTimestamp = Nothing
}
reErrorCode :: Lens' ResourceError (Maybe FleetErrorCode)
reErrorCode = lens _reErrorCode (\ s a -> s{_reErrorCode = a})
reErrorMessage :: Lens' ResourceError (Maybe Text)
reErrorMessage = lens _reErrorMessage (\ s a -> s{_reErrorMessage = a})
reErrorTimestamp :: Lens' ResourceError (Maybe UTCTime)
reErrorTimestamp = lens _reErrorTimestamp (\ s a -> s{_reErrorTimestamp = a}) . mapping _Time
instance FromJSON ResourceError where
parseJSON
= withObject "ResourceError"
(\ x ->
ResourceError' <$>
(x .:? "ErrorCode") <*> (x .:? "ErrorMessage") <*>
(x .:? "ErrorTimestamp"))
instance Hashable ResourceError where
instance NFData ResourceError where
data ServiceAccountCredentials = ServiceAccountCredentials'
{ _sacAccountName :: !(Sensitive Text)
, _sacAccountPassword :: !(Sensitive Text)
} deriving (Eq, Show, Data, Typeable, Generic)
serviceAccountCredentials
:: Text
-> Text
-> ServiceAccountCredentials
serviceAccountCredentials pAccountName_ pAccountPassword_ =
ServiceAccountCredentials'
{ _sacAccountName = _Sensitive # pAccountName_
, _sacAccountPassword = _Sensitive # pAccountPassword_
}
sacAccountName :: Lens' ServiceAccountCredentials Text
sacAccountName = lens _sacAccountName (\ s a -> s{_sacAccountName = a}) . _Sensitive
sacAccountPassword :: Lens' ServiceAccountCredentials Text
sacAccountPassword = lens _sacAccountPassword (\ s a -> s{_sacAccountPassword = a}) . _Sensitive
instance FromJSON ServiceAccountCredentials where
parseJSON
= withObject "ServiceAccountCredentials"
(\ x ->
ServiceAccountCredentials' <$>
(x .: "AccountName") <*> (x .: "AccountPassword"))
instance Hashable ServiceAccountCredentials where
instance NFData ServiceAccountCredentials where
instance ToJSON ServiceAccountCredentials where
toJSON ServiceAccountCredentials'{..}
= object
(catMaybes
[Just ("AccountName" .= _sacAccountName),
Just ("AccountPassword" .= _sacAccountPassword)])
data Session = Session'
{ _sAuthenticationType :: !(Maybe AuthenticationType)
, _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'
{ _sAuthenticationType = Nothing
, _sId = pId_
, _sUserId = pUserId_
, _sStackName = pStackName_
, _sFleetName = pFleetName_
, _sState = pState_
}
sAuthenticationType :: Lens' Session (Maybe AuthenticationType)
sAuthenticationType = lens _sAuthenticationType (\ s a -> s{_sAuthenticationType = a})
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 .:? "AuthenticationType") <*> (x .: "Id") <*>
(x .: "UserId")
<*> (x .: "StackName")
<*> (x .: "FleetName")
<*> (x .: "State"))
instance Hashable Session where
instance NFData Session where
data Stack = Stack'
{ _sFeedbackURL :: !(Maybe Text)
, _sARN :: !(Maybe Text)
, _sCreatedTime :: !(Maybe POSIX)
, _sStorageConnectors :: !(Maybe [StorageConnector])
, _sDisplayName :: !(Maybe Text)
, _sStackErrors :: !(Maybe [StackError])
, _sDescription :: !(Maybe Text)
, _sRedirectURL :: !(Maybe Text)
, _sName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stack
:: Text
-> Stack
stack pName_ =
Stack'
{ _sFeedbackURL = Nothing
, _sARN = Nothing
, _sCreatedTime = Nothing
, _sStorageConnectors = Nothing
, _sDisplayName = Nothing
, _sStackErrors = Nothing
, _sDescription = Nothing
, _sRedirectURL = Nothing
, _sName = pName_
}
sFeedbackURL :: Lens' Stack (Maybe Text)
sFeedbackURL = lens _sFeedbackURL (\ s a -> s{_sFeedbackURL = a})
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
sStorageConnectors :: Lens' Stack [StorageConnector]
sStorageConnectors = lens _sStorageConnectors (\ s a -> s{_sStorageConnectors = a}) . _Default . _Coerce
sDisplayName :: Lens' Stack (Maybe Text)
sDisplayName = lens _sDisplayName (\ s a -> s{_sDisplayName = a})
sStackErrors :: Lens' Stack [StackError]
sStackErrors = lens _sStackErrors (\ s a -> s{_sStackErrors = a}) . _Default . _Coerce
sDescription :: Lens' Stack (Maybe Text)
sDescription = lens _sDescription (\ s a -> s{_sDescription = a})
sRedirectURL :: Lens' Stack (Maybe Text)
sRedirectURL = lens _sRedirectURL (\ s a -> s{_sRedirectURL = a})
sName :: Lens' Stack Text
sName = lens _sName (\ s a -> s{_sName = a})
instance FromJSON Stack where
parseJSON
= withObject "Stack"
(\ x ->
Stack' <$>
(x .:? "FeedbackURL") <*> (x .:? "Arn") <*>
(x .:? "CreatedTime")
<*> (x .:? "StorageConnectors" .!= mempty)
<*> (x .:? "DisplayName")
<*> (x .:? "StackErrors" .!= mempty)
<*> (x .:? "Description")
<*> (x .:? "RedirectURL")
<*> (x .: "Name"))
instance Hashable Stack where
instance NFData Stack where
data StackError = StackError'
{ _seErrorCode :: !(Maybe StackErrorCode)
, _seErrorMessage :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stackError
:: StackError
stackError = StackError' {_seErrorCode = Nothing, _seErrorMessage = Nothing}
seErrorCode :: Lens' StackError (Maybe StackErrorCode)
seErrorCode = lens _seErrorCode (\ s a -> s{_seErrorCode = a})
seErrorMessage :: Lens' StackError (Maybe Text)
seErrorMessage = lens _seErrorMessage (\ s a -> s{_seErrorMessage = a})
instance FromJSON StackError where
parseJSON
= withObject "StackError"
(\ x ->
StackError' <$>
(x .:? "ErrorCode") <*> (x .:? "ErrorMessage"))
instance Hashable StackError where
instance NFData StackError where
data StorageConnector = StorageConnector'
{ _scResourceIdentifier :: !(Maybe Text)
, _scConnectorType :: !StorageConnectorType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
storageConnector
:: StorageConnectorType
-> StorageConnector
storageConnector pConnectorType_ =
StorageConnector'
{_scResourceIdentifier = Nothing, _scConnectorType = pConnectorType_}
scResourceIdentifier :: Lens' StorageConnector (Maybe Text)
scResourceIdentifier = lens _scResourceIdentifier (\ s a -> s{_scResourceIdentifier = a})
scConnectorType :: Lens' StorageConnector StorageConnectorType
scConnectorType = lens _scConnectorType (\ s a -> s{_scConnectorType = a})
instance FromJSON StorageConnector where
parseJSON
= withObject "StorageConnector"
(\ x ->
StorageConnector' <$>
(x .:? "ResourceIdentifier") <*>
(x .: "ConnectorType"))
instance Hashable StorageConnector where
instance NFData StorageConnector where
instance ToJSON StorageConnector where
toJSON StorageConnector'{..}
= object
(catMaybes
[("ResourceIdentifier" .=) <$> _scResourceIdentifier,
Just ("ConnectorType" .= _scConnectorType)])
data VPCConfig = VPCConfig'
{ _vcSecurityGroupIds :: !(Maybe [Text])
, _vcSubnetIds :: !(Maybe [Text])
} deriving (Eq, Read, Show, Data, Typeable, Generic)
vpcConfig
:: VPCConfig
vpcConfig = VPCConfig' {_vcSecurityGroupIds = Nothing, _vcSubnetIds = Nothing}
vcSecurityGroupIds :: Lens' VPCConfig [Text]
vcSecurityGroupIds = lens _vcSecurityGroupIds (\ s a -> s{_vcSecurityGroupIds = a}) . _Default . _Coerce
vcSubnetIds :: Lens' VPCConfig [Text]
vcSubnetIds = lens _vcSubnetIds (\ s a -> s{_vcSubnetIds = a}) . _Default . _Coerce
instance FromJSON VPCConfig where
parseJSON
= withObject "VPCConfig"
(\ x ->
VPCConfig' <$>
(x .:? "SecurityGroupIds" .!= mempty) <*>
(x .:? "SubnetIds" .!= mempty))
instance Hashable VPCConfig where
instance NFData VPCConfig where
instance ToJSON VPCConfig where
toJSON VPCConfig'{..}
= object
(catMaybes
[("SecurityGroupIds" .=) <$> _vcSecurityGroupIds,
("SubnetIds" .=) <$> _vcSubnetIds])