module Network.AWS.OpsWorks.Types
(
OpsWorks
, JSONError
, SslConfiguration
, sslConfiguration
, scCertificate
, scChain
, scPrivateKey
, VirtualizationType (..)
, Command
, command
, cAcknowledgedAt
, cCommandId
, cCompletedAt
, cCreatedAt
, cDeploymentId
, cExitCode
, cInstanceId
, cLogUrl
, cStatus
, cType
, RaidArray
, raidArray
, raAvailabilityZone
, raCreatedAt
, raDevice
, raInstanceId
, raIops
, raMountPoint
, raName
, raNumberOfDisks
, raRaidArrayId
, raRaidLevel
, raSize
, raStackId
, raVolumeType
, ElasticLoadBalancer
, elasticLoadBalancer
, elbAvailabilityZones
, elbDnsName
, elbEc2InstanceIds
, elbElasticLoadBalancerName
, elbLayerId
, elbRegion
, elbStackId
, elbSubnetIds
, elbVpcId
, LifecycleEventConfiguration
, lifecycleEventConfiguration
, lecShutdown
, RdsDbInstance
, rdsDbInstance
, rdiAddress
, rdiDbInstanceIdentifier
, rdiDbPassword
, rdiDbUser
, rdiEngine
, rdiMissingOnRds
, rdiRdsDbInstanceArn
, rdiRegion
, rdiStackId
, AppAttributesKeys (..)
, ServiceError'
, serviceError'
, seCreatedAt
, seInstanceId
, seMessage
, seServiceErrorId
, seStackId
, seType
, StackSummary
, stackSummary
, ssAppsCount
, ssArn
, ssInstancesCount
, ssLayersCount
, ssName
, ssStackId
, BlockDeviceMapping
, blockDeviceMapping
, bdmDeviceName
, bdmEbs
, bdmNoDevice
, bdmVirtualName
, StackAttributesKeys (..)
, LoadBasedAutoScalingConfiguration
, loadBasedAutoScalingConfiguration
, lbascDownScaling
, lbascEnable
, lbascLayerId
, lbascUpScaling
, SourceType (..)
, Volume
, volume
, vAvailabilityZone
, vDevice
, vEc2VolumeId
, vInstanceId
, vIops
, vMountPoint
, vName
, vRaidArrayId
, vRegion
, vSize
, vStatus
, vVolumeId
, vVolumeType
, ChefConfiguration
, chefConfiguration
, ccBerkshelfVersion
, ccManageBerkshelf
, LayerType (..)
, AutoScalingThresholds
, autoScalingThresholds
, astAlarms
, astCpuThreshold
, astIgnoreMetricsTime
, astInstanceCount
, astLoadThreshold
, astMemoryThreshold
, astThresholdsWaitTime
, App
, app
, appAppId
, appAppSource
, appAttributes
, appCreatedAt
, appDataSources
, appDescription
, appDomains
, appEnableSsl
, appEnvironment
, appName
, appShortname
, appSslConfiguration
, appStackId
, appType
, ElasticIp
, elasticIp
, eiDomain
, eiInstanceId
, eiIp
, eiName
, eiRegion
, ShutdownEventConfiguration
, shutdownEventConfiguration
, secDelayUntilElbConnectionsDrained
, secExecutionTimeout
, InstanceIdentity
, instanceIdentity
, iiDocument
, iiSignature
, UserProfile
, userProfile
, upAllowSelfManagement
, upIamUserArn
, upName
, upSshPublicKey
, upSshUsername
, AutoScalingType (..)
, Source
, source
, sPassword
, sRevision
, sSshKey
, sType
, sUrl
, sUsername
, DataSource
, dataSource
, dsArn
, dsDatabaseName
, dsType
, Architecture (..)
, StackConfigurationManager
, stackConfigurationManager
, scmName
, scmVersion
, EbsBlockDevice
, ebsBlockDevice
, ebdDeleteOnTermination
, ebdIops
, ebdSnapshotId
, ebdVolumeSize
, ebdVolumeType
, LayerAttributesKeys (..)
, TemporaryCredential
, temporaryCredential
, tcInstanceId
, tcPassword
, tcUsername
, tcValidForInMinutes
, VolumeConfiguration
, volumeConfiguration
, vcIops
, vcMountPoint
, vcNumberOfDisks
, vcRaidLevel
, vcSize
, vcVolumeType
, VolumeType (..)
, ReportedOs
, reportedOs
, roFamily
, roName
, roVersion
, Permission
, permission
, pAllowSsh
, pAllowSudo
, pIamUserArn
, pLevel
, pStackId
, EnvironmentVariable
, environmentVariable
, evKey
, evSecure
, evValue
, Layer
, layer
, lAttributes
, lAutoAssignElasticIps
, lAutoAssignPublicIps
, lCreatedAt
, lCustomInstanceProfileArn
, lCustomRecipes
, lCustomSecurityGroupIds
, lDefaultRecipes
, lDefaultSecurityGroupNames
, lEnableAutoHealing
, lInstallUpdatesOnBoot
, lLayerId
, lLifecycleEventConfiguration
, lName
, lPackages
, lShortname
, lStackId
, lType
, lUseEbsOptimizedInstances
, lVolumeConfigurations
, Recipes
, recipes
, rConfigure
, rDeploy
, rSetup
, rShutdown
, rUndeploy
, TimeBasedAutoScalingConfiguration
, timeBasedAutoScalingConfiguration
, tbascAutoScalingSchedule
, tbascInstanceId
, SelfUserProfile
, selfUserProfile
, supIamUserArn
, supName
, supSshPublicKey
, supSshUsername
, RootDeviceType (..)
, Stack
, stack
, sArn
, sAttributes
, sChefConfiguration
, sConfigurationManager
, sCreatedAt
, sCustomCookbooksSource
, sCustomJson
, sDefaultAvailabilityZone
, sDefaultInstanceProfileArn
, sDefaultOs
, sDefaultRootDeviceType
, sDefaultSshKeyName
, sDefaultSubnetId
, sHostnameTheme
, sName
, sRegion
, sServiceRoleArn
, sStackId
, sUseCustomCookbooks
, sUseOpsworksSecurityGroups
, sVpcId
, DeploymentCommand
, deploymentCommand
, dcArgs
, dcName
, WeeklyAutoScalingSchedule
, weeklyAutoScalingSchedule
, wassFriday
, wassMonday
, wassSaturday
, wassSunday
, wassThursday
, wassTuesday
, wassWednesday
, DeploymentCommandName (..)
, Instance
, instance'
, iAmiId
, iArchitecture
, iAutoScalingType
, iAvailabilityZone
, iBlockDeviceMappings
, iCreatedAt
, iEbsOptimized
, iEc2InstanceId
, iElasticIp
, iHostname
, iInfrastructureClass
, iInstallUpdatesOnBoot
, iInstanceId
, iInstanceProfileArn
, iInstanceType
, iLastServiceErrorId
, iLayerIds
, iOs
, iPrivateDns
, iPrivateIp
, iPublicDns
, iPublicIp
, iRegisteredBy
, iReportedAgentVersion
, iReportedOs
, iRootDeviceType
, iRootDeviceVolumeId
, iSecurityGroupIds
, iSshHostDsaKeyFingerprint
, iSshHostRsaKeyFingerprint
, iSshKeyName
, iStackId
, iStatus
, iSubnetId
, iVirtualizationType
, Deployment
, deployment
, dAppId
, dCommand
, dComment
, dCompletedAt
, dCreatedAt
, dCustomJson
, dDeploymentId
, dDuration
, dIamUserArn
, dInstanceIds
, dStackId
, dStatus
, InstancesCount
, instancesCount
, icAssigning
, icBooting
, icConnectionLost
, icDeregistering
, icOnline
, icPending
, icRebooting
, icRegistered
, icRegistering
, icRequested
, icRunningSetup
, icSetupFailed
, icShuttingDown
, icStartFailed
, icStopped
, icStopping
, icTerminated
, icTerminating
, icUnassigning
, AppType (..)
) where
import Network.AWS.Prelude
import Network.AWS.Signing
import qualified GHC.Exts
data OpsWorks
instance AWSService OpsWorks where
type Sg OpsWorks = V4
type Er OpsWorks = JSONError
service = service'
where
service' :: Service OpsWorks
service' = Service
{ _svcAbbrev = "OpsWorks"
, _svcPrefix = "opsworks"
, _svcVersion = "2013-02-18"
, _svcTargetPrefix = Just "OpsWorks_20130218"
, _svcJSONVersion = Just "1.1"
, _svcHandle = handle
, _svcRetry = retry
}
handle :: Status
-> Maybe (LazyByteString -> ServiceError JSONError)
handle = jsonError statusSuccess service'
retry :: Retry OpsWorks
retry = Exponential
{ _retryBase = 0.05
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check :: Status
-> JSONError
-> Bool
check (statusCode -> s) (awsErrorCode -> e)
| s == 400 && (Just "Throttling") == e = True
| s == 500 = True
| s == 509 = True
| s == 503 = True
| otherwise = False
data SslConfiguration = SslConfiguration
{ _scCertificate :: Text
, _scChain :: Maybe Text
, _scPrivateKey :: Text
} deriving (Eq, Ord, Read, Show)
sslConfiguration :: Text
-> Text
-> SslConfiguration
sslConfiguration p1 p2 = SslConfiguration
{ _scCertificate = p1
, _scPrivateKey = p2
, _scChain = Nothing
}
scCertificate :: Lens' SslConfiguration Text
scCertificate = lens _scCertificate (\s a -> s { _scCertificate = a })
scChain :: Lens' SslConfiguration (Maybe Text)
scChain = lens _scChain (\s a -> s { _scChain = a })
scPrivateKey :: Lens' SslConfiguration Text
scPrivateKey = lens _scPrivateKey (\s a -> s { _scPrivateKey = a })
instance FromJSON SslConfiguration where
parseJSON = withObject "SslConfiguration" $ \o -> SslConfiguration
<$> o .: "Certificate"
<*> o .:? "Chain"
<*> o .: "PrivateKey"
instance ToJSON SslConfiguration where
toJSON SslConfiguration{..} = object
[ "Certificate" .= _scCertificate
, "PrivateKey" .= _scPrivateKey
, "Chain" .= _scChain
]
data VirtualizationType
= Hvm
| Paravirtual
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable VirtualizationType
instance FromText VirtualizationType where
parser = takeLowerText >>= \case
"hvm" -> pure Hvm
"paravirtual" -> pure Paravirtual
e -> fail $
"Failure parsing VirtualizationType from " ++ show e
instance ToText VirtualizationType where
toText = \case
Hvm -> "hvm"
Paravirtual -> "paravirtual"
instance ToByteString VirtualizationType
instance ToHeader VirtualizationType
instance ToQuery VirtualizationType
instance FromJSON VirtualizationType where
parseJSON = parseJSONText "VirtualizationType"
instance ToJSON VirtualizationType where
toJSON = toJSONText
data Command = Command
{ _cAcknowledgedAt :: Maybe Text
, _cCommandId :: Maybe Text
, _cCompletedAt :: Maybe Text
, _cCreatedAt :: Maybe Text
, _cDeploymentId :: Maybe Text
, _cExitCode :: Maybe Int
, _cInstanceId :: Maybe Text
, _cLogUrl :: Maybe Text
, _cStatus :: Maybe Text
, _cType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
command :: Command
command = Command
{ _cCommandId = Nothing
, _cInstanceId = Nothing
, _cDeploymentId = Nothing
, _cCreatedAt = Nothing
, _cAcknowledgedAt = Nothing
, _cCompletedAt = Nothing
, _cStatus = Nothing
, _cExitCode = Nothing
, _cLogUrl = Nothing
, _cType = Nothing
}
cAcknowledgedAt :: Lens' Command (Maybe Text)
cAcknowledgedAt = lens _cAcknowledgedAt (\s a -> s { _cAcknowledgedAt = a })
cCommandId :: Lens' Command (Maybe Text)
cCommandId = lens _cCommandId (\s a -> s { _cCommandId = a })
cCompletedAt :: Lens' Command (Maybe Text)
cCompletedAt = lens _cCompletedAt (\s a -> s { _cCompletedAt = a })
cCreatedAt :: Lens' Command (Maybe Text)
cCreatedAt = lens _cCreatedAt (\s a -> s { _cCreatedAt = a })
cDeploymentId :: Lens' Command (Maybe Text)
cDeploymentId = lens _cDeploymentId (\s a -> s { _cDeploymentId = a })
cExitCode :: Lens' Command (Maybe Int)
cExitCode = lens _cExitCode (\s a -> s { _cExitCode = a })
cInstanceId :: Lens' Command (Maybe Text)
cInstanceId = lens _cInstanceId (\s a -> s { _cInstanceId = a })
cLogUrl :: Lens' Command (Maybe Text)
cLogUrl = lens _cLogUrl (\s a -> s { _cLogUrl = a })
cStatus :: Lens' Command (Maybe Text)
cStatus = lens _cStatus (\s a -> s { _cStatus = a })
cType :: Lens' Command (Maybe Text)
cType = lens _cType (\s a -> s { _cType = a })
instance FromJSON Command where
parseJSON = withObject "Command" $ \o -> Command
<$> o .:? "AcknowledgedAt"
<*> o .:? "CommandId"
<*> o .:? "CompletedAt"
<*> o .:? "CreatedAt"
<*> o .:? "DeploymentId"
<*> o .:? "ExitCode"
<*> o .:? "InstanceId"
<*> o .:? "LogUrl"
<*> o .:? "Status"
<*> o .:? "Type"
instance ToJSON Command where
toJSON Command{..} = object
[ "CommandId" .= _cCommandId
, "InstanceId" .= _cInstanceId
, "DeploymentId" .= _cDeploymentId
, "CreatedAt" .= _cCreatedAt
, "AcknowledgedAt" .= _cAcknowledgedAt
, "CompletedAt" .= _cCompletedAt
, "Status" .= _cStatus
, "ExitCode" .= _cExitCode
, "LogUrl" .= _cLogUrl
, "Type" .= _cType
]
data RaidArray = RaidArray
{ _raAvailabilityZone :: Maybe Text
, _raCreatedAt :: Maybe Text
, _raDevice :: Maybe Text
, _raInstanceId :: Maybe Text
, _raIops :: Maybe Int
, _raMountPoint :: Maybe Text
, _raName :: Maybe Text
, _raNumberOfDisks :: Maybe Int
, _raRaidArrayId :: Maybe Text
, _raRaidLevel :: Maybe Int
, _raSize :: Maybe Int
, _raStackId :: Maybe Text
, _raVolumeType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
raidArray :: RaidArray
raidArray = RaidArray
{ _raRaidArrayId = Nothing
, _raInstanceId = Nothing
, _raName = Nothing
, _raRaidLevel = Nothing
, _raNumberOfDisks = Nothing
, _raSize = Nothing
, _raDevice = Nothing
, _raMountPoint = Nothing
, _raAvailabilityZone = Nothing
, _raCreatedAt = Nothing
, _raStackId = Nothing
, _raVolumeType = Nothing
, _raIops = Nothing
}
raAvailabilityZone :: Lens' RaidArray (Maybe Text)
raAvailabilityZone =
lens _raAvailabilityZone (\s a -> s { _raAvailabilityZone = a })
raCreatedAt :: Lens' RaidArray (Maybe Text)
raCreatedAt = lens _raCreatedAt (\s a -> s { _raCreatedAt = a })
raDevice :: Lens' RaidArray (Maybe Text)
raDevice = lens _raDevice (\s a -> s { _raDevice = a })
raInstanceId :: Lens' RaidArray (Maybe Text)
raInstanceId = lens _raInstanceId (\s a -> s { _raInstanceId = a })
raIops :: Lens' RaidArray (Maybe Int)
raIops = lens _raIops (\s a -> s { _raIops = a })
raMountPoint :: Lens' RaidArray (Maybe Text)
raMountPoint = lens _raMountPoint (\s a -> s { _raMountPoint = a })
raName :: Lens' RaidArray (Maybe Text)
raName = lens _raName (\s a -> s { _raName = a })
raNumberOfDisks :: Lens' RaidArray (Maybe Int)
raNumberOfDisks = lens _raNumberOfDisks (\s a -> s { _raNumberOfDisks = a })
raRaidArrayId :: Lens' RaidArray (Maybe Text)
raRaidArrayId = lens _raRaidArrayId (\s a -> s { _raRaidArrayId = a })
raRaidLevel :: Lens' RaidArray (Maybe Int)
raRaidLevel = lens _raRaidLevel (\s a -> s { _raRaidLevel = a })
raSize :: Lens' RaidArray (Maybe Int)
raSize = lens _raSize (\s a -> s { _raSize = a })
raStackId :: Lens' RaidArray (Maybe Text)
raStackId = lens _raStackId (\s a -> s { _raStackId = a })
raVolumeType :: Lens' RaidArray (Maybe Text)
raVolumeType = lens _raVolumeType (\s a -> s { _raVolumeType = a })
instance FromJSON RaidArray where
parseJSON = withObject "RaidArray" $ \o -> RaidArray
<$> o .:? "AvailabilityZone"
<*> o .:? "CreatedAt"
<*> o .:? "Device"
<*> o .:? "InstanceId"
<*> o .:? "Iops"
<*> o .:? "MountPoint"
<*> o .:? "Name"
<*> o .:? "NumberOfDisks"
<*> o .:? "RaidArrayId"
<*> o .:? "RaidLevel"
<*> o .:? "Size"
<*> o .:? "StackId"
<*> o .:? "VolumeType"
instance ToJSON RaidArray where
toJSON RaidArray{..} = object
[ "RaidArrayId" .= _raRaidArrayId
, "InstanceId" .= _raInstanceId
, "Name" .= _raName
, "RaidLevel" .= _raRaidLevel
, "NumberOfDisks" .= _raNumberOfDisks
, "Size" .= _raSize
, "Device" .= _raDevice
, "MountPoint" .= _raMountPoint
, "AvailabilityZone" .= _raAvailabilityZone
, "CreatedAt" .= _raCreatedAt
, "StackId" .= _raStackId
, "VolumeType" .= _raVolumeType
, "Iops" .= _raIops
]
data ElasticLoadBalancer = ElasticLoadBalancer
{ _elbAvailabilityZones :: List "AvailabilityZones" Text
, _elbDnsName :: Maybe Text
, _elbEc2InstanceIds :: List "Ec2InstanceIds" Text
, _elbElasticLoadBalancerName :: Maybe Text
, _elbLayerId :: Maybe Text
, _elbRegion :: Maybe Text
, _elbStackId :: Maybe Text
, _elbSubnetIds :: List "SubnetIds" Text
, _elbVpcId :: Maybe Text
} deriving (Eq, Ord, Read, Show)
elasticLoadBalancer :: ElasticLoadBalancer
elasticLoadBalancer = ElasticLoadBalancer
{ _elbElasticLoadBalancerName = Nothing
, _elbRegion = Nothing
, _elbDnsName = Nothing
, _elbStackId = Nothing
, _elbLayerId = Nothing
, _elbVpcId = Nothing
, _elbAvailabilityZones = mempty
, _elbSubnetIds = mempty
, _elbEc2InstanceIds = mempty
}
elbAvailabilityZones :: Lens' ElasticLoadBalancer [Text]
elbAvailabilityZones =
lens _elbAvailabilityZones (\s a -> s { _elbAvailabilityZones = a })
. _List
elbDnsName :: Lens' ElasticLoadBalancer (Maybe Text)
elbDnsName = lens _elbDnsName (\s a -> s { _elbDnsName = a })
elbEc2InstanceIds :: Lens' ElasticLoadBalancer [Text]
elbEc2InstanceIds =
lens _elbEc2InstanceIds (\s a -> s { _elbEc2InstanceIds = a })
. _List
elbElasticLoadBalancerName :: Lens' ElasticLoadBalancer (Maybe Text)
elbElasticLoadBalancerName =
lens _elbElasticLoadBalancerName
(\s a -> s { _elbElasticLoadBalancerName = a })
elbLayerId :: Lens' ElasticLoadBalancer (Maybe Text)
elbLayerId = lens _elbLayerId (\s a -> s { _elbLayerId = a })
elbRegion :: Lens' ElasticLoadBalancer (Maybe Text)
elbRegion = lens _elbRegion (\s a -> s { _elbRegion = a })
elbStackId :: Lens' ElasticLoadBalancer (Maybe Text)
elbStackId = lens _elbStackId (\s a -> s { _elbStackId = a })
elbSubnetIds :: Lens' ElasticLoadBalancer [Text]
elbSubnetIds = lens _elbSubnetIds (\s a -> s { _elbSubnetIds = a }) . _List
elbVpcId :: Lens' ElasticLoadBalancer (Maybe Text)
elbVpcId = lens _elbVpcId (\s a -> s { _elbVpcId = a })
instance FromJSON ElasticLoadBalancer where
parseJSON = withObject "ElasticLoadBalancer" $ \o -> ElasticLoadBalancer
<$> o .:? "AvailabilityZones" .!= mempty
<*> o .:? "DnsName"
<*> o .:? "Ec2InstanceIds" .!= mempty
<*> o .:? "ElasticLoadBalancerName"
<*> o .:? "LayerId"
<*> o .:? "Region"
<*> o .:? "StackId"
<*> o .:? "SubnetIds" .!= mempty
<*> o .:? "VpcId"
instance ToJSON ElasticLoadBalancer where
toJSON ElasticLoadBalancer{..} = object
[ "ElasticLoadBalancerName" .= _elbElasticLoadBalancerName
, "Region" .= _elbRegion
, "DnsName" .= _elbDnsName
, "StackId" .= _elbStackId
, "LayerId" .= _elbLayerId
, "VpcId" .= _elbVpcId
, "AvailabilityZones" .= _elbAvailabilityZones
, "SubnetIds" .= _elbSubnetIds
, "Ec2InstanceIds" .= _elbEc2InstanceIds
]
newtype LifecycleEventConfiguration = LifecycleEventConfiguration
{ _lecShutdown :: Maybe ShutdownEventConfiguration
} deriving (Eq, Read, Show)
lifecycleEventConfiguration :: LifecycleEventConfiguration
lifecycleEventConfiguration = LifecycleEventConfiguration
{ _lecShutdown = Nothing
}
lecShutdown :: Lens' LifecycleEventConfiguration (Maybe ShutdownEventConfiguration)
lecShutdown = lens _lecShutdown (\s a -> s { _lecShutdown = a })
instance FromJSON LifecycleEventConfiguration where
parseJSON = withObject "LifecycleEventConfiguration" $ \o -> LifecycleEventConfiguration
<$> o .:? "Shutdown"
instance ToJSON LifecycleEventConfiguration where
toJSON LifecycleEventConfiguration{..} = object
[ "Shutdown" .= _lecShutdown
]
data RdsDbInstance = RdsDbInstance
{ _rdiAddress :: Maybe Text
, _rdiDbInstanceIdentifier :: Maybe Text
, _rdiDbPassword :: Maybe Text
, _rdiDbUser :: Maybe Text
, _rdiEngine :: Maybe Text
, _rdiMissingOnRds :: Maybe Bool
, _rdiRdsDbInstanceArn :: Maybe Text
, _rdiRegion :: Maybe Text
, _rdiStackId :: Maybe Text
} deriving (Eq, Ord, Read, Show)
rdsDbInstance :: RdsDbInstance
rdsDbInstance = RdsDbInstance
{ _rdiRdsDbInstanceArn = Nothing
, _rdiDbInstanceIdentifier = Nothing
, _rdiDbUser = Nothing
, _rdiDbPassword = Nothing
, _rdiRegion = Nothing
, _rdiAddress = Nothing
, _rdiEngine = Nothing
, _rdiStackId = Nothing
, _rdiMissingOnRds = Nothing
}
rdiAddress :: Lens' RdsDbInstance (Maybe Text)
rdiAddress = lens _rdiAddress (\s a -> s { _rdiAddress = a })
rdiDbInstanceIdentifier :: Lens' RdsDbInstance (Maybe Text)
rdiDbInstanceIdentifier =
lens _rdiDbInstanceIdentifier (\s a -> s { _rdiDbInstanceIdentifier = a })
rdiDbPassword :: Lens' RdsDbInstance (Maybe Text)
rdiDbPassword = lens _rdiDbPassword (\s a -> s { _rdiDbPassword = a })
rdiDbUser :: Lens' RdsDbInstance (Maybe Text)
rdiDbUser = lens _rdiDbUser (\s a -> s { _rdiDbUser = a })
rdiEngine :: Lens' RdsDbInstance (Maybe Text)
rdiEngine = lens _rdiEngine (\s a -> s { _rdiEngine = a })
rdiMissingOnRds :: Lens' RdsDbInstance (Maybe Bool)
rdiMissingOnRds = lens _rdiMissingOnRds (\s a -> s { _rdiMissingOnRds = a })
rdiRdsDbInstanceArn :: Lens' RdsDbInstance (Maybe Text)
rdiRdsDbInstanceArn =
lens _rdiRdsDbInstanceArn (\s a -> s { _rdiRdsDbInstanceArn = a })
rdiRegion :: Lens' RdsDbInstance (Maybe Text)
rdiRegion = lens _rdiRegion (\s a -> s { _rdiRegion = a })
rdiStackId :: Lens' RdsDbInstance (Maybe Text)
rdiStackId = lens _rdiStackId (\s a -> s { _rdiStackId = a })
instance FromJSON RdsDbInstance where
parseJSON = withObject "RdsDbInstance" $ \o -> RdsDbInstance
<$> o .:? "Address"
<*> o .:? "DbInstanceIdentifier"
<*> o .:? "DbPassword"
<*> o .:? "DbUser"
<*> o .:? "Engine"
<*> o .:? "MissingOnRds"
<*> o .:? "RdsDbInstanceArn"
<*> o .:? "Region"
<*> o .:? "StackId"
instance ToJSON RdsDbInstance where
toJSON RdsDbInstance{..} = object
[ "RdsDbInstanceArn" .= _rdiRdsDbInstanceArn
, "DbInstanceIdentifier" .= _rdiDbInstanceIdentifier
, "DbUser" .= _rdiDbUser
, "DbPassword" .= _rdiDbPassword
, "Region" .= _rdiRegion
, "Address" .= _rdiAddress
, "Engine" .= _rdiEngine
, "StackId" .= _rdiStackId
, "MissingOnRds" .= _rdiMissingOnRds
]
data AppAttributesKeys
= AutoBundleOnDeploy
| DocumentRoot
| RailsEnv
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable AppAttributesKeys
instance FromText AppAttributesKeys where
parser = takeLowerText >>= \case
"autobundleondeploy" -> pure AutoBundleOnDeploy
"documentroot" -> pure DocumentRoot
"railsenv" -> pure RailsEnv
e -> fail $
"Failure parsing AppAttributesKeys from " ++ show e
instance ToText AppAttributesKeys where
toText = \case
AutoBundleOnDeploy -> "AutoBundleOnDeploy"
DocumentRoot -> "DocumentRoot"
RailsEnv -> "RailsEnv"
instance ToByteString AppAttributesKeys
instance ToHeader AppAttributesKeys
instance ToQuery AppAttributesKeys
instance FromJSON AppAttributesKeys where
parseJSON = parseJSONText "AppAttributesKeys"
instance ToJSON AppAttributesKeys where
toJSON = toJSONText
data ServiceError' = ServiceError'
{ _seCreatedAt :: Maybe Text
, _seInstanceId :: Maybe Text
, _seMessage :: Maybe Text
, _seServiceErrorId :: Maybe Text
, _seStackId :: Maybe Text
, _seType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
serviceError' :: ServiceError'
serviceError' = ServiceError'
{ _seServiceErrorId = Nothing
, _seStackId = Nothing
, _seInstanceId = Nothing
, _seType = Nothing
, _seMessage = Nothing
, _seCreatedAt = Nothing
}
seCreatedAt :: Lens' ServiceError' (Maybe Text)
seCreatedAt = lens _seCreatedAt (\s a -> s { _seCreatedAt = a })
seInstanceId :: Lens' ServiceError' (Maybe Text)
seInstanceId = lens _seInstanceId (\s a -> s { _seInstanceId = a })
seMessage :: Lens' ServiceError' (Maybe Text)
seMessage = lens _seMessage (\s a -> s { _seMessage = a })
seServiceErrorId :: Lens' ServiceError' (Maybe Text)
seServiceErrorId = lens _seServiceErrorId (\s a -> s { _seServiceErrorId = a })
seStackId :: Lens' ServiceError' (Maybe Text)
seStackId = lens _seStackId (\s a -> s { _seStackId = a })
seType :: Lens' ServiceError' (Maybe Text)
seType = lens _seType (\s a -> s { _seType = a })
instance FromJSON ServiceError' where
parseJSON = withObject "ServiceError'" $ \o -> ServiceError'
<$> o .:? "CreatedAt"
<*> o .:? "InstanceId"
<*> o .:? "Message"
<*> o .:? "ServiceErrorId"
<*> o .:? "StackId"
<*> o .:? "Type"
instance ToJSON ServiceError' where
toJSON ServiceError'{..} = object
[ "ServiceErrorId" .= _seServiceErrorId
, "StackId" .= _seStackId
, "InstanceId" .= _seInstanceId
, "Type" .= _seType
, "Message" .= _seMessage
, "CreatedAt" .= _seCreatedAt
]
data StackSummary = StackSummary
{ _ssAppsCount :: Maybe Int
, _ssArn :: Maybe Text
, _ssInstancesCount :: Maybe InstancesCount
, _ssLayersCount :: Maybe Int
, _ssName :: Maybe Text
, _ssStackId :: Maybe Text
} deriving (Eq, Read, Show)
stackSummary :: StackSummary
stackSummary = StackSummary
{ _ssStackId = Nothing
, _ssName = Nothing
, _ssArn = Nothing
, _ssLayersCount = Nothing
, _ssAppsCount = Nothing
, _ssInstancesCount = Nothing
}
ssAppsCount :: Lens' StackSummary (Maybe Int)
ssAppsCount = lens _ssAppsCount (\s a -> s { _ssAppsCount = a })
ssArn :: Lens' StackSummary (Maybe Text)
ssArn = lens _ssArn (\s a -> s { _ssArn = a })
ssInstancesCount :: Lens' StackSummary (Maybe InstancesCount)
ssInstancesCount = lens _ssInstancesCount (\s a -> s { _ssInstancesCount = a })
ssLayersCount :: Lens' StackSummary (Maybe Int)
ssLayersCount = lens _ssLayersCount (\s a -> s { _ssLayersCount = a })
ssName :: Lens' StackSummary (Maybe Text)
ssName = lens _ssName (\s a -> s { _ssName = a })
ssStackId :: Lens' StackSummary (Maybe Text)
ssStackId = lens _ssStackId (\s a -> s { _ssStackId = a })
instance FromJSON StackSummary where
parseJSON = withObject "StackSummary" $ \o -> StackSummary
<$> o .:? "AppsCount"
<*> o .:? "Arn"
<*> o .:? "InstancesCount"
<*> o .:? "LayersCount"
<*> o .:? "Name"
<*> o .:? "StackId"
instance ToJSON StackSummary where
toJSON StackSummary{..} = object
[ "StackId" .= _ssStackId
, "Name" .= _ssName
, "Arn" .= _ssArn
, "LayersCount" .= _ssLayersCount
, "AppsCount" .= _ssAppsCount
, "InstancesCount" .= _ssInstancesCount
]
data BlockDeviceMapping = BlockDeviceMapping
{ _bdmDeviceName :: Maybe Text
, _bdmEbs :: Maybe EbsBlockDevice
, _bdmNoDevice :: Maybe Text
, _bdmVirtualName :: Maybe Text
} deriving (Eq, Read, Show)
blockDeviceMapping :: BlockDeviceMapping
blockDeviceMapping = BlockDeviceMapping
{ _bdmDeviceName = Nothing
, _bdmNoDevice = Nothing
, _bdmVirtualName = Nothing
, _bdmEbs = Nothing
}
bdmDeviceName :: Lens' BlockDeviceMapping (Maybe Text)
bdmDeviceName = lens _bdmDeviceName (\s a -> s { _bdmDeviceName = a })
bdmEbs :: Lens' BlockDeviceMapping (Maybe EbsBlockDevice)
bdmEbs = lens _bdmEbs (\s a -> s { _bdmEbs = a })
bdmNoDevice :: Lens' BlockDeviceMapping (Maybe Text)
bdmNoDevice = lens _bdmNoDevice (\s a -> s { _bdmNoDevice = a })
bdmVirtualName :: Lens' BlockDeviceMapping (Maybe Text)
bdmVirtualName = lens _bdmVirtualName (\s a -> s { _bdmVirtualName = a })
instance FromJSON BlockDeviceMapping where
parseJSON = withObject "BlockDeviceMapping" $ \o -> BlockDeviceMapping
<$> o .:? "DeviceName"
<*> o .:? "Ebs"
<*> o .:? "NoDevice"
<*> o .:? "VirtualName"
instance ToJSON BlockDeviceMapping where
toJSON BlockDeviceMapping{..} = object
[ "DeviceName" .= _bdmDeviceName
, "NoDevice" .= _bdmNoDevice
, "VirtualName" .= _bdmVirtualName
, "Ebs" .= _bdmEbs
]
data StackAttributesKeys
= Color
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable StackAttributesKeys
instance FromText StackAttributesKeys where
parser = takeLowerText >>= \case
"color" -> pure Color
e -> fail $
"Failure parsing StackAttributesKeys from " ++ show e
instance ToText StackAttributesKeys where
toText Color = "Color"
instance ToByteString StackAttributesKeys
instance ToHeader StackAttributesKeys
instance ToQuery StackAttributesKeys
instance FromJSON StackAttributesKeys where
parseJSON = parseJSONText "StackAttributesKeys"
instance ToJSON StackAttributesKeys where
toJSON = toJSONText
data LoadBasedAutoScalingConfiguration = LoadBasedAutoScalingConfiguration
{ _lbascDownScaling :: Maybe AutoScalingThresholds
, _lbascEnable :: Maybe Bool
, _lbascLayerId :: Maybe Text
, _lbascUpScaling :: Maybe AutoScalingThresholds
} deriving (Eq, Read, Show)
loadBasedAutoScalingConfiguration :: LoadBasedAutoScalingConfiguration
loadBasedAutoScalingConfiguration = LoadBasedAutoScalingConfiguration
{ _lbascLayerId = Nothing
, _lbascEnable = Nothing
, _lbascUpScaling = Nothing
, _lbascDownScaling = Nothing
}
lbascDownScaling :: Lens' LoadBasedAutoScalingConfiguration (Maybe AutoScalingThresholds)
lbascDownScaling = lens _lbascDownScaling (\s a -> s { _lbascDownScaling = a })
lbascEnable :: Lens' LoadBasedAutoScalingConfiguration (Maybe Bool)
lbascEnable = lens _lbascEnable (\s a -> s { _lbascEnable = a })
lbascLayerId :: Lens' LoadBasedAutoScalingConfiguration (Maybe Text)
lbascLayerId = lens _lbascLayerId (\s a -> s { _lbascLayerId = a })
lbascUpScaling :: Lens' LoadBasedAutoScalingConfiguration (Maybe AutoScalingThresholds)
lbascUpScaling = lens _lbascUpScaling (\s a -> s { _lbascUpScaling = a })
instance FromJSON LoadBasedAutoScalingConfiguration where
parseJSON = withObject "LoadBasedAutoScalingConfiguration" $ \o -> LoadBasedAutoScalingConfiguration
<$> o .:? "DownScaling"
<*> o .:? "Enable"
<*> o .:? "LayerId"
<*> o .:? "UpScaling"
instance ToJSON LoadBasedAutoScalingConfiguration where
toJSON LoadBasedAutoScalingConfiguration{..} = object
[ "LayerId" .= _lbascLayerId
, "Enable" .= _lbascEnable
, "UpScaling" .= _lbascUpScaling
, "DownScaling" .= _lbascDownScaling
]
data SourceType
= Archive
| Git
| S3
| Svn
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable SourceType
instance FromText SourceType where
parser = takeLowerText >>= \case
"archive" -> pure Archive
"git" -> pure Git
"s3" -> pure S3
"svn" -> pure Svn
e -> fail $
"Failure parsing SourceType from " ++ show e
instance ToText SourceType where
toText = \case
Archive -> "archive"
Git -> "git"
S3 -> "s3"
Svn -> "svn"
instance ToByteString SourceType
instance ToHeader SourceType
instance ToQuery SourceType
instance FromJSON SourceType where
parseJSON = parseJSONText "SourceType"
instance ToJSON SourceType where
toJSON = toJSONText
data Volume = Volume
{ _vAvailabilityZone :: Maybe Text
, _vDevice :: Maybe Text
, _vEc2VolumeId :: Maybe Text
, _vInstanceId :: Maybe Text
, _vIops :: Maybe Int
, _vMountPoint :: Maybe Text
, _vName :: Maybe Text
, _vRaidArrayId :: Maybe Text
, _vRegion :: Maybe Text
, _vSize :: Maybe Int
, _vStatus :: Maybe Text
, _vVolumeId :: Maybe Text
, _vVolumeType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
volume :: Volume
volume = Volume
{ _vVolumeId = Nothing
, _vEc2VolumeId = Nothing
, _vName = Nothing
, _vRaidArrayId = Nothing
, _vInstanceId = Nothing
, _vStatus = Nothing
, _vSize = Nothing
, _vDevice = Nothing
, _vMountPoint = Nothing
, _vRegion = Nothing
, _vAvailabilityZone = Nothing
, _vVolumeType = Nothing
, _vIops = Nothing
}
vAvailabilityZone :: Lens' Volume (Maybe Text)
vAvailabilityZone =
lens _vAvailabilityZone (\s a -> s { _vAvailabilityZone = a })
vDevice :: Lens' Volume (Maybe Text)
vDevice = lens _vDevice (\s a -> s { _vDevice = a })
vEc2VolumeId :: Lens' Volume (Maybe Text)
vEc2VolumeId = lens _vEc2VolumeId (\s a -> s { _vEc2VolumeId = a })
vInstanceId :: Lens' Volume (Maybe Text)
vInstanceId = lens _vInstanceId (\s a -> s { _vInstanceId = a })
vIops :: Lens' Volume (Maybe Int)
vIops = lens _vIops (\s a -> s { _vIops = a })
vMountPoint :: Lens' Volume (Maybe Text)
vMountPoint = lens _vMountPoint (\s a -> s { _vMountPoint = a })
vName :: Lens' Volume (Maybe Text)
vName = lens _vName (\s a -> s { _vName = a })
vRaidArrayId :: Lens' Volume (Maybe Text)
vRaidArrayId = lens _vRaidArrayId (\s a -> s { _vRaidArrayId = a })
vRegion :: Lens' Volume (Maybe Text)
vRegion = lens _vRegion (\s a -> s { _vRegion = a })
vSize :: Lens' Volume (Maybe Int)
vSize = lens _vSize (\s a -> s { _vSize = a })
vStatus :: Lens' Volume (Maybe Text)
vStatus = lens _vStatus (\s a -> s { _vStatus = a })
vVolumeId :: Lens' Volume (Maybe Text)
vVolumeId = lens _vVolumeId (\s a -> s { _vVolumeId = a })
vVolumeType :: Lens' Volume (Maybe Text)
vVolumeType = lens _vVolumeType (\s a -> s { _vVolumeType = a })
instance FromJSON Volume where
parseJSON = withObject "Volume" $ \o -> Volume
<$> o .:? "AvailabilityZone"
<*> o .:? "Device"
<*> o .:? "Ec2VolumeId"
<*> o .:? "InstanceId"
<*> o .:? "Iops"
<*> o .:? "MountPoint"
<*> o .:? "Name"
<*> o .:? "RaidArrayId"
<*> o .:? "Region"
<*> o .:? "Size"
<*> o .:? "Status"
<*> o .:? "VolumeId"
<*> o .:? "VolumeType"
instance ToJSON Volume where
toJSON Volume{..} = object
[ "VolumeId" .= _vVolumeId
, "Ec2VolumeId" .= _vEc2VolumeId
, "Name" .= _vName
, "RaidArrayId" .= _vRaidArrayId
, "InstanceId" .= _vInstanceId
, "Status" .= _vStatus
, "Size" .= _vSize
, "Device" .= _vDevice
, "MountPoint" .= _vMountPoint
, "Region" .= _vRegion
, "AvailabilityZone" .= _vAvailabilityZone
, "VolumeType" .= _vVolumeType
, "Iops" .= _vIops
]
data ChefConfiguration = ChefConfiguration
{ _ccBerkshelfVersion :: Maybe Text
, _ccManageBerkshelf :: Maybe Bool
} deriving (Eq, Ord, Read, Show)
chefConfiguration :: ChefConfiguration
chefConfiguration = ChefConfiguration
{ _ccManageBerkshelf = Nothing
, _ccBerkshelfVersion = Nothing
}
ccBerkshelfVersion :: Lens' ChefConfiguration (Maybe Text)
ccBerkshelfVersion =
lens _ccBerkshelfVersion (\s a -> s { _ccBerkshelfVersion = a })
ccManageBerkshelf :: Lens' ChefConfiguration (Maybe Bool)
ccManageBerkshelf =
lens _ccManageBerkshelf (\s a -> s { _ccManageBerkshelf = a })
instance FromJSON ChefConfiguration where
parseJSON = withObject "ChefConfiguration" $ \o -> ChefConfiguration
<$> o .:? "BerkshelfVersion"
<*> o .:? "ManageBerkshelf"
instance ToJSON ChefConfiguration where
toJSON ChefConfiguration{..} = object
[ "ManageBerkshelf" .= _ccManageBerkshelf
, "BerkshelfVersion" .= _ccBerkshelfVersion
]
data LayerType
= Custom
| DbMaster
| JavaApp
| Lb
| Memcached
| MonitoringMaster
| NodejsApp
| PhpApp
| RailsApp
| Web
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable LayerType
instance FromText LayerType where
parser = takeLowerText >>= \case
"custom" -> pure Custom
"db-master" -> pure DbMaster
"java-app" -> pure JavaApp
"lb" -> pure Lb
"memcached" -> pure Memcached
"monitoring-master" -> pure MonitoringMaster
"nodejs-app" -> pure NodejsApp
"php-app" -> pure PhpApp
"rails-app" -> pure RailsApp
"web" -> pure Web
e -> fail $
"Failure parsing LayerType from " ++ show e
instance ToText LayerType where
toText = \case
Custom -> "custom"
DbMaster -> "db-master"
JavaApp -> "java-app"
Lb -> "lb"
Memcached -> "memcached"
MonitoringMaster -> "monitoring-master"
NodejsApp -> "nodejs-app"
PhpApp -> "php-app"
RailsApp -> "rails-app"
Web -> "web"
instance ToByteString LayerType
instance ToHeader LayerType
instance ToQuery LayerType
instance FromJSON LayerType where
parseJSON = parseJSONText "LayerType"
instance ToJSON LayerType where
toJSON = toJSONText
data AutoScalingThresholds = AutoScalingThresholds
{ _astAlarms :: List "Alarms" Text
, _astCpuThreshold :: Maybe Double
, _astIgnoreMetricsTime :: Maybe Nat
, _astInstanceCount :: Maybe Int
, _astLoadThreshold :: Maybe Double
, _astMemoryThreshold :: Maybe Double
, _astThresholdsWaitTime :: Maybe Nat
} deriving (Eq, Ord, Read, Show)
autoScalingThresholds :: AutoScalingThresholds
autoScalingThresholds = AutoScalingThresholds
{ _astInstanceCount = Nothing
, _astThresholdsWaitTime = Nothing
, _astIgnoreMetricsTime = Nothing
, _astCpuThreshold = Nothing
, _astMemoryThreshold = Nothing
, _astLoadThreshold = Nothing
, _astAlarms = mempty
}
astAlarms :: Lens' AutoScalingThresholds [Text]
astAlarms = lens _astAlarms (\s a -> s { _astAlarms = a }) . _List
astCpuThreshold :: Lens' AutoScalingThresholds (Maybe Double)
astCpuThreshold = lens _astCpuThreshold (\s a -> s { _astCpuThreshold = a })
astIgnoreMetricsTime :: Lens' AutoScalingThresholds (Maybe Natural)
astIgnoreMetricsTime =
lens _astIgnoreMetricsTime (\s a -> s { _astIgnoreMetricsTime = a })
. mapping _Nat
astInstanceCount :: Lens' AutoScalingThresholds (Maybe Int)
astInstanceCount = lens _astInstanceCount (\s a -> s { _astInstanceCount = a })
astLoadThreshold :: Lens' AutoScalingThresholds (Maybe Double)
astLoadThreshold = lens _astLoadThreshold (\s a -> s { _astLoadThreshold = a })
astMemoryThreshold :: Lens' AutoScalingThresholds (Maybe Double)
astMemoryThreshold =
lens _astMemoryThreshold (\s a -> s { _astMemoryThreshold = a })
astThresholdsWaitTime :: Lens' AutoScalingThresholds (Maybe Natural)
astThresholdsWaitTime =
lens _astThresholdsWaitTime (\s a -> s { _astThresholdsWaitTime = a })
. mapping _Nat
instance FromJSON AutoScalingThresholds where
parseJSON = withObject "AutoScalingThresholds" $ \o -> AutoScalingThresholds
<$> o .:? "Alarms" .!= mempty
<*> o .:? "CpuThreshold"
<*> o .:? "IgnoreMetricsTime"
<*> o .:? "InstanceCount"
<*> o .:? "LoadThreshold"
<*> o .:? "MemoryThreshold"
<*> o .:? "ThresholdsWaitTime"
instance ToJSON AutoScalingThresholds where
toJSON AutoScalingThresholds{..} = object
[ "InstanceCount" .= _astInstanceCount
, "ThresholdsWaitTime" .= _astThresholdsWaitTime
, "IgnoreMetricsTime" .= _astIgnoreMetricsTime
, "CpuThreshold" .= _astCpuThreshold
, "MemoryThreshold" .= _astMemoryThreshold
, "LoadThreshold" .= _astLoadThreshold
, "Alarms" .= _astAlarms
]
data App = App
{ _appAppId :: Maybe Text
, _appAppSource :: Maybe Source
, _appAttributes :: Map AppAttributesKeys Text
, _appCreatedAt :: Maybe Text
, _appDataSources :: List "DataSources" DataSource
, _appDescription :: Maybe Text
, _appDomains :: List "Domains" Text
, _appEnableSsl :: Maybe Bool
, _appEnvironment :: List "Environment" EnvironmentVariable
, _appName :: Maybe Text
, _appShortname :: Maybe Text
, _appSslConfiguration :: Maybe SslConfiguration
, _appStackId :: Maybe Text
, _appType :: Maybe AppType
} deriving (Eq, Read, Show)
app :: App
app = App
{ _appAppId = Nothing
, _appStackId = Nothing
, _appShortname = Nothing
, _appName = Nothing
, _appDescription = Nothing
, _appDataSources = mempty
, _appType = Nothing
, _appAppSource = Nothing
, _appDomains = mempty
, _appEnableSsl = Nothing
, _appSslConfiguration = Nothing
, _appAttributes = mempty
, _appCreatedAt = Nothing
, _appEnvironment = mempty
}
appAppId :: Lens' App (Maybe Text)
appAppId = lens _appAppId (\s a -> s { _appAppId = a })
appAppSource :: Lens' App (Maybe Source)
appAppSource = lens _appAppSource (\s a -> s { _appAppSource = a })
appAttributes :: Lens' App (HashMap AppAttributesKeys Text)
appAttributes = lens _appAttributes (\s a -> s { _appAttributes = a }) . _Map
appCreatedAt :: Lens' App (Maybe Text)
appCreatedAt = lens _appCreatedAt (\s a -> s { _appCreatedAt = a })
appDataSources :: Lens' App [DataSource]
appDataSources = lens _appDataSources (\s a -> s { _appDataSources = a }) . _List
appDescription :: Lens' App (Maybe Text)
appDescription = lens _appDescription (\s a -> s { _appDescription = a })
appDomains :: Lens' App [Text]
appDomains = lens _appDomains (\s a -> s { _appDomains = a }) . _List
appEnableSsl :: Lens' App (Maybe Bool)
appEnableSsl = lens _appEnableSsl (\s a -> s { _appEnableSsl = a })
appEnvironment :: Lens' App [EnvironmentVariable]
appEnvironment = lens _appEnvironment (\s a -> s { _appEnvironment = a }) . _List
appName :: Lens' App (Maybe Text)
appName = lens _appName (\s a -> s { _appName = a })
appShortname :: Lens' App (Maybe Text)
appShortname = lens _appShortname (\s a -> s { _appShortname = a })
appSslConfiguration :: Lens' App (Maybe SslConfiguration)
appSslConfiguration =
lens _appSslConfiguration (\s a -> s { _appSslConfiguration = a })
appStackId :: Lens' App (Maybe Text)
appStackId = lens _appStackId (\s a -> s { _appStackId = a })
appType :: Lens' App (Maybe AppType)
appType = lens _appType (\s a -> s { _appType = a })
instance FromJSON App where
parseJSON = withObject "App" $ \o -> App
<$> o .:? "AppId"
<*> o .:? "AppSource"
<*> o .:? "Attributes" .!= mempty
<*> o .:? "CreatedAt"
<*> o .:? "DataSources" .!= mempty
<*> o .:? "Description"
<*> o .:? "Domains" .!= mempty
<*> o .:? "EnableSsl"
<*> o .:? "Environment" .!= mempty
<*> o .:? "Name"
<*> o .:? "Shortname"
<*> o .:? "SslConfiguration"
<*> o .:? "StackId"
<*> o .:? "Type"
instance ToJSON App where
toJSON App{..} = object
[ "AppId" .= _appAppId
, "StackId" .= _appStackId
, "Shortname" .= _appShortname
, "Name" .= _appName
, "Description" .= _appDescription
, "DataSources" .= _appDataSources
, "Type" .= _appType
, "AppSource" .= _appAppSource
, "Domains" .= _appDomains
, "EnableSsl" .= _appEnableSsl
, "SslConfiguration" .= _appSslConfiguration
, "Attributes" .= _appAttributes
, "CreatedAt" .= _appCreatedAt
, "Environment" .= _appEnvironment
]
data ElasticIp = ElasticIp
{ _eiDomain :: Maybe Text
, _eiInstanceId :: Maybe Text
, _eiIp :: Maybe Text
, _eiName :: Maybe Text
, _eiRegion :: Maybe Text
} deriving (Eq, Ord, Read, Show)
elasticIp :: ElasticIp
elasticIp = ElasticIp
{ _eiIp = Nothing
, _eiName = Nothing
, _eiDomain = Nothing
, _eiRegion = Nothing
, _eiInstanceId = Nothing
}
eiDomain :: Lens' ElasticIp (Maybe Text)
eiDomain = lens _eiDomain (\s a -> s { _eiDomain = a })
eiInstanceId :: Lens' ElasticIp (Maybe Text)
eiInstanceId = lens _eiInstanceId (\s a -> s { _eiInstanceId = a })
eiIp :: Lens' ElasticIp (Maybe Text)
eiIp = lens _eiIp (\s a -> s { _eiIp = a })
eiName :: Lens' ElasticIp (Maybe Text)
eiName = lens _eiName (\s a -> s { _eiName = a })
eiRegion :: Lens' ElasticIp (Maybe Text)
eiRegion = lens _eiRegion (\s a -> s { _eiRegion = a })
instance FromJSON ElasticIp where
parseJSON = withObject "ElasticIp" $ \o -> ElasticIp
<$> o .:? "Domain"
<*> o .:? "InstanceId"
<*> o .:? "Ip"
<*> o .:? "Name"
<*> o .:? "Region"
instance ToJSON ElasticIp where
toJSON ElasticIp{..} = object
[ "Ip" .= _eiIp
, "Name" .= _eiName
, "Domain" .= _eiDomain
, "Region" .= _eiRegion
, "InstanceId" .= _eiInstanceId
]
data ShutdownEventConfiguration = ShutdownEventConfiguration
{ _secDelayUntilElbConnectionsDrained :: Maybe Bool
, _secExecutionTimeout :: Maybe Int
} deriving (Eq, Ord, Read, Show)
shutdownEventConfiguration :: ShutdownEventConfiguration
shutdownEventConfiguration = ShutdownEventConfiguration
{ _secExecutionTimeout = Nothing
, _secDelayUntilElbConnectionsDrained = Nothing
}
secDelayUntilElbConnectionsDrained :: Lens' ShutdownEventConfiguration (Maybe Bool)
secDelayUntilElbConnectionsDrained =
lens _secDelayUntilElbConnectionsDrained
(\s a -> s { _secDelayUntilElbConnectionsDrained = a })
secExecutionTimeout :: Lens' ShutdownEventConfiguration (Maybe Int)
secExecutionTimeout =
lens _secExecutionTimeout (\s a -> s { _secExecutionTimeout = a })
instance FromJSON ShutdownEventConfiguration where
parseJSON = withObject "ShutdownEventConfiguration" $ \o -> ShutdownEventConfiguration
<$> o .:? "DelayUntilElbConnectionsDrained"
<*> o .:? "ExecutionTimeout"
instance ToJSON ShutdownEventConfiguration where
toJSON ShutdownEventConfiguration{..} = object
[ "ExecutionTimeout" .= _secExecutionTimeout
, "DelayUntilElbConnectionsDrained" .= _secDelayUntilElbConnectionsDrained
]
data InstanceIdentity = InstanceIdentity
{ _iiDocument :: Maybe Text
, _iiSignature :: Maybe Text
} deriving (Eq, Ord, Read, Show)
instanceIdentity :: InstanceIdentity
instanceIdentity = InstanceIdentity
{ _iiDocument = Nothing
, _iiSignature = Nothing
}
iiDocument :: Lens' InstanceIdentity (Maybe Text)
iiDocument = lens _iiDocument (\s a -> s { _iiDocument = a })
iiSignature :: Lens' InstanceIdentity (Maybe Text)
iiSignature = lens _iiSignature (\s a -> s { _iiSignature = a })
instance FromJSON InstanceIdentity where
parseJSON = withObject "InstanceIdentity" $ \o -> InstanceIdentity
<$> o .:? "Document"
<*> o .:? "Signature"
instance ToJSON InstanceIdentity where
toJSON InstanceIdentity{..} = object
[ "Document" .= _iiDocument
, "Signature" .= _iiSignature
]
data UserProfile = UserProfile
{ _upAllowSelfManagement :: Maybe Bool
, _upIamUserArn :: Maybe Text
, _upName :: Maybe Text
, _upSshPublicKey :: Maybe Text
, _upSshUsername :: Maybe Text
} deriving (Eq, Ord, Read, Show)
userProfile :: UserProfile
userProfile = UserProfile
{ _upIamUserArn = Nothing
, _upName = Nothing
, _upSshUsername = Nothing
, _upSshPublicKey = Nothing
, _upAllowSelfManagement = Nothing
}
upAllowSelfManagement :: Lens' UserProfile (Maybe Bool)
upAllowSelfManagement =
lens _upAllowSelfManagement (\s a -> s { _upAllowSelfManagement = a })
upIamUserArn :: Lens' UserProfile (Maybe Text)
upIamUserArn = lens _upIamUserArn (\s a -> s { _upIamUserArn = a })
upName :: Lens' UserProfile (Maybe Text)
upName = lens _upName (\s a -> s { _upName = a })
upSshPublicKey :: Lens' UserProfile (Maybe Text)
upSshPublicKey = lens _upSshPublicKey (\s a -> s { _upSshPublicKey = a })
upSshUsername :: Lens' UserProfile (Maybe Text)
upSshUsername = lens _upSshUsername (\s a -> s { _upSshUsername = a })
instance FromJSON UserProfile where
parseJSON = withObject "UserProfile" $ \o -> UserProfile
<$> o .:? "AllowSelfManagement"
<*> o .:? "IamUserArn"
<*> o .:? "Name"
<*> o .:? "SshPublicKey"
<*> o .:? "SshUsername"
instance ToJSON UserProfile where
toJSON UserProfile{..} = object
[ "IamUserArn" .= _upIamUserArn
, "Name" .= _upName
, "SshUsername" .= _upSshUsername
, "SshPublicKey" .= _upSshPublicKey
, "AllowSelfManagement" .= _upAllowSelfManagement
]
data AutoScalingType
= Load
| Timer
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable AutoScalingType
instance FromText AutoScalingType where
parser = takeLowerText >>= \case
"load" -> pure Load
"timer" -> pure Timer
e -> fail $
"Failure parsing AutoScalingType from " ++ show e
instance ToText AutoScalingType where
toText = \case
Load -> "load"
Timer -> "timer"
instance ToByteString AutoScalingType
instance ToHeader AutoScalingType
instance ToQuery AutoScalingType
instance FromJSON AutoScalingType where
parseJSON = parseJSONText "AutoScalingType"
instance ToJSON AutoScalingType where
toJSON = toJSONText
data Source = Source
{ _sPassword :: Maybe Text
, _sRevision :: Maybe Text
, _sSshKey :: Maybe Text
, _sType :: Maybe SourceType
, _sUrl :: Maybe Text
, _sUsername :: Maybe Text
} deriving (Eq, Read, Show)
source :: Source
source = Source
{ _sType = Nothing
, _sUrl = Nothing
, _sUsername = Nothing
, _sPassword = Nothing
, _sSshKey = Nothing
, _sRevision = Nothing
}
sPassword :: Lens' Source (Maybe Text)
sPassword = lens _sPassword (\s a -> s { _sPassword = a })
sRevision :: Lens' Source (Maybe Text)
sRevision = lens _sRevision (\s a -> s { _sRevision = a })
sSshKey :: Lens' Source (Maybe Text)
sSshKey = lens _sSshKey (\s a -> s { _sSshKey = a })
sType :: Lens' Source (Maybe SourceType)
sType = lens _sType (\s a -> s { _sType = a })
sUrl :: Lens' Source (Maybe Text)
sUrl = lens _sUrl (\s a -> s { _sUrl = a })
sUsername :: Lens' Source (Maybe Text)
sUsername = lens _sUsername (\s a -> s { _sUsername = a })
instance FromJSON Source where
parseJSON = withObject "Source" $ \o -> Source
<$> o .:? "Password"
<*> o .:? "Revision"
<*> o .:? "SshKey"
<*> o .:? "Type"
<*> o .:? "Url"
<*> o .:? "Username"
instance ToJSON Source where
toJSON Source{..} = object
[ "Type" .= _sType
, "Url" .= _sUrl
, "Username" .= _sUsername
, "Password" .= _sPassword
, "SshKey" .= _sSshKey
, "Revision" .= _sRevision
]
data DataSource = DataSource
{ _dsArn :: Maybe Text
, _dsDatabaseName :: Maybe Text
, _dsType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
dataSource :: DataSource
dataSource = DataSource
{ _dsType = Nothing
, _dsArn = Nothing
, _dsDatabaseName = Nothing
}
dsArn :: Lens' DataSource (Maybe Text)
dsArn = lens _dsArn (\s a -> s { _dsArn = a })
dsDatabaseName :: Lens' DataSource (Maybe Text)
dsDatabaseName = lens _dsDatabaseName (\s a -> s { _dsDatabaseName = a })
dsType :: Lens' DataSource (Maybe Text)
dsType = lens _dsType (\s a -> s { _dsType = a })
instance FromJSON DataSource where
parseJSON = withObject "DataSource" $ \o -> DataSource
<$> o .:? "Arn"
<*> o .:? "DatabaseName"
<*> o .:? "Type"
instance ToJSON DataSource where
toJSON DataSource{..} = object
[ "Type" .= _dsType
, "Arn" .= _dsArn
, "DatabaseName" .= _dsDatabaseName
]
data Architecture
= I386
| X8664
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable Architecture
instance FromText Architecture where
parser = takeLowerText >>= \case
"i386" -> pure I386
"x86_64" -> pure X8664
e -> fail $
"Failure parsing Architecture from " ++ show e
instance ToText Architecture where
toText = \case
I386 -> "i386"
X8664 -> "x86_64"
instance ToByteString Architecture
instance ToHeader Architecture
instance ToQuery Architecture
instance FromJSON Architecture where
parseJSON = parseJSONText "Architecture"
instance ToJSON Architecture where
toJSON = toJSONText
data StackConfigurationManager = StackConfigurationManager
{ _scmName :: Maybe Text
, _scmVersion :: Maybe Text
} deriving (Eq, Ord, Read, Show)
stackConfigurationManager :: StackConfigurationManager
stackConfigurationManager = StackConfigurationManager
{ _scmName = Nothing
, _scmVersion = Nothing
}
scmName :: Lens' StackConfigurationManager (Maybe Text)
scmName = lens _scmName (\s a -> s { _scmName = a })
scmVersion :: Lens' StackConfigurationManager (Maybe Text)
scmVersion = lens _scmVersion (\s a -> s { _scmVersion = a })
instance FromJSON StackConfigurationManager where
parseJSON = withObject "StackConfigurationManager" $ \o -> StackConfigurationManager
<$> o .:? "Name"
<*> o .:? "Version"
instance ToJSON StackConfigurationManager where
toJSON StackConfigurationManager{..} = object
[ "Name" .= _scmName
, "Version" .= _scmVersion
]
data EbsBlockDevice = EbsBlockDevice
{ _ebdDeleteOnTermination :: Maybe Bool
, _ebdIops :: Maybe Int
, _ebdSnapshotId :: Maybe Text
, _ebdVolumeSize :: Maybe Int
, _ebdVolumeType :: Maybe VolumeType
} deriving (Eq, Read, Show)
ebsBlockDevice :: EbsBlockDevice
ebsBlockDevice = EbsBlockDevice
{ _ebdSnapshotId = Nothing
, _ebdIops = Nothing
, _ebdVolumeSize = Nothing
, _ebdVolumeType = Nothing
, _ebdDeleteOnTermination = Nothing
}
ebdDeleteOnTermination :: Lens' EbsBlockDevice (Maybe Bool)
ebdDeleteOnTermination =
lens _ebdDeleteOnTermination (\s a -> s { _ebdDeleteOnTermination = a })
ebdIops :: Lens' EbsBlockDevice (Maybe Int)
ebdIops = lens _ebdIops (\s a -> s { _ebdIops = a })
ebdSnapshotId :: Lens' EbsBlockDevice (Maybe Text)
ebdSnapshotId = lens _ebdSnapshotId (\s a -> s { _ebdSnapshotId = a })
ebdVolumeSize :: Lens' EbsBlockDevice (Maybe Int)
ebdVolumeSize = lens _ebdVolumeSize (\s a -> s { _ebdVolumeSize = a })
ebdVolumeType :: Lens' EbsBlockDevice (Maybe VolumeType)
ebdVolumeType = lens _ebdVolumeType (\s a -> s { _ebdVolumeType = a })
instance FromJSON EbsBlockDevice where
parseJSON = withObject "EbsBlockDevice" $ \o -> EbsBlockDevice
<$> o .:? "DeleteOnTermination"
<*> o .:? "Iops"
<*> o .:? "SnapshotId"
<*> o .:? "VolumeSize"
<*> o .:? "VolumeType"
instance ToJSON EbsBlockDevice where
toJSON EbsBlockDevice{..} = object
[ "SnapshotId" .= _ebdSnapshotId
, "Iops" .= _ebdIops
, "VolumeSize" .= _ebdVolumeSize
, "VolumeType" .= _ebdVolumeType
, "DeleteOnTermination" .= _ebdDeleteOnTermination
]
data LayerAttributesKeys
= BundlerVersion
| EnableHaproxyStats
| GangliaPassword
| GangliaUrl
| GangliaUser
| HaproxyHealthCheckMethod
| HaproxyHealthCheckUrl
| HaproxyStatsPassword
| HaproxyStatsUrl
| HaproxyStatsUser
| JavaAppServer
| JavaAppServerVersion
| Jvm
| JvmOptions
| JvmVersion
| ManageBundler
| MemcachedMemory
| MysqlRootPassword
| MysqlRootPasswordUbiquitous
| NodejsVersion
| PassengerVersion
| RailsStack
| RubyVersion
| RubygemsVersion
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable LayerAttributesKeys
instance FromText LayerAttributesKeys where
parser = takeLowerText >>= \case
"bundlerversion" -> pure BundlerVersion
"enablehaproxystats" -> pure EnableHaproxyStats
"gangliapassword" -> pure GangliaPassword
"gangliaurl" -> pure GangliaUrl
"gangliauser" -> pure GangliaUser
"haproxyhealthcheckmethod" -> pure HaproxyHealthCheckMethod
"haproxyhealthcheckurl" -> pure HaproxyHealthCheckUrl
"haproxystatspassword" -> pure HaproxyStatsPassword
"haproxystatsurl" -> pure HaproxyStatsUrl
"haproxystatsuser" -> pure HaproxyStatsUser
"javaappserver" -> pure JavaAppServer
"javaappserverversion" -> pure JavaAppServerVersion
"jvm" -> pure Jvm
"jvmoptions" -> pure JvmOptions
"jvmversion" -> pure JvmVersion
"managebundler" -> pure ManageBundler
"memcachedmemory" -> pure MemcachedMemory
"mysqlrootpassword" -> pure MysqlRootPassword
"mysqlrootpasswordubiquitous" -> pure MysqlRootPasswordUbiquitous
"nodejsversion" -> pure NodejsVersion
"passengerversion" -> pure PassengerVersion
"railsstack" -> pure RailsStack
"rubyversion" -> pure RubyVersion
"rubygemsversion" -> pure RubygemsVersion
e -> fail $
"Failure parsing LayerAttributesKeys from " ++ show e
instance ToText LayerAttributesKeys where
toText = \case
BundlerVersion -> "BundlerVersion"
EnableHaproxyStats -> "EnableHaproxyStats"
GangliaPassword -> "GangliaPassword"
GangliaUrl -> "GangliaUrl"
GangliaUser -> "GangliaUser"
HaproxyHealthCheckMethod -> "HaproxyHealthCheckMethod"
HaproxyHealthCheckUrl -> "HaproxyHealthCheckUrl"
HaproxyStatsPassword -> "HaproxyStatsPassword"
HaproxyStatsUrl -> "HaproxyStatsUrl"
HaproxyStatsUser -> "HaproxyStatsUser"
JavaAppServer -> "JavaAppServer"
JavaAppServerVersion -> "JavaAppServerVersion"
Jvm -> "Jvm"
JvmOptions -> "JvmOptions"
JvmVersion -> "JvmVersion"
ManageBundler -> "ManageBundler"
MemcachedMemory -> "MemcachedMemory"
MysqlRootPassword -> "MysqlRootPassword"
MysqlRootPasswordUbiquitous -> "MysqlRootPasswordUbiquitous"
NodejsVersion -> "NodejsVersion"
PassengerVersion -> "PassengerVersion"
RailsStack -> "RailsStack"
RubyVersion -> "RubyVersion"
RubygemsVersion -> "RubygemsVersion"
instance ToByteString LayerAttributesKeys
instance ToHeader LayerAttributesKeys
instance ToQuery LayerAttributesKeys
instance FromJSON LayerAttributesKeys where
parseJSON = parseJSONText "LayerAttributesKeys"
instance ToJSON LayerAttributesKeys where
toJSON = toJSONText
data TemporaryCredential = TemporaryCredential
{ _tcInstanceId :: Maybe Text
, _tcPassword :: Maybe Text
, _tcUsername :: Maybe Text
, _tcValidForInMinutes :: Maybe Int
} deriving (Eq, Ord, Read, Show)
temporaryCredential :: TemporaryCredential
temporaryCredential = TemporaryCredential
{ _tcUsername = Nothing
, _tcPassword = Nothing
, _tcValidForInMinutes = Nothing
, _tcInstanceId = Nothing
}
tcInstanceId :: Lens' TemporaryCredential (Maybe Text)
tcInstanceId = lens _tcInstanceId (\s a -> s { _tcInstanceId = a })
tcPassword :: Lens' TemporaryCredential (Maybe Text)
tcPassword = lens _tcPassword (\s a -> s { _tcPassword = a })
tcUsername :: Lens' TemporaryCredential (Maybe Text)
tcUsername = lens _tcUsername (\s a -> s { _tcUsername = a })
tcValidForInMinutes :: Lens' TemporaryCredential (Maybe Int)
tcValidForInMinutes =
lens _tcValidForInMinutes (\s a -> s { _tcValidForInMinutes = a })
instance FromJSON TemporaryCredential where
parseJSON = withObject "TemporaryCredential" $ \o -> TemporaryCredential
<$> o .:? "InstanceId"
<*> o .:? "Password"
<*> o .:? "Username"
<*> o .:? "ValidForInMinutes"
instance ToJSON TemporaryCredential where
toJSON TemporaryCredential{..} = object
[ "Username" .= _tcUsername
, "Password" .= _tcPassword
, "ValidForInMinutes" .= _tcValidForInMinutes
, "InstanceId" .= _tcInstanceId
]
data VolumeConfiguration = VolumeConfiguration
{ _vcIops :: Maybe Int
, _vcMountPoint :: Text
, _vcNumberOfDisks :: Int
, _vcRaidLevel :: Maybe Int
, _vcSize :: Int
, _vcVolumeType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
volumeConfiguration :: Text
-> Int
-> Int
-> VolumeConfiguration
volumeConfiguration p1 p2 p3 = VolumeConfiguration
{ _vcMountPoint = p1
, _vcNumberOfDisks = p2
, _vcSize = p3
, _vcRaidLevel = Nothing
, _vcVolumeType = Nothing
, _vcIops = Nothing
}
vcIops :: Lens' VolumeConfiguration (Maybe Int)
vcIops = lens _vcIops (\s a -> s { _vcIops = a })
vcMountPoint :: Lens' VolumeConfiguration Text
vcMountPoint = lens _vcMountPoint (\s a -> s { _vcMountPoint = a })
vcNumberOfDisks :: Lens' VolumeConfiguration Int
vcNumberOfDisks = lens _vcNumberOfDisks (\s a -> s { _vcNumberOfDisks = a })
vcRaidLevel :: Lens' VolumeConfiguration (Maybe Int)
vcRaidLevel = lens _vcRaidLevel (\s a -> s { _vcRaidLevel = a })
vcSize :: Lens' VolumeConfiguration Int
vcSize = lens _vcSize (\s a -> s { _vcSize = a })
vcVolumeType :: Lens' VolumeConfiguration (Maybe Text)
vcVolumeType = lens _vcVolumeType (\s a -> s { _vcVolumeType = a })
instance FromJSON VolumeConfiguration where
parseJSON = withObject "VolumeConfiguration" $ \o -> VolumeConfiguration
<$> o .:? "Iops"
<*> o .: "MountPoint"
<*> o .: "NumberOfDisks"
<*> o .:? "RaidLevel"
<*> o .: "Size"
<*> o .:? "VolumeType"
instance ToJSON VolumeConfiguration where
toJSON VolumeConfiguration{..} = object
[ "MountPoint" .= _vcMountPoint
, "RaidLevel" .= _vcRaidLevel
, "NumberOfDisks" .= _vcNumberOfDisks
, "Size" .= _vcSize
, "VolumeType" .= _vcVolumeType
, "Iops" .= _vcIops
]
data VolumeType
= Gp2
| Io1
| Standard
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable VolumeType
instance FromText VolumeType where
parser = takeLowerText >>= \case
"gp2" -> pure Gp2
"io1" -> pure Io1
"standard" -> pure Standard
e -> fail $
"Failure parsing VolumeType from " ++ show e
instance ToText VolumeType where
toText = \case
Gp2 -> "gp2"
Io1 -> "io1"
Standard -> "standard"
instance ToByteString VolumeType
instance ToHeader VolumeType
instance ToQuery VolumeType
instance FromJSON VolumeType where
parseJSON = parseJSONText "VolumeType"
instance ToJSON VolumeType where
toJSON = toJSONText
data ReportedOs = ReportedOs
{ _roFamily :: Maybe Text
, _roName :: Maybe Text
, _roVersion :: Maybe Text
} deriving (Eq, Ord, Read, Show)
reportedOs :: ReportedOs
reportedOs = ReportedOs
{ _roFamily = Nothing
, _roName = Nothing
, _roVersion = Nothing
}
roFamily :: Lens' ReportedOs (Maybe Text)
roFamily = lens _roFamily (\s a -> s { _roFamily = a })
roName :: Lens' ReportedOs (Maybe Text)
roName = lens _roName (\s a -> s { _roName = a })
roVersion :: Lens' ReportedOs (Maybe Text)
roVersion = lens _roVersion (\s a -> s { _roVersion = a })
instance FromJSON ReportedOs where
parseJSON = withObject "ReportedOs" $ \o -> ReportedOs
<$> o .:? "Family"
<*> o .:? "Name"
<*> o .:? "Version"
instance ToJSON ReportedOs where
toJSON ReportedOs{..} = object
[ "Family" .= _roFamily
, "Name" .= _roName
, "Version" .= _roVersion
]
data Permission = Permission
{ _pAllowSsh :: Maybe Bool
, _pAllowSudo :: Maybe Bool
, _pIamUserArn :: Maybe Text
, _pLevel :: Maybe Text
, _pStackId :: Maybe Text
} deriving (Eq, Ord, Read, Show)
permission :: Permission
permission = Permission
{ _pStackId = Nothing
, _pIamUserArn = Nothing
, _pAllowSsh = Nothing
, _pAllowSudo = Nothing
, _pLevel = Nothing
}
pAllowSsh :: Lens' Permission (Maybe Bool)
pAllowSsh = lens _pAllowSsh (\s a -> s { _pAllowSsh = a })
pAllowSudo :: Lens' Permission (Maybe Bool)
pAllowSudo = lens _pAllowSudo (\s a -> s { _pAllowSudo = a })
pIamUserArn :: Lens' Permission (Maybe Text)
pIamUserArn = lens _pIamUserArn (\s a -> s { _pIamUserArn = a })
pLevel :: Lens' Permission (Maybe Text)
pLevel = lens _pLevel (\s a -> s { _pLevel = a })
pStackId :: Lens' Permission (Maybe Text)
pStackId = lens _pStackId (\s a -> s { _pStackId = a })
instance FromJSON Permission where
parseJSON = withObject "Permission" $ \o -> Permission
<$> o .:? "AllowSsh"
<*> o .:? "AllowSudo"
<*> o .:? "IamUserArn"
<*> o .:? "Level"
<*> o .:? "StackId"
instance ToJSON Permission where
toJSON Permission{..} = object
[ "StackId" .= _pStackId
, "IamUserArn" .= _pIamUserArn
, "AllowSsh" .= _pAllowSsh
, "AllowSudo" .= _pAllowSudo
, "Level" .= _pLevel
]
data EnvironmentVariable = EnvironmentVariable
{ _evKey :: Text
, _evSecure :: Maybe Bool
, _evValue :: Text
} deriving (Eq, Ord, Read, Show)
environmentVariable :: Text
-> Text
-> EnvironmentVariable
environmentVariable p1 p2 = EnvironmentVariable
{ _evKey = p1
, _evValue = p2
, _evSecure = Nothing
}
evKey :: Lens' EnvironmentVariable Text
evKey = lens _evKey (\s a -> s { _evKey = a })
evSecure :: Lens' EnvironmentVariable (Maybe Bool)
evSecure = lens _evSecure (\s a -> s { _evSecure = a })
evValue :: Lens' EnvironmentVariable Text
evValue = lens _evValue (\s a -> s { _evValue = a })
instance FromJSON EnvironmentVariable where
parseJSON = withObject "EnvironmentVariable" $ \o -> EnvironmentVariable
<$> o .: "Key"
<*> o .:? "Secure"
<*> o .: "Value"
instance ToJSON EnvironmentVariable where
toJSON EnvironmentVariable{..} = object
[ "Key" .= _evKey
, "Value" .= _evValue
, "Secure" .= _evSecure
]
data Layer = Layer
{ _lAttributes :: Map LayerAttributesKeys Text
, _lAutoAssignElasticIps :: Maybe Bool
, _lAutoAssignPublicIps :: Maybe Bool
, _lCreatedAt :: Maybe Text
, _lCustomInstanceProfileArn :: Maybe Text
, _lCustomRecipes :: Maybe Recipes
, _lCustomSecurityGroupIds :: List "CustomSecurityGroupIds" Text
, _lDefaultRecipes :: Maybe Recipes
, _lDefaultSecurityGroupNames :: List "DefaultSecurityGroupNames" Text
, _lEnableAutoHealing :: Maybe Bool
, _lInstallUpdatesOnBoot :: Maybe Bool
, _lLayerId :: Maybe Text
, _lLifecycleEventConfiguration :: Maybe LifecycleEventConfiguration
, _lName :: Maybe Text
, _lPackages :: List "Packages" Text
, _lShortname :: Maybe Text
, _lStackId :: Maybe Text
, _lType :: Maybe LayerType
, _lUseEbsOptimizedInstances :: Maybe Bool
, _lVolumeConfigurations :: List "VolumeConfigurations" VolumeConfiguration
} deriving (Eq, Read, Show)
layer :: Layer
layer = Layer
{ _lStackId = Nothing
, _lLayerId = Nothing
, _lType = Nothing
, _lName = Nothing
, _lShortname = Nothing
, _lAttributes = mempty
, _lCustomInstanceProfileArn = Nothing
, _lCustomSecurityGroupIds = mempty
, _lDefaultSecurityGroupNames = mempty
, _lPackages = mempty
, _lVolumeConfigurations = mempty
, _lEnableAutoHealing = Nothing
, _lAutoAssignElasticIps = Nothing
, _lAutoAssignPublicIps = Nothing
, _lDefaultRecipes = Nothing
, _lCustomRecipes = Nothing
, _lCreatedAt = Nothing
, _lInstallUpdatesOnBoot = Nothing
, _lUseEbsOptimizedInstances = Nothing
, _lLifecycleEventConfiguration = Nothing
}
lAttributes :: Lens' Layer (HashMap LayerAttributesKeys Text)
lAttributes = lens _lAttributes (\s a -> s { _lAttributes = a }) . _Map
lAutoAssignElasticIps :: Lens' Layer (Maybe Bool)
lAutoAssignElasticIps =
lens _lAutoAssignElasticIps (\s a -> s { _lAutoAssignElasticIps = a })
lAutoAssignPublicIps :: Lens' Layer (Maybe Bool)
lAutoAssignPublicIps =
lens _lAutoAssignPublicIps (\s a -> s { _lAutoAssignPublicIps = a })
lCreatedAt :: Lens' Layer (Maybe Text)
lCreatedAt = lens _lCreatedAt (\s a -> s { _lCreatedAt = a })
lCustomInstanceProfileArn :: Lens' Layer (Maybe Text)
lCustomInstanceProfileArn =
lens _lCustomInstanceProfileArn
(\s a -> s { _lCustomInstanceProfileArn = a })
lCustomRecipes :: Lens' Layer (Maybe Recipes)
lCustomRecipes = lens _lCustomRecipes (\s a -> s { _lCustomRecipes = a })
lCustomSecurityGroupIds :: Lens' Layer [Text]
lCustomSecurityGroupIds =
lens _lCustomSecurityGroupIds (\s a -> s { _lCustomSecurityGroupIds = a })
. _List
lDefaultRecipes :: Lens' Layer (Maybe Recipes)
lDefaultRecipes = lens _lDefaultRecipes (\s a -> s { _lDefaultRecipes = a })
lDefaultSecurityGroupNames :: Lens' Layer [Text]
lDefaultSecurityGroupNames =
lens _lDefaultSecurityGroupNames
(\s a -> s { _lDefaultSecurityGroupNames = a })
. _List
lEnableAutoHealing :: Lens' Layer (Maybe Bool)
lEnableAutoHealing =
lens _lEnableAutoHealing (\s a -> s { _lEnableAutoHealing = a })
lInstallUpdatesOnBoot :: Lens' Layer (Maybe Bool)
lInstallUpdatesOnBoot =
lens _lInstallUpdatesOnBoot (\s a -> s { _lInstallUpdatesOnBoot = a })
lLayerId :: Lens' Layer (Maybe Text)
lLayerId = lens _lLayerId (\s a -> s { _lLayerId = a })
lLifecycleEventConfiguration :: Lens' Layer (Maybe LifecycleEventConfiguration)
lLifecycleEventConfiguration =
lens _lLifecycleEventConfiguration
(\s a -> s { _lLifecycleEventConfiguration = a })
lName :: Lens' Layer (Maybe Text)
lName = lens _lName (\s a -> s { _lName = a })
lPackages :: Lens' Layer [Text]
lPackages = lens _lPackages (\s a -> s { _lPackages = a }) . _List
lShortname :: Lens' Layer (Maybe Text)
lShortname = lens _lShortname (\s a -> s { _lShortname = a })
lStackId :: Lens' Layer (Maybe Text)
lStackId = lens _lStackId (\s a -> s { _lStackId = a })
lType :: Lens' Layer (Maybe LayerType)
lType = lens _lType (\s a -> s { _lType = a })
lUseEbsOptimizedInstances :: Lens' Layer (Maybe Bool)
lUseEbsOptimizedInstances =
lens _lUseEbsOptimizedInstances
(\s a -> s { _lUseEbsOptimizedInstances = a })
lVolumeConfigurations :: Lens' Layer [VolumeConfiguration]
lVolumeConfigurations =
lens _lVolumeConfigurations (\s a -> s { _lVolumeConfigurations = a })
. _List
instance FromJSON Layer where
parseJSON = withObject "Layer" $ \o -> Layer
<$> o .:? "Attributes" .!= mempty
<*> o .:? "AutoAssignElasticIps"
<*> o .:? "AutoAssignPublicIps"
<*> o .:? "CreatedAt"
<*> o .:? "CustomInstanceProfileArn"
<*> o .:? "CustomRecipes"
<*> o .:? "CustomSecurityGroupIds" .!= mempty
<*> o .:? "DefaultRecipes"
<*> o .:? "DefaultSecurityGroupNames" .!= mempty
<*> o .:? "EnableAutoHealing"
<*> o .:? "InstallUpdatesOnBoot"
<*> o .:? "LayerId"
<*> o .:? "LifecycleEventConfiguration"
<*> o .:? "Name"
<*> o .:? "Packages" .!= mempty
<*> o .:? "Shortname"
<*> o .:? "StackId"
<*> o .:? "Type"
<*> o .:? "UseEbsOptimizedInstances"
<*> o .:? "VolumeConfigurations" .!= mempty
instance ToJSON Layer where
toJSON Layer{..} = object
[ "StackId" .= _lStackId
, "LayerId" .= _lLayerId
, "Type" .= _lType
, "Name" .= _lName
, "Shortname" .= _lShortname
, "Attributes" .= _lAttributes
, "CustomInstanceProfileArn" .= _lCustomInstanceProfileArn
, "CustomSecurityGroupIds" .= _lCustomSecurityGroupIds
, "DefaultSecurityGroupNames" .= _lDefaultSecurityGroupNames
, "Packages" .= _lPackages
, "VolumeConfigurations" .= _lVolumeConfigurations
, "EnableAutoHealing" .= _lEnableAutoHealing
, "AutoAssignElasticIps" .= _lAutoAssignElasticIps
, "AutoAssignPublicIps" .= _lAutoAssignPublicIps
, "DefaultRecipes" .= _lDefaultRecipes
, "CustomRecipes" .= _lCustomRecipes
, "CreatedAt" .= _lCreatedAt
, "InstallUpdatesOnBoot" .= _lInstallUpdatesOnBoot
, "UseEbsOptimizedInstances" .= _lUseEbsOptimizedInstances
, "LifecycleEventConfiguration" .= _lLifecycleEventConfiguration
]
data Recipes = Recipes
{ _rConfigure :: List "Configure" Text
, _rDeploy :: List "Deploy" Text
, _rSetup :: List "Setup" Text
, _rShutdown :: List "Shutdown" Text
, _rUndeploy :: List "Undeploy" Text
} deriving (Eq, Ord, Read, Show)
recipes :: Recipes
recipes = Recipes
{ _rSetup = mempty
, _rConfigure = mempty
, _rDeploy = mempty
, _rUndeploy = mempty
, _rShutdown = mempty
}
rConfigure :: Lens' Recipes [Text]
rConfigure = lens _rConfigure (\s a -> s { _rConfigure = a }) . _List
rDeploy :: Lens' Recipes [Text]
rDeploy = lens _rDeploy (\s a -> s { _rDeploy = a }) . _List
rSetup :: Lens' Recipes [Text]
rSetup = lens _rSetup (\s a -> s { _rSetup = a }) . _List
rShutdown :: Lens' Recipes [Text]
rShutdown = lens _rShutdown (\s a -> s { _rShutdown = a }) . _List
rUndeploy :: Lens' Recipes [Text]
rUndeploy = lens _rUndeploy (\s a -> s { _rUndeploy = a }) . _List
instance FromJSON Recipes where
parseJSON = withObject "Recipes" $ \o -> Recipes
<$> o .:? "Configure" .!= mempty
<*> o .:? "Deploy" .!= mempty
<*> o .:? "Setup" .!= mempty
<*> o .:? "Shutdown" .!= mempty
<*> o .:? "Undeploy" .!= mempty
instance ToJSON Recipes where
toJSON Recipes{..} = object
[ "Setup" .= _rSetup
, "Configure" .= _rConfigure
, "Deploy" .= _rDeploy
, "Undeploy" .= _rUndeploy
, "Shutdown" .= _rShutdown
]
data TimeBasedAutoScalingConfiguration = TimeBasedAutoScalingConfiguration
{ _tbascAutoScalingSchedule :: Maybe WeeklyAutoScalingSchedule
, _tbascInstanceId :: Maybe Text
} deriving (Eq, Read, Show)
timeBasedAutoScalingConfiguration :: TimeBasedAutoScalingConfiguration
timeBasedAutoScalingConfiguration = TimeBasedAutoScalingConfiguration
{ _tbascInstanceId = Nothing
, _tbascAutoScalingSchedule = Nothing
}
tbascAutoScalingSchedule :: Lens' TimeBasedAutoScalingConfiguration (Maybe WeeklyAutoScalingSchedule)
tbascAutoScalingSchedule =
lens _tbascAutoScalingSchedule
(\s a -> s { _tbascAutoScalingSchedule = a })
tbascInstanceId :: Lens' TimeBasedAutoScalingConfiguration (Maybe Text)
tbascInstanceId = lens _tbascInstanceId (\s a -> s { _tbascInstanceId = a })
instance FromJSON TimeBasedAutoScalingConfiguration where
parseJSON = withObject "TimeBasedAutoScalingConfiguration" $ \o -> TimeBasedAutoScalingConfiguration
<$> o .:? "AutoScalingSchedule"
<*> o .:? "InstanceId"
instance ToJSON TimeBasedAutoScalingConfiguration where
toJSON TimeBasedAutoScalingConfiguration{..} = object
[ "InstanceId" .= _tbascInstanceId
, "AutoScalingSchedule" .= _tbascAutoScalingSchedule
]
data SelfUserProfile = SelfUserProfile
{ _supIamUserArn :: Maybe Text
, _supName :: Maybe Text
, _supSshPublicKey :: Maybe Text
, _supSshUsername :: Maybe Text
} deriving (Eq, Ord, Read, Show)
selfUserProfile :: SelfUserProfile
selfUserProfile = SelfUserProfile
{ _supIamUserArn = Nothing
, _supName = Nothing
, _supSshUsername = Nothing
, _supSshPublicKey = Nothing
}
supIamUserArn :: Lens' SelfUserProfile (Maybe Text)
supIamUserArn = lens _supIamUserArn (\s a -> s { _supIamUserArn = a })
supName :: Lens' SelfUserProfile (Maybe Text)
supName = lens _supName (\s a -> s { _supName = a })
supSshPublicKey :: Lens' SelfUserProfile (Maybe Text)
supSshPublicKey = lens _supSshPublicKey (\s a -> s { _supSshPublicKey = a })
supSshUsername :: Lens' SelfUserProfile (Maybe Text)
supSshUsername = lens _supSshUsername (\s a -> s { _supSshUsername = a })
instance FromJSON SelfUserProfile where
parseJSON = withObject "SelfUserProfile" $ \o -> SelfUserProfile
<$> o .:? "IamUserArn"
<*> o .:? "Name"
<*> o .:? "SshPublicKey"
<*> o .:? "SshUsername"
instance ToJSON SelfUserProfile where
toJSON SelfUserProfile{..} = object
[ "IamUserArn" .= _supIamUserArn
, "Name" .= _supName
, "SshUsername" .= _supSshUsername
, "SshPublicKey" .= _supSshPublicKey
]
data RootDeviceType
= Ebs
| InstanceStore
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable RootDeviceType
instance FromText RootDeviceType where
parser = takeLowerText >>= \case
"ebs" -> pure Ebs
"instance-store" -> pure InstanceStore
e -> fail $
"Failure parsing RootDeviceType from " ++ show e
instance ToText RootDeviceType where
toText = \case
Ebs -> "ebs"
InstanceStore -> "instance-store"
instance ToByteString RootDeviceType
instance ToHeader RootDeviceType
instance ToQuery RootDeviceType
instance FromJSON RootDeviceType where
parseJSON = parseJSONText "RootDeviceType"
instance ToJSON RootDeviceType where
toJSON = toJSONText
data Stack = Stack
{ _sArn :: Maybe Text
, _sAttributes :: Map StackAttributesKeys Text
, _sChefConfiguration :: Maybe ChefConfiguration
, _sConfigurationManager :: Maybe StackConfigurationManager
, _sCreatedAt :: Maybe Text
, _sCustomCookbooksSource :: Maybe Source
, _sCustomJson :: Maybe Text
, _sDefaultAvailabilityZone :: Maybe Text
, _sDefaultInstanceProfileArn :: Maybe Text
, _sDefaultOs :: Maybe Text
, _sDefaultRootDeviceType :: Maybe RootDeviceType
, _sDefaultSshKeyName :: Maybe Text
, _sDefaultSubnetId :: Maybe Text
, _sHostnameTheme :: Maybe Text
, _sName :: Maybe Text
, _sRegion :: Maybe Text
, _sServiceRoleArn :: Maybe Text
, _sStackId :: Maybe Text
, _sUseCustomCookbooks :: Maybe Bool
, _sUseOpsworksSecurityGroups :: Maybe Bool
, _sVpcId :: Maybe Text
} deriving (Eq, Read, Show)
stack :: Stack
stack = Stack
{ _sStackId = Nothing
, _sName = Nothing
, _sArn = Nothing
, _sRegion = Nothing
, _sVpcId = Nothing
, _sAttributes = mempty
, _sServiceRoleArn = Nothing
, _sDefaultInstanceProfileArn = Nothing
, _sDefaultOs = Nothing
, _sHostnameTheme = Nothing
, _sDefaultAvailabilityZone = Nothing
, _sDefaultSubnetId = Nothing
, _sCustomJson = Nothing
, _sConfigurationManager = Nothing
, _sChefConfiguration = Nothing
, _sUseCustomCookbooks = Nothing
, _sUseOpsworksSecurityGroups = Nothing
, _sCustomCookbooksSource = Nothing
, _sDefaultSshKeyName = Nothing
, _sCreatedAt = Nothing
, _sDefaultRootDeviceType = Nothing
}
sArn :: Lens' Stack (Maybe Text)
sArn = lens _sArn (\s a -> s { _sArn = a })
sAttributes :: Lens' Stack (HashMap StackAttributesKeys Text)
sAttributes = lens _sAttributes (\s a -> s { _sAttributes = a }) . _Map
sChefConfiguration :: Lens' Stack (Maybe ChefConfiguration)
sChefConfiguration =
lens _sChefConfiguration (\s a -> s { _sChefConfiguration = a })
sConfigurationManager :: Lens' Stack (Maybe StackConfigurationManager)
sConfigurationManager =
lens _sConfigurationManager (\s a -> s { _sConfigurationManager = a })
sCreatedAt :: Lens' Stack (Maybe Text)
sCreatedAt = lens _sCreatedAt (\s a -> s { _sCreatedAt = a })
sCustomCookbooksSource :: Lens' Stack (Maybe Source)
sCustomCookbooksSource =
lens _sCustomCookbooksSource (\s a -> s { _sCustomCookbooksSource = a })
sCustomJson :: Lens' Stack (Maybe Text)
sCustomJson = lens _sCustomJson (\s a -> s { _sCustomJson = a })
sDefaultAvailabilityZone :: Lens' Stack (Maybe Text)
sDefaultAvailabilityZone =
lens _sDefaultAvailabilityZone
(\s a -> s { _sDefaultAvailabilityZone = a })
sDefaultInstanceProfileArn :: Lens' Stack (Maybe Text)
sDefaultInstanceProfileArn =
lens _sDefaultInstanceProfileArn
(\s a -> s { _sDefaultInstanceProfileArn = a })
sDefaultOs :: Lens' Stack (Maybe Text)
sDefaultOs = lens _sDefaultOs (\s a -> s { _sDefaultOs = a })
sDefaultRootDeviceType :: Lens' Stack (Maybe RootDeviceType)
sDefaultRootDeviceType =
lens _sDefaultRootDeviceType (\s a -> s { _sDefaultRootDeviceType = a })
sDefaultSshKeyName :: Lens' Stack (Maybe Text)
sDefaultSshKeyName =
lens _sDefaultSshKeyName (\s a -> s { _sDefaultSshKeyName = a })
sDefaultSubnetId :: Lens' Stack (Maybe Text)
sDefaultSubnetId = lens _sDefaultSubnetId (\s a -> s { _sDefaultSubnetId = a })
sHostnameTheme :: Lens' Stack (Maybe Text)
sHostnameTheme = lens _sHostnameTheme (\s a -> s { _sHostnameTheme = a })
sName :: Lens' Stack (Maybe Text)
sName = lens _sName (\s a -> s { _sName = a })
sRegion :: Lens' Stack (Maybe Text)
sRegion = lens _sRegion (\s a -> s { _sRegion = a })
sServiceRoleArn :: Lens' Stack (Maybe Text)
sServiceRoleArn = lens _sServiceRoleArn (\s a -> s { _sServiceRoleArn = a })
sStackId :: Lens' Stack (Maybe Text)
sStackId = lens _sStackId (\s a -> s { _sStackId = a })
sUseCustomCookbooks :: Lens' Stack (Maybe Bool)
sUseCustomCookbooks =
lens _sUseCustomCookbooks (\s a -> s { _sUseCustomCookbooks = a })
sUseOpsworksSecurityGroups :: Lens' Stack (Maybe Bool)
sUseOpsworksSecurityGroups =
lens _sUseOpsworksSecurityGroups
(\s a -> s { _sUseOpsworksSecurityGroups = a })
sVpcId :: Lens' Stack (Maybe Text)
sVpcId = lens _sVpcId (\s a -> s { _sVpcId = a })
instance FromJSON Stack where
parseJSON = withObject "Stack" $ \o -> Stack
<$> o .:? "Arn"
<*> o .:? "Attributes" .!= mempty
<*> o .:? "ChefConfiguration"
<*> o .:? "ConfigurationManager"
<*> o .:? "CreatedAt"
<*> o .:? "CustomCookbooksSource"
<*> o .:? "CustomJson"
<*> o .:? "DefaultAvailabilityZone"
<*> o .:? "DefaultInstanceProfileArn"
<*> o .:? "DefaultOs"
<*> o .:? "DefaultRootDeviceType"
<*> o .:? "DefaultSshKeyName"
<*> o .:? "DefaultSubnetId"
<*> o .:? "HostnameTheme"
<*> o .:? "Name"
<*> o .:? "Region"
<*> o .:? "ServiceRoleArn"
<*> o .:? "StackId"
<*> o .:? "UseCustomCookbooks"
<*> o .:? "UseOpsworksSecurityGroups"
<*> o .:? "VpcId"
instance ToJSON Stack where
toJSON Stack{..} = object
[ "StackId" .= _sStackId
, "Name" .= _sName
, "Arn" .= _sArn
, "Region" .= _sRegion
, "VpcId" .= _sVpcId
, "Attributes" .= _sAttributes
, "ServiceRoleArn" .= _sServiceRoleArn
, "DefaultInstanceProfileArn" .= _sDefaultInstanceProfileArn
, "DefaultOs" .= _sDefaultOs
, "HostnameTheme" .= _sHostnameTheme
, "DefaultAvailabilityZone" .= _sDefaultAvailabilityZone
, "DefaultSubnetId" .= _sDefaultSubnetId
, "CustomJson" .= _sCustomJson
, "ConfigurationManager" .= _sConfigurationManager
, "ChefConfiguration" .= _sChefConfiguration
, "UseCustomCookbooks" .= _sUseCustomCookbooks
, "UseOpsworksSecurityGroups" .= _sUseOpsworksSecurityGroups
, "CustomCookbooksSource" .= _sCustomCookbooksSource
, "DefaultSshKeyName" .= _sDefaultSshKeyName
, "CreatedAt" .= _sCreatedAt
, "DefaultRootDeviceType" .= _sDefaultRootDeviceType
]
data DeploymentCommand = DeploymentCommand
{ _dcArgs :: Map Text (List "Args" Text)
, _dcName :: DeploymentCommandName
} deriving (Eq, Read, Show)
deploymentCommand :: DeploymentCommandName
-> DeploymentCommand
deploymentCommand p1 = DeploymentCommand
{ _dcName = p1
, _dcArgs = mempty
}
dcArgs :: Lens' DeploymentCommand (HashMap Text [Text])
dcArgs = lens _dcArgs (\s a -> s { _dcArgs = a }) . _Map
dcName :: Lens' DeploymentCommand DeploymentCommandName
dcName = lens _dcName (\s a -> s { _dcName = a })
instance FromJSON DeploymentCommand where
parseJSON = withObject "DeploymentCommand" $ \o -> DeploymentCommand
<$> o .:? "Args" .!= mempty
<*> o .: "Name"
instance ToJSON DeploymentCommand where
toJSON DeploymentCommand{..} = object
[ "Name" .= _dcName
, "Args" .= _dcArgs
]
data WeeklyAutoScalingSchedule = WeeklyAutoScalingSchedule
{ _wassFriday :: Map Text Text
, _wassMonday :: Map Text Text
, _wassSaturday :: Map Text Text
, _wassSunday :: Map Text Text
, _wassThursday :: Map Text Text
, _wassTuesday :: Map Text Text
, _wassWednesday :: Map Text Text
} deriving (Eq, Read, Show)
weeklyAutoScalingSchedule :: WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule = WeeklyAutoScalingSchedule
{ _wassMonday = mempty
, _wassTuesday = mempty
, _wassWednesday = mempty
, _wassThursday = mempty
, _wassFriday = mempty
, _wassSaturday = mempty
, _wassSunday = mempty
}
wassFriday :: Lens' WeeklyAutoScalingSchedule (HashMap Text Text)
wassFriday = lens _wassFriday (\s a -> s { _wassFriday = a }) . _Map
wassMonday :: Lens' WeeklyAutoScalingSchedule (HashMap Text Text)
wassMonday = lens _wassMonday (\s a -> s { _wassMonday = a }) . _Map
wassSaturday :: Lens' WeeklyAutoScalingSchedule (HashMap Text Text)
wassSaturday = lens _wassSaturday (\s a -> s { _wassSaturday = a }) . _Map
wassSunday :: Lens' WeeklyAutoScalingSchedule (HashMap Text Text)
wassSunday = lens _wassSunday (\s a -> s { _wassSunday = a }) . _Map
wassThursday :: Lens' WeeklyAutoScalingSchedule (HashMap Text Text)
wassThursday = lens _wassThursday (\s a -> s { _wassThursday = a }) . _Map
wassTuesday :: Lens' WeeklyAutoScalingSchedule (HashMap Text Text)
wassTuesday = lens _wassTuesday (\s a -> s { _wassTuesday = a }) . _Map
wassWednesday :: Lens' WeeklyAutoScalingSchedule (HashMap Text Text)
wassWednesday = lens _wassWednesday (\s a -> s { _wassWednesday = a }) . _Map
instance FromJSON WeeklyAutoScalingSchedule where
parseJSON = withObject "WeeklyAutoScalingSchedule" $ \o -> WeeklyAutoScalingSchedule
<$> o .:? "Friday" .!= mempty
<*> o .:? "Monday" .!= mempty
<*> o .:? "Saturday" .!= mempty
<*> o .:? "Sunday" .!= mempty
<*> o .:? "Thursday" .!= mempty
<*> o .:? "Tuesday" .!= mempty
<*> o .:? "Wednesday" .!= mempty
instance ToJSON WeeklyAutoScalingSchedule where
toJSON WeeklyAutoScalingSchedule{..} = object
[ "Monday" .= _wassMonday
, "Tuesday" .= _wassTuesday
, "Wednesday" .= _wassWednesday
, "Thursday" .= _wassThursday
, "Friday" .= _wassFriday
, "Saturday" .= _wassSaturday
, "Sunday" .= _wassSunday
]
data DeploymentCommandName
= Deploy
| ExecuteRecipes
| InstallDependencies
| Restart
| Rollback
| Start
| Stop
| Undeploy
| UpdateCustomCookbooks
| UpdateDependencies
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable DeploymentCommandName
instance FromText DeploymentCommandName where
parser = takeLowerText >>= \case
"deploy" -> pure Deploy
"execute_recipes" -> pure ExecuteRecipes
"install_dependencies" -> pure InstallDependencies
"restart" -> pure Restart
"rollback" -> pure Rollback
"start" -> pure Start
"stop" -> pure Stop
"undeploy" -> pure Undeploy
"update_custom_cookbooks" -> pure UpdateCustomCookbooks
"update_dependencies" -> pure UpdateDependencies
e -> fail $
"Failure parsing DeploymentCommandName from " ++ show e
instance ToText DeploymentCommandName where
toText = \case
Deploy -> "deploy"
ExecuteRecipes -> "execute_recipes"
InstallDependencies -> "install_dependencies"
Restart -> "restart"
Rollback -> "rollback"
Start -> "start"
Stop -> "stop"
Undeploy -> "undeploy"
UpdateCustomCookbooks -> "update_custom_cookbooks"
UpdateDependencies -> "update_dependencies"
instance ToByteString DeploymentCommandName
instance ToHeader DeploymentCommandName
instance ToQuery DeploymentCommandName
instance FromJSON DeploymentCommandName where
parseJSON = parseJSONText "DeploymentCommandName"
instance ToJSON DeploymentCommandName where
toJSON = toJSONText
data Instance = Instance
{ _iAmiId :: Maybe Text
, _iArchitecture :: Maybe Architecture
, _iAutoScalingType :: Maybe AutoScalingType
, _iAvailabilityZone :: Maybe Text
, _iBlockDeviceMappings :: List "BlockDeviceMappings" BlockDeviceMapping
, _iCreatedAt :: Maybe Text
, _iEbsOptimized :: Maybe Bool
, _iEc2InstanceId :: Maybe Text
, _iElasticIp :: Maybe Text
, _iHostname :: Maybe Text
, _iInfrastructureClass :: Maybe Text
, _iInstallUpdatesOnBoot :: Maybe Bool
, _iInstanceId :: Maybe Text
, _iInstanceProfileArn :: Maybe Text
, _iInstanceType :: Maybe Text
, _iLastServiceErrorId :: Maybe Text
, _iLayerIds :: List "LayerIds" Text
, _iOs :: Maybe Text
, _iPrivateDns :: Maybe Text
, _iPrivateIp :: Maybe Text
, _iPublicDns :: Maybe Text
, _iPublicIp :: Maybe Text
, _iRegisteredBy :: Maybe Text
, _iReportedAgentVersion :: Maybe Text
, _iReportedOs :: Maybe ReportedOs
, _iRootDeviceType :: Maybe RootDeviceType
, _iRootDeviceVolumeId :: Maybe Text
, _iSecurityGroupIds :: List "SecurityGroupIds" Text
, _iSshHostDsaKeyFingerprint :: Maybe Text
, _iSshHostRsaKeyFingerprint :: Maybe Text
, _iSshKeyName :: Maybe Text
, _iStackId :: Maybe Text
, _iStatus :: Maybe Text
, _iSubnetId :: Maybe Text
, _iVirtualizationType :: Maybe VirtualizationType
} deriving (Eq, Read, Show)
instance' :: Instance
instance' = Instance
{ _iInstanceId = Nothing
, _iEc2InstanceId = Nothing
, _iVirtualizationType = Nothing
, _iHostname = Nothing
, _iStackId = Nothing
, _iLayerIds = mempty
, _iSecurityGroupIds = mempty
, _iInstanceType = Nothing
, _iInstanceProfileArn = Nothing
, _iStatus = Nothing
, _iOs = Nothing
, _iAmiId = Nothing
, _iAvailabilityZone = Nothing
, _iSubnetId = Nothing
, _iPublicDns = Nothing
, _iPrivateDns = Nothing
, _iPublicIp = Nothing
, _iPrivateIp = Nothing
, _iElasticIp = Nothing
, _iAutoScalingType = Nothing
, _iSshKeyName = Nothing
, _iSshHostRsaKeyFingerprint = Nothing
, _iSshHostDsaKeyFingerprint = Nothing
, _iCreatedAt = Nothing
, _iLastServiceErrorId = Nothing
, _iArchitecture = Nothing
, _iRootDeviceType = Nothing
, _iRootDeviceVolumeId = Nothing
, _iBlockDeviceMappings = mempty
, _iInstallUpdatesOnBoot = Nothing
, _iEbsOptimized = Nothing
, _iReportedAgentVersion = Nothing
, _iReportedOs = Nothing
, _iInfrastructureClass = Nothing
, _iRegisteredBy = Nothing
}
iAmiId :: Lens' Instance (Maybe Text)
iAmiId = lens _iAmiId (\s a -> s { _iAmiId = a })
iArchitecture :: Lens' Instance (Maybe Architecture)
iArchitecture = lens _iArchitecture (\s a -> s { _iArchitecture = a })
iAutoScalingType :: Lens' Instance (Maybe AutoScalingType)
iAutoScalingType = lens _iAutoScalingType (\s a -> s { _iAutoScalingType = a })
iAvailabilityZone :: Lens' Instance (Maybe Text)
iAvailabilityZone =
lens _iAvailabilityZone (\s a -> s { _iAvailabilityZone = a })
iBlockDeviceMappings :: Lens' Instance [BlockDeviceMapping]
iBlockDeviceMappings =
lens _iBlockDeviceMappings (\s a -> s { _iBlockDeviceMappings = a })
. _List
iCreatedAt :: Lens' Instance (Maybe Text)
iCreatedAt = lens _iCreatedAt (\s a -> s { _iCreatedAt = a })
iEbsOptimized :: Lens' Instance (Maybe Bool)
iEbsOptimized = lens _iEbsOptimized (\s a -> s { _iEbsOptimized = a })
iEc2InstanceId :: Lens' Instance (Maybe Text)
iEc2InstanceId = lens _iEc2InstanceId (\s a -> s { _iEc2InstanceId = a })
iElasticIp :: Lens' Instance (Maybe Text)
iElasticIp = lens _iElasticIp (\s a -> s { _iElasticIp = a })
iHostname :: Lens' Instance (Maybe Text)
iHostname = lens _iHostname (\s a -> s { _iHostname = a })
iInfrastructureClass :: Lens' Instance (Maybe Text)
iInfrastructureClass =
lens _iInfrastructureClass (\s a -> s { _iInfrastructureClass = a })
iInstallUpdatesOnBoot :: Lens' Instance (Maybe Bool)
iInstallUpdatesOnBoot =
lens _iInstallUpdatesOnBoot (\s a -> s { _iInstallUpdatesOnBoot = a })
iInstanceId :: Lens' Instance (Maybe Text)
iInstanceId = lens _iInstanceId (\s a -> s { _iInstanceId = a })
iInstanceProfileArn :: Lens' Instance (Maybe Text)
iInstanceProfileArn =
lens _iInstanceProfileArn (\s a -> s { _iInstanceProfileArn = a })
iInstanceType :: Lens' Instance (Maybe Text)
iInstanceType = lens _iInstanceType (\s a -> s { _iInstanceType = a })
iLastServiceErrorId :: Lens' Instance (Maybe Text)
iLastServiceErrorId =
lens _iLastServiceErrorId (\s a -> s { _iLastServiceErrorId = a })
iLayerIds :: Lens' Instance [Text]
iLayerIds = lens _iLayerIds (\s a -> s { _iLayerIds = a }) . _List
iOs :: Lens' Instance (Maybe Text)
iOs = lens _iOs (\s a -> s { _iOs = a })
iPrivateDns :: Lens' Instance (Maybe Text)
iPrivateDns = lens _iPrivateDns (\s a -> s { _iPrivateDns = a })
iPrivateIp :: Lens' Instance (Maybe Text)
iPrivateIp = lens _iPrivateIp (\s a -> s { _iPrivateIp = a })
iPublicDns :: Lens' Instance (Maybe Text)
iPublicDns = lens _iPublicDns (\s a -> s { _iPublicDns = a })
iPublicIp :: Lens' Instance (Maybe Text)
iPublicIp = lens _iPublicIp (\s a -> s { _iPublicIp = a })
iRegisteredBy :: Lens' Instance (Maybe Text)
iRegisteredBy = lens _iRegisteredBy (\s a -> s { _iRegisteredBy = a })
iReportedAgentVersion :: Lens' Instance (Maybe Text)
iReportedAgentVersion =
lens _iReportedAgentVersion (\s a -> s { _iReportedAgentVersion = a })
iReportedOs :: Lens' Instance (Maybe ReportedOs)
iReportedOs = lens _iReportedOs (\s a -> s { _iReportedOs = a })
iRootDeviceType :: Lens' Instance (Maybe RootDeviceType)
iRootDeviceType = lens _iRootDeviceType (\s a -> s { _iRootDeviceType = a })
iRootDeviceVolumeId :: Lens' Instance (Maybe Text)
iRootDeviceVolumeId =
lens _iRootDeviceVolumeId (\s a -> s { _iRootDeviceVolumeId = a })
iSecurityGroupIds :: Lens' Instance [Text]
iSecurityGroupIds =
lens _iSecurityGroupIds (\s a -> s { _iSecurityGroupIds = a })
. _List
iSshHostDsaKeyFingerprint :: Lens' Instance (Maybe Text)
iSshHostDsaKeyFingerprint =
lens _iSshHostDsaKeyFingerprint
(\s a -> s { _iSshHostDsaKeyFingerprint = a })
iSshHostRsaKeyFingerprint :: Lens' Instance (Maybe Text)
iSshHostRsaKeyFingerprint =
lens _iSshHostRsaKeyFingerprint
(\s a -> s { _iSshHostRsaKeyFingerprint = a })
iSshKeyName :: Lens' Instance (Maybe Text)
iSshKeyName = lens _iSshKeyName (\s a -> s { _iSshKeyName = a })
iStackId :: Lens' Instance (Maybe Text)
iStackId = lens _iStackId (\s a -> s { _iStackId = a })
iStatus :: Lens' Instance (Maybe Text)
iStatus = lens _iStatus (\s a -> s { _iStatus = a })
iSubnetId :: Lens' Instance (Maybe Text)
iSubnetId = lens _iSubnetId (\s a -> s { _iSubnetId = a })
iVirtualizationType :: Lens' Instance (Maybe VirtualizationType)
iVirtualizationType =
lens _iVirtualizationType (\s a -> s { _iVirtualizationType = a })
instance FromJSON Instance where
parseJSON = withObject "Instance" $ \o -> Instance
<$> o .:? "AmiId"
<*> o .:? "Architecture"
<*> o .:? "AutoScalingType"
<*> o .:? "AvailabilityZone"
<*> o .:? "BlockDeviceMappings" .!= mempty
<*> o .:? "CreatedAt"
<*> o .:? "EbsOptimized"
<*> o .:? "Ec2InstanceId"
<*> o .:? "ElasticIp"
<*> o .:? "Hostname"
<*> o .:? "InfrastructureClass"
<*> o .:? "InstallUpdatesOnBoot"
<*> o .:? "InstanceId"
<*> o .:? "InstanceProfileArn"
<*> o .:? "InstanceType"
<*> o .:? "LastServiceErrorId"
<*> o .:? "LayerIds" .!= mempty
<*> o .:? "Os"
<*> o .:? "PrivateDns"
<*> o .:? "PrivateIp"
<*> o .:? "PublicDns"
<*> o .:? "PublicIp"
<*> o .:? "RegisteredBy"
<*> o .:? "ReportedAgentVersion"
<*> o .:? "ReportedOs"
<*> o .:? "RootDeviceType"
<*> o .:? "RootDeviceVolumeId"
<*> o .:? "SecurityGroupIds" .!= mempty
<*> o .:? "SshHostDsaKeyFingerprint"
<*> o .:? "SshHostRsaKeyFingerprint"
<*> o .:? "SshKeyName"
<*> o .:? "StackId"
<*> o .:? "Status"
<*> o .:? "SubnetId"
<*> o .:? "VirtualizationType"
instance ToJSON Instance where
toJSON Instance{..} = object
[ "InstanceId" .= _iInstanceId
, "Ec2InstanceId" .= _iEc2InstanceId
, "VirtualizationType" .= _iVirtualizationType
, "Hostname" .= _iHostname
, "StackId" .= _iStackId
, "LayerIds" .= _iLayerIds
, "SecurityGroupIds" .= _iSecurityGroupIds
, "InstanceType" .= _iInstanceType
, "InstanceProfileArn" .= _iInstanceProfileArn
, "Status" .= _iStatus
, "Os" .= _iOs
, "AmiId" .= _iAmiId
, "AvailabilityZone" .= _iAvailabilityZone
, "SubnetId" .= _iSubnetId
, "PublicDns" .= _iPublicDns
, "PrivateDns" .= _iPrivateDns
, "PublicIp" .= _iPublicIp
, "PrivateIp" .= _iPrivateIp
, "ElasticIp" .= _iElasticIp
, "AutoScalingType" .= _iAutoScalingType
, "SshKeyName" .= _iSshKeyName
, "SshHostRsaKeyFingerprint" .= _iSshHostRsaKeyFingerprint
, "SshHostDsaKeyFingerprint" .= _iSshHostDsaKeyFingerprint
, "CreatedAt" .= _iCreatedAt
, "LastServiceErrorId" .= _iLastServiceErrorId
, "Architecture" .= _iArchitecture
, "RootDeviceType" .= _iRootDeviceType
, "RootDeviceVolumeId" .= _iRootDeviceVolumeId
, "BlockDeviceMappings" .= _iBlockDeviceMappings
, "InstallUpdatesOnBoot" .= _iInstallUpdatesOnBoot
, "EbsOptimized" .= _iEbsOptimized
, "ReportedAgentVersion" .= _iReportedAgentVersion
, "ReportedOs" .= _iReportedOs
, "InfrastructureClass" .= _iInfrastructureClass
, "RegisteredBy" .= _iRegisteredBy
]
data Deployment = Deployment
{ _dAppId :: Maybe Text
, _dCommand :: Maybe DeploymentCommand
, _dComment :: Maybe Text
, _dCompletedAt :: Maybe Text
, _dCreatedAt :: Maybe Text
, _dCustomJson :: Maybe Text
, _dDeploymentId :: Maybe Text
, _dDuration :: Maybe Int
, _dIamUserArn :: Maybe Text
, _dInstanceIds :: List "InstanceIds" Text
, _dStackId :: Maybe Text
, _dStatus :: Maybe Text
} deriving (Eq, Read, Show)
deployment :: Deployment
deployment = Deployment
{ _dDeploymentId = Nothing
, _dStackId = Nothing
, _dAppId = Nothing
, _dCreatedAt = Nothing
, _dCompletedAt = Nothing
, _dDuration = Nothing
, _dIamUserArn = Nothing
, _dComment = Nothing
, _dCommand = Nothing
, _dStatus = Nothing
, _dCustomJson = Nothing
, _dInstanceIds = mempty
}
dAppId :: Lens' Deployment (Maybe Text)
dAppId = lens _dAppId (\s a -> s { _dAppId = a })
dCommand :: Lens' Deployment (Maybe DeploymentCommand)
dCommand = lens _dCommand (\s a -> s { _dCommand = a })
dComment :: Lens' Deployment (Maybe Text)
dComment = lens _dComment (\s a -> s { _dComment = a })
dCompletedAt :: Lens' Deployment (Maybe Text)
dCompletedAt = lens _dCompletedAt (\s a -> s { _dCompletedAt = a })
dCreatedAt :: Lens' Deployment (Maybe Text)
dCreatedAt = lens _dCreatedAt (\s a -> s { _dCreatedAt = a })
dCustomJson :: Lens' Deployment (Maybe Text)
dCustomJson = lens _dCustomJson (\s a -> s { _dCustomJson = a })
dDeploymentId :: Lens' Deployment (Maybe Text)
dDeploymentId = lens _dDeploymentId (\s a -> s { _dDeploymentId = a })
dDuration :: Lens' Deployment (Maybe Int)
dDuration = lens _dDuration (\s a -> s { _dDuration = a })
dIamUserArn :: Lens' Deployment (Maybe Text)
dIamUserArn = lens _dIamUserArn (\s a -> s { _dIamUserArn = a })
dInstanceIds :: Lens' Deployment [Text]
dInstanceIds = lens _dInstanceIds (\s a -> s { _dInstanceIds = a }) . _List
dStackId :: Lens' Deployment (Maybe Text)
dStackId = lens _dStackId (\s a -> s { _dStackId = a })
dStatus :: Lens' Deployment (Maybe Text)
dStatus = lens _dStatus (\s a -> s { _dStatus = a })
instance FromJSON Deployment where
parseJSON = withObject "Deployment" $ \o -> Deployment
<$> o .:? "AppId"
<*> o .:? "Command"
<*> o .:? "Comment"
<*> o .:? "CompletedAt"
<*> o .:? "CreatedAt"
<*> o .:? "CustomJson"
<*> o .:? "DeploymentId"
<*> o .:? "Duration"
<*> o .:? "IamUserArn"
<*> o .:? "InstanceIds" .!= mempty
<*> o .:? "StackId"
<*> o .:? "Status"
instance ToJSON Deployment where
toJSON Deployment{..} = object
[ "DeploymentId" .= _dDeploymentId
, "StackId" .= _dStackId
, "AppId" .= _dAppId
, "CreatedAt" .= _dCreatedAt
, "CompletedAt" .= _dCompletedAt
, "Duration" .= _dDuration
, "IamUserArn" .= _dIamUserArn
, "Comment" .= _dComment
, "Command" .= _dCommand
, "Status" .= _dStatus
, "CustomJson" .= _dCustomJson
, "InstanceIds" .= _dInstanceIds
]
data InstancesCount = InstancesCount
{ _icAssigning :: Maybe Int
, _icBooting :: Maybe Int
, _icConnectionLost :: Maybe Int
, _icDeregistering :: Maybe Int
, _icOnline :: Maybe Int
, _icPending :: Maybe Int
, _icRebooting :: Maybe Int
, _icRegistered :: Maybe Int
, _icRegistering :: Maybe Int
, _icRequested :: Maybe Int
, _icRunningSetup :: Maybe Int
, _icSetupFailed :: Maybe Int
, _icShuttingDown :: Maybe Int
, _icStartFailed :: Maybe Int
, _icStopped :: Maybe Int
, _icStopping :: Maybe Int
, _icTerminated :: Maybe Int
, _icTerminating :: Maybe Int
, _icUnassigning :: Maybe Int
} deriving (Eq, Ord, Read, Show)
instancesCount :: InstancesCount
instancesCount = InstancesCount
{ _icAssigning = Nothing
, _icBooting = Nothing
, _icConnectionLost = Nothing
, _icDeregistering = Nothing
, _icOnline = Nothing
, _icPending = Nothing
, _icRebooting = Nothing
, _icRegistered = Nothing
, _icRegistering = Nothing
, _icRequested = Nothing
, _icRunningSetup = Nothing
, _icSetupFailed = Nothing
, _icShuttingDown = Nothing
, _icStartFailed = Nothing
, _icStopped = Nothing
, _icStopping = Nothing
, _icTerminated = Nothing
, _icTerminating = Nothing
, _icUnassigning = Nothing
}
icAssigning :: Lens' InstancesCount (Maybe Int)
icAssigning = lens _icAssigning (\s a -> s { _icAssigning = a })
icBooting :: Lens' InstancesCount (Maybe Int)
icBooting = lens _icBooting (\s a -> s { _icBooting = a })
icConnectionLost :: Lens' InstancesCount (Maybe Int)
icConnectionLost = lens _icConnectionLost (\s a -> s { _icConnectionLost = a })
icDeregistering :: Lens' InstancesCount (Maybe Int)
icDeregistering = lens _icDeregistering (\s a -> s { _icDeregistering = a })
icOnline :: Lens' InstancesCount (Maybe Int)
icOnline = lens _icOnline (\s a -> s { _icOnline = a })
icPending :: Lens' InstancesCount (Maybe Int)
icPending = lens _icPending (\s a -> s { _icPending = a })
icRebooting :: Lens' InstancesCount (Maybe Int)
icRebooting = lens _icRebooting (\s a -> s { _icRebooting = a })
icRegistered :: Lens' InstancesCount (Maybe Int)
icRegistered = lens _icRegistered (\s a -> s { _icRegistered = a })
icRegistering :: Lens' InstancesCount (Maybe Int)
icRegistering = lens _icRegistering (\s a -> s { _icRegistering = a })
icRequested :: Lens' InstancesCount (Maybe Int)
icRequested = lens _icRequested (\s a -> s { _icRequested = a })
icRunningSetup :: Lens' InstancesCount (Maybe Int)
icRunningSetup = lens _icRunningSetup (\s a -> s { _icRunningSetup = a })
icSetupFailed :: Lens' InstancesCount (Maybe Int)
icSetupFailed = lens _icSetupFailed (\s a -> s { _icSetupFailed = a })
icShuttingDown :: Lens' InstancesCount (Maybe Int)
icShuttingDown = lens _icShuttingDown (\s a -> s { _icShuttingDown = a })
icStartFailed :: Lens' InstancesCount (Maybe Int)
icStartFailed = lens _icStartFailed (\s a -> s { _icStartFailed = a })
icStopped :: Lens' InstancesCount (Maybe Int)
icStopped = lens _icStopped (\s a -> s { _icStopped = a })
icStopping :: Lens' InstancesCount (Maybe Int)
icStopping = lens _icStopping (\s a -> s { _icStopping = a })
icTerminated :: Lens' InstancesCount (Maybe Int)
icTerminated = lens _icTerminated (\s a -> s { _icTerminated = a })
icTerminating :: Lens' InstancesCount (Maybe Int)
icTerminating = lens _icTerminating (\s a -> s { _icTerminating = a })
icUnassigning :: Lens' InstancesCount (Maybe Int)
icUnassigning = lens _icUnassigning (\s a -> s { _icUnassigning = a })
instance FromJSON InstancesCount where
parseJSON = withObject "InstancesCount" $ \o -> InstancesCount
<$> o .:? "Assigning"
<*> o .:? "Booting"
<*> o .:? "ConnectionLost"
<*> o .:? "Deregistering"
<*> o .:? "Online"
<*> o .:? "Pending"
<*> o .:? "Rebooting"
<*> o .:? "Registered"
<*> o .:? "Registering"
<*> o .:? "Requested"
<*> o .:? "RunningSetup"
<*> o .:? "SetupFailed"
<*> o .:? "ShuttingDown"
<*> o .:? "StartFailed"
<*> o .:? "Stopped"
<*> o .:? "Stopping"
<*> o .:? "Terminated"
<*> o .:? "Terminating"
<*> o .:? "Unassigning"
instance ToJSON InstancesCount where
toJSON InstancesCount{..} = object
[ "Assigning" .= _icAssigning
, "Booting" .= _icBooting
, "ConnectionLost" .= _icConnectionLost
, "Deregistering" .= _icDeregistering
, "Online" .= _icOnline
, "Pending" .= _icPending
, "Rebooting" .= _icRebooting
, "Registered" .= _icRegistered
, "Registering" .= _icRegistering
, "Requested" .= _icRequested
, "RunningSetup" .= _icRunningSetup
, "SetupFailed" .= _icSetupFailed
, "ShuttingDown" .= _icShuttingDown
, "StartFailed" .= _icStartFailed
, "Stopped" .= _icStopped
, "Stopping" .= _icStopping
, "Terminated" .= _icTerminated
, "Terminating" .= _icTerminating
, "Unassigning" .= _icUnassigning
]
data AppType
= Java
| Nodejs
| Other
| Php
| Rails
| Static
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable AppType
instance FromText AppType where
parser = takeLowerText >>= \case
"java" -> pure Java
"nodejs" -> pure Nodejs
"other" -> pure Other
"php" -> pure Php
"rails" -> pure Rails
"static" -> pure Static
e -> fail $
"Failure parsing AppType from " ++ show e
instance ToText AppType where
toText = \case
Java -> "java"
Nodejs -> "nodejs"
Other -> "other"
Php -> "php"
Rails -> "rails"
Static -> "static"
instance ToByteString AppType
instance ToHeader AppType
instance ToQuery AppType
instance FromJSON AppType where
parseJSON = parseJSONText "AppType"
instance ToJSON AppType where
toJSON = toJSONText