module Network.AWS.ElasticBeanstalk.Types
(
ElasticBeanstalk
, RESTError
, ns
, ApplicationDescription
, applicationDescription
, adApplicationName
, adConfigurationTemplates
, adDateCreated
, adDateUpdated
, adDescription
, adVersions
, EventSeverity (..)
, Tag
, tag
, tagKey
, tagValue
, EventDescription
, eventDescription
, edApplicationName
, edEnvironmentName
, edEventDate
, edMessage
, edRequestId
, edSeverity
, edTemplateName
, edVersionLabel
, LaunchConfiguration
, launchConfiguration
, lcName
, ApplicationVersionDescriptionMessage
, applicationVersionDescriptionMessage
, avdmApplicationVersion
, AutoScalingGroup
, autoScalingGroup
, asgName
, ConfigurationDeploymentStatus (..)
, ConfigurationOptionSetting
, configurationOptionSetting
, cosNamespace
, cosOptionName
, cosValue
, ConfigurationOptionValueType (..)
, ConfigurationSettingsDescription
, configurationSettingsDescription
, csdApplicationName
, csdDateCreated
, csdDateUpdated
, csdDeploymentStatus
, csdDescription
, csdEnvironmentName
, csdOptionSettings
, csdSolutionStackName
, csdTemplateName
, ApplicationVersionDescription
, applicationVersionDescription
, avdApplicationName
, avdDateCreated
, avdDateUpdated
, avdDescription
, avdSourceBundle
, avdVersionLabel
, OptionSpecification
, optionSpecification
, osNamespace
, osOptionName
, EnvironmentResourceDescription
, environmentResourceDescription
, erdAutoScalingGroups
, erdEnvironmentName
, erdInstances
, erdLaunchConfigurations
, erdLoadBalancers
, erdQueues
, erdTriggers
, Queue
, queue
, qName
, qURL
, EnvironmentStatus (..)
, LoadBalancerDescription
, loadBalancerDescription
, lbdDomain
, lbdListeners
, lbdLoadBalancerName
, ApplicationDescriptionMessage
, applicationDescriptionMessage
, admApplication
, EnvironmentTier
, environmentTier
, etName
, etType
, etVersion
, LoadBalancer
, loadBalancer
, lbName
, EnvironmentResourcesDescription
, environmentResourcesDescription
, erdLoadBalancer
, OptionRestrictionRegex
, optionRestrictionRegex
, orrLabel
, orrPattern
, ConfigurationOptionDescription
, configurationOptionDescription
, codChangeSeverity
, codDefaultValue
, codMaxLength
, codMaxValue
, codMinValue
, codName
, codNamespace
, codRegex
, codUserDefined
, codValueOptions
, codValueType
, SourceConfiguration
, sourceConfiguration
, scApplicationName
, scTemplateName
, EnvironmentInfoDescription
, environmentInfoDescription
, eidEc2InstanceId
, eidInfoType
, eidMessage
, eidSampleTimestamp
, S3Location
, s3Location
, slS3Bucket
, slS3Key
, ValidationMessage
, validationMessage
, vmMessage
, vmNamespace
, vmOptionName
, vmSeverity
, ValidationSeverity (..)
, Trigger
, trigger
, tName
, EnvironmentInfoType (..)
, EnvironmentDescription
, environmentDescription
, ed1ApplicationName
, ed1CNAME
, ed1DateCreated
, ed1DateUpdated
, ed1Description
, ed1EndpointURL
, ed1EnvironmentId
, ed1EnvironmentName
, ed1Health
, ed1Resources
, ed1SolutionStackName
, ed1Status
, ed1TemplateName
, ed1Tier
, ed1VersionLabel
, Listener
, listener
, lPort
, lProtocol
, EnvironmentHealth (..)
, Instance
, instance'
, iId
, SolutionStackDescription
, solutionStackDescription
, ssdPermittedFileTypes
, ssdSolutionStackName
) where
import Network.AWS.Prelude
import Network.AWS.Signing
import qualified GHC.Exts
data ElasticBeanstalk
instance AWSService ElasticBeanstalk where
type Sg ElasticBeanstalk = V4
type Er ElasticBeanstalk = RESTError
service = service'
where
service' :: Service ElasticBeanstalk
service' = Service
{ _svcAbbrev = "ElasticBeanstalk"
, _svcPrefix = "elasticbeanstalk"
, _svcVersion = "2010-12-01"
, _svcTargetPrefix = Nothing
, _svcJSONVersion = Nothing
, _svcHandle = handle
, _svcRetry = retry
}
handle :: Status
-> Maybe (LazyByteString -> ServiceError RESTError)
handle = restError statusSuccess service'
retry :: Retry ElasticBeanstalk
retry = Exponential
{ _retryBase = 0.05
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check :: Status
-> RESTError
-> Bool
check (statusCode -> s) (awsErrorCode -> e)
| s == 400 && "Throttling" == e = True
| s == 500 = True
| s == 509 = True
| s == 503 = True
| otherwise = False
ns :: Text
ns = "http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/"
data ApplicationDescription = ApplicationDescription
{ _adApplicationName :: Maybe Text
, _adConfigurationTemplates :: List "member" Text
, _adDateCreated :: Maybe ISO8601
, _adDateUpdated :: Maybe ISO8601
, _adDescription :: Maybe Text
, _adVersions :: List "member" Text
} deriving (Eq, Ord, Show)
applicationDescription :: ApplicationDescription
applicationDescription = ApplicationDescription
{ _adApplicationName = Nothing
, _adDescription = Nothing
, _adDateCreated = Nothing
, _adDateUpdated = Nothing
, _adVersions = mempty
, _adConfigurationTemplates = mempty
}
adApplicationName :: Lens' ApplicationDescription (Maybe Text)
adApplicationName =
lens _adApplicationName (\s a -> s { _adApplicationName = a })
adConfigurationTemplates :: Lens' ApplicationDescription [Text]
adConfigurationTemplates =
lens _adConfigurationTemplates
(\s a -> s { _adConfigurationTemplates = a })
. _List
adDateCreated :: Lens' ApplicationDescription (Maybe UTCTime)
adDateCreated = lens _adDateCreated (\s a -> s { _adDateCreated = a }) . mapping _Time
adDateUpdated :: Lens' ApplicationDescription (Maybe UTCTime)
adDateUpdated = lens _adDateUpdated (\s a -> s { _adDateUpdated = a }) . mapping _Time
adDescription :: Lens' ApplicationDescription (Maybe Text)
adDescription = lens _adDescription (\s a -> s { _adDescription = a })
adVersions :: Lens' ApplicationDescription [Text]
adVersions = lens _adVersions (\s a -> s { _adVersions = a }) . _List
instance FromXML ApplicationDescription where
parseXML x = ApplicationDescription
<$> x .@? "ApplicationName"
<*> x .@? "ConfigurationTemplates" .!@ mempty
<*> x .@? "DateCreated"
<*> x .@? "DateUpdated"
<*> x .@? "Description"
<*> x .@? "Versions" .!@ mempty
instance ToQuery ApplicationDescription where
toQuery ApplicationDescription{..} = mconcat
[ "ApplicationName" =? _adApplicationName
, "ConfigurationTemplates" =? _adConfigurationTemplates
, "DateCreated" =? _adDateCreated
, "DateUpdated" =? _adDateUpdated
, "Description" =? _adDescription
, "Versions" =? _adVersions
]
data EventSeverity
= Debug
| Error
| Fatal
| Info
| Trace
| Warn
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable EventSeverity
instance FromText EventSeverity where
parser = takeText >>= \case
"DEBUG" -> pure Debug
"ERROR" -> pure Error
"FATAL" -> pure Fatal
"INFO" -> pure Info
"TRACE" -> pure Trace
"WARN" -> pure Warn
e -> fail $
"Failure parsing EventSeverity from " ++ show e
instance ToText EventSeverity where
toText = \case
Debug -> "DEBUG"
Error -> "ERROR"
Fatal -> "FATAL"
Info -> "INFO"
Trace -> "TRACE"
Warn -> "WARN"
instance ToByteString EventSeverity
instance ToHeader EventSeverity
instance ToQuery EventSeverity
instance FromXML EventSeverity where
parseXML = parseXMLText "EventSeverity"
data Tag = Tag
{ _tagKey :: Maybe Text
, _tagValue :: Maybe Text
} deriving (Eq, Ord, Show)
tag :: Tag
tag = Tag
{ _tagKey = Nothing
, _tagValue = Nothing
}
tagKey :: Lens' Tag (Maybe Text)
tagKey = lens _tagKey (\s a -> s { _tagKey = a })
tagValue :: Lens' Tag (Maybe Text)
tagValue = lens _tagValue (\s a -> s { _tagValue = a })
instance FromXML Tag where
parseXML x = Tag
<$> x .@? "Key"
<*> x .@? "Value"
instance ToQuery Tag where
toQuery Tag{..} = mconcat
[ "Key" =? _tagKey
, "Value" =? _tagValue
]
data EventDescription = EventDescription
{ _edApplicationName :: Maybe Text
, _edEnvironmentName :: Maybe Text
, _edEventDate :: Maybe ISO8601
, _edMessage :: Maybe Text
, _edRequestId :: Maybe Text
, _edSeverity :: Maybe EventSeverity
, _edTemplateName :: Maybe Text
, _edVersionLabel :: Maybe Text
} deriving (Eq, Show)
eventDescription :: EventDescription
eventDescription = EventDescription
{ _edEventDate = Nothing
, _edMessage = Nothing
, _edApplicationName = Nothing
, _edVersionLabel = Nothing
, _edTemplateName = Nothing
, _edEnvironmentName = Nothing
, _edRequestId = Nothing
, _edSeverity = Nothing
}
edApplicationName :: Lens' EventDescription (Maybe Text)
edApplicationName =
lens _edApplicationName (\s a -> s { _edApplicationName = a })
edEnvironmentName :: Lens' EventDescription (Maybe Text)
edEnvironmentName =
lens _edEnvironmentName (\s a -> s { _edEnvironmentName = a })
edEventDate :: Lens' EventDescription (Maybe UTCTime)
edEventDate = lens _edEventDate (\s a -> s { _edEventDate = a }) . mapping _Time
edMessage :: Lens' EventDescription (Maybe Text)
edMessage = lens _edMessage (\s a -> s { _edMessage = a })
edRequestId :: Lens' EventDescription (Maybe Text)
edRequestId = lens _edRequestId (\s a -> s { _edRequestId = a })
edSeverity :: Lens' EventDescription (Maybe EventSeverity)
edSeverity = lens _edSeverity (\s a -> s { _edSeverity = a })
edTemplateName :: Lens' EventDescription (Maybe Text)
edTemplateName = lens _edTemplateName (\s a -> s { _edTemplateName = a })
edVersionLabel :: Lens' EventDescription (Maybe Text)
edVersionLabel = lens _edVersionLabel (\s a -> s { _edVersionLabel = a })
instance FromXML EventDescription where
parseXML x = EventDescription
<$> x .@? "ApplicationName"
<*> x .@? "EnvironmentName"
<*> x .@? "EventDate"
<*> x .@? "Message"
<*> x .@? "RequestId"
<*> x .@? "Severity"
<*> x .@? "TemplateName"
<*> x .@? "VersionLabel"
instance ToQuery EventDescription where
toQuery EventDescription{..} = mconcat
[ "ApplicationName" =? _edApplicationName
, "EnvironmentName" =? _edEnvironmentName
, "EventDate" =? _edEventDate
, "Message" =? _edMessage
, "RequestId" =? _edRequestId
, "Severity" =? _edSeverity
, "TemplateName" =? _edTemplateName
, "VersionLabel" =? _edVersionLabel
]
newtype LaunchConfiguration = LaunchConfiguration
{ _lcName :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
launchConfiguration :: LaunchConfiguration
launchConfiguration = LaunchConfiguration
{ _lcName = Nothing
}
lcName :: Lens' LaunchConfiguration (Maybe Text)
lcName = lens _lcName (\s a -> s { _lcName = a })
instance FromXML LaunchConfiguration where
parseXML x = LaunchConfiguration
<$> x .@? "Name"
instance ToQuery LaunchConfiguration where
toQuery LaunchConfiguration{..} = mconcat
[ "Name" =? _lcName
]
newtype ApplicationVersionDescriptionMessage = ApplicationVersionDescriptionMessage
{ _avdmApplicationVersion :: Maybe ApplicationVersionDescription
} deriving (Eq, Show)
applicationVersionDescriptionMessage :: ApplicationVersionDescriptionMessage
applicationVersionDescriptionMessage = ApplicationVersionDescriptionMessage
{ _avdmApplicationVersion = Nothing
}
avdmApplicationVersion :: Lens' ApplicationVersionDescriptionMessage (Maybe ApplicationVersionDescription)
avdmApplicationVersion =
lens _avdmApplicationVersion (\s a -> s { _avdmApplicationVersion = a })
instance FromXML ApplicationVersionDescriptionMessage where
parseXML x = ApplicationVersionDescriptionMessage
<$> x .@? "ApplicationVersion"
instance ToQuery ApplicationVersionDescriptionMessage where
toQuery ApplicationVersionDescriptionMessage{..} = mconcat
[ "ApplicationVersion" =? _avdmApplicationVersion
]
newtype AutoScalingGroup = AutoScalingGroup
{ _asgName :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
autoScalingGroup :: AutoScalingGroup
autoScalingGroup = AutoScalingGroup
{ _asgName = Nothing
}
asgName :: Lens' AutoScalingGroup (Maybe Text)
asgName = lens _asgName (\s a -> s { _asgName = a })
instance FromXML AutoScalingGroup where
parseXML x = AutoScalingGroup
<$> x .@? "Name"
instance ToQuery AutoScalingGroup where
toQuery AutoScalingGroup{..} = mconcat
[ "Name" =? _asgName
]
data ConfigurationDeploymentStatus
= Deployed
| Failed
| Pending
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ConfigurationDeploymentStatus
instance FromText ConfigurationDeploymentStatus where
parser = takeText >>= \case
"deployed" -> pure Deployed
"failed" -> pure Failed
"pending" -> pure Pending
e -> fail $
"Failure parsing ConfigurationDeploymentStatus from " ++ show e
instance ToText ConfigurationDeploymentStatus where
toText = \case
Deployed -> "deployed"
Failed -> "failed"
Pending -> "pending"
instance ToByteString ConfigurationDeploymentStatus
instance ToHeader ConfigurationDeploymentStatus
instance ToQuery ConfigurationDeploymentStatus
instance FromXML ConfigurationDeploymentStatus where
parseXML = parseXMLText "ConfigurationDeploymentStatus"
data ConfigurationOptionSetting = ConfigurationOptionSetting
{ _cosNamespace :: Maybe Text
, _cosOptionName :: Maybe Text
, _cosValue :: Maybe Text
} deriving (Eq, Ord, Show)
configurationOptionSetting :: ConfigurationOptionSetting
configurationOptionSetting = ConfigurationOptionSetting
{ _cosNamespace = Nothing
, _cosOptionName = Nothing
, _cosValue = Nothing
}
cosNamespace :: Lens' ConfigurationOptionSetting (Maybe Text)
cosNamespace = lens _cosNamespace (\s a -> s { _cosNamespace = a })
cosOptionName :: Lens' ConfigurationOptionSetting (Maybe Text)
cosOptionName = lens _cosOptionName (\s a -> s { _cosOptionName = a })
cosValue :: Lens' ConfigurationOptionSetting (Maybe Text)
cosValue = lens _cosValue (\s a -> s { _cosValue = a })
instance FromXML ConfigurationOptionSetting where
parseXML x = ConfigurationOptionSetting
<$> x .@? "Namespace"
<*> x .@? "OptionName"
<*> x .@? "Value"
instance ToQuery ConfigurationOptionSetting where
toQuery ConfigurationOptionSetting{..} = mconcat
[ "Namespace" =? _cosNamespace
, "OptionName" =? _cosOptionName
, "Value" =? _cosValue
]
data ConfigurationOptionValueType
= List'
| Scalar
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ConfigurationOptionValueType
instance FromText ConfigurationOptionValueType where
parser = takeText >>= \case
"List" -> pure List'
"Scalar" -> pure Scalar
e -> fail $
"Failure parsing ConfigurationOptionValueType from " ++ show e
instance ToText ConfigurationOptionValueType where
toText = \case
List' -> "List"
Scalar -> "Scalar"
instance ToByteString ConfigurationOptionValueType
instance ToHeader ConfigurationOptionValueType
instance ToQuery ConfigurationOptionValueType
instance FromXML ConfigurationOptionValueType where
parseXML = parseXMLText "ConfigurationOptionValueType"
data ConfigurationSettingsDescription = ConfigurationSettingsDescription
{ _csdApplicationName :: Maybe Text
, _csdDateCreated :: Maybe ISO8601
, _csdDateUpdated :: Maybe ISO8601
, _csdDeploymentStatus :: Maybe ConfigurationDeploymentStatus
, _csdDescription :: Maybe Text
, _csdEnvironmentName :: Maybe Text
, _csdOptionSettings :: List "member" ConfigurationOptionSetting
, _csdSolutionStackName :: Maybe Text
, _csdTemplateName :: Maybe Text
} deriving (Eq, Show)
configurationSettingsDescription :: ConfigurationSettingsDescription
configurationSettingsDescription = ConfigurationSettingsDescription
{ _csdSolutionStackName = Nothing
, _csdApplicationName = Nothing
, _csdTemplateName = Nothing
, _csdDescription = Nothing
, _csdEnvironmentName = Nothing
, _csdDeploymentStatus = Nothing
, _csdDateCreated = Nothing
, _csdDateUpdated = Nothing
, _csdOptionSettings = mempty
}
csdApplicationName :: Lens' ConfigurationSettingsDescription (Maybe Text)
csdApplicationName =
lens _csdApplicationName (\s a -> s { _csdApplicationName = a })
csdDateCreated :: Lens' ConfigurationSettingsDescription (Maybe UTCTime)
csdDateCreated = lens _csdDateCreated (\s a -> s { _csdDateCreated = a }) . mapping _Time
csdDateUpdated :: Lens' ConfigurationSettingsDescription (Maybe UTCTime)
csdDateUpdated = lens _csdDateUpdated (\s a -> s { _csdDateUpdated = a }) . mapping _Time
csdDeploymentStatus :: Lens' ConfigurationSettingsDescription (Maybe ConfigurationDeploymentStatus)
csdDeploymentStatus =
lens _csdDeploymentStatus (\s a -> s { _csdDeploymentStatus = a })
csdDescription :: Lens' ConfigurationSettingsDescription (Maybe Text)
csdDescription = lens _csdDescription (\s a -> s { _csdDescription = a })
csdEnvironmentName :: Lens' ConfigurationSettingsDescription (Maybe Text)
csdEnvironmentName =
lens _csdEnvironmentName (\s a -> s { _csdEnvironmentName = a })
csdOptionSettings :: Lens' ConfigurationSettingsDescription [ConfigurationOptionSetting]
csdOptionSettings =
lens _csdOptionSettings (\s a -> s { _csdOptionSettings = a })
. _List
csdSolutionStackName :: Lens' ConfigurationSettingsDescription (Maybe Text)
csdSolutionStackName =
lens _csdSolutionStackName (\s a -> s { _csdSolutionStackName = a })
csdTemplateName :: Lens' ConfigurationSettingsDescription (Maybe Text)
csdTemplateName = lens _csdTemplateName (\s a -> s { _csdTemplateName = a })
instance FromXML ConfigurationSettingsDescription where
parseXML x = ConfigurationSettingsDescription
<$> x .@? "ApplicationName"
<*> x .@? "DateCreated"
<*> x .@? "DateUpdated"
<*> x .@? "DeploymentStatus"
<*> x .@? "Description"
<*> x .@? "EnvironmentName"
<*> x .@? "OptionSettings" .!@ mempty
<*> x .@? "SolutionStackName"
<*> x .@? "TemplateName"
instance ToQuery ConfigurationSettingsDescription where
toQuery ConfigurationSettingsDescription{..} = mconcat
[ "ApplicationName" =? _csdApplicationName
, "DateCreated" =? _csdDateCreated
, "DateUpdated" =? _csdDateUpdated
, "DeploymentStatus" =? _csdDeploymentStatus
, "Description" =? _csdDescription
, "EnvironmentName" =? _csdEnvironmentName
, "OptionSettings" =? _csdOptionSettings
, "SolutionStackName" =? _csdSolutionStackName
, "TemplateName" =? _csdTemplateName
]
data ApplicationVersionDescription = ApplicationVersionDescription
{ _avdApplicationName :: Maybe Text
, _avdDateCreated :: Maybe ISO8601
, _avdDateUpdated :: Maybe ISO8601
, _avdDescription :: Maybe Text
, _avdSourceBundle :: Maybe S3Location
, _avdVersionLabel :: Maybe Text
} deriving (Eq, Show)
applicationVersionDescription :: ApplicationVersionDescription
applicationVersionDescription = ApplicationVersionDescription
{ _avdApplicationName = Nothing
, _avdDescription = Nothing
, _avdVersionLabel = Nothing
, _avdSourceBundle = Nothing
, _avdDateCreated = Nothing
, _avdDateUpdated = Nothing
}
avdApplicationName :: Lens' ApplicationVersionDescription (Maybe Text)
avdApplicationName =
lens _avdApplicationName (\s a -> s { _avdApplicationName = a })
avdDateCreated :: Lens' ApplicationVersionDescription (Maybe UTCTime)
avdDateCreated = lens _avdDateCreated (\s a -> s { _avdDateCreated = a }) . mapping _Time
avdDateUpdated :: Lens' ApplicationVersionDescription (Maybe UTCTime)
avdDateUpdated = lens _avdDateUpdated (\s a -> s { _avdDateUpdated = a }) . mapping _Time
avdDescription :: Lens' ApplicationVersionDescription (Maybe Text)
avdDescription = lens _avdDescription (\s a -> s { _avdDescription = a })
avdSourceBundle :: Lens' ApplicationVersionDescription (Maybe S3Location)
avdSourceBundle = lens _avdSourceBundle (\s a -> s { _avdSourceBundle = a })
avdVersionLabel :: Lens' ApplicationVersionDescription (Maybe Text)
avdVersionLabel = lens _avdVersionLabel (\s a -> s { _avdVersionLabel = a })
instance FromXML ApplicationVersionDescription where
parseXML x = ApplicationVersionDescription
<$> x .@? "ApplicationName"
<*> x .@? "DateCreated"
<*> x .@? "DateUpdated"
<*> x .@? "Description"
<*> x .@? "SourceBundle"
<*> x .@? "VersionLabel"
instance ToQuery ApplicationVersionDescription where
toQuery ApplicationVersionDescription{..} = mconcat
[ "ApplicationName" =? _avdApplicationName
, "DateCreated" =? _avdDateCreated
, "DateUpdated" =? _avdDateUpdated
, "Description" =? _avdDescription
, "SourceBundle" =? _avdSourceBundle
, "VersionLabel" =? _avdVersionLabel
]
data OptionSpecification = OptionSpecification
{ _osNamespace :: Maybe Text
, _osOptionName :: Maybe Text
} deriving (Eq, Ord, Show)
optionSpecification :: OptionSpecification
optionSpecification = OptionSpecification
{ _osNamespace = Nothing
, _osOptionName = Nothing
}
osNamespace :: Lens' OptionSpecification (Maybe Text)
osNamespace = lens _osNamespace (\s a -> s { _osNamespace = a })
osOptionName :: Lens' OptionSpecification (Maybe Text)
osOptionName = lens _osOptionName (\s a -> s { _osOptionName = a })
instance FromXML OptionSpecification where
parseXML x = OptionSpecification
<$> x .@? "Namespace"
<*> x .@? "OptionName"
instance ToQuery OptionSpecification where
toQuery OptionSpecification{..} = mconcat
[ "Namespace" =? _osNamespace
, "OptionName" =? _osOptionName
]
data EnvironmentResourceDescription = EnvironmentResourceDescription
{ _erdAutoScalingGroups :: List "member" AutoScalingGroup
, _erdEnvironmentName :: Maybe Text
, _erdInstances :: List "member" Instance
, _erdLaunchConfigurations :: List "member" LaunchConfiguration
, _erdLoadBalancers :: List "member" LoadBalancer
, _erdQueues :: List "member" Queue
, _erdTriggers :: List "member" Trigger
} deriving (Eq, Show)
environmentResourceDescription :: EnvironmentResourceDescription
environmentResourceDescription = EnvironmentResourceDescription
{ _erdEnvironmentName = Nothing
, _erdAutoScalingGroups = mempty
, _erdInstances = mempty
, _erdLaunchConfigurations = mempty
, _erdLoadBalancers = mempty
, _erdTriggers = mempty
, _erdQueues = mempty
}
erdAutoScalingGroups :: Lens' EnvironmentResourceDescription [AutoScalingGroup]
erdAutoScalingGroups =
lens _erdAutoScalingGroups (\s a -> s { _erdAutoScalingGroups = a })
. _List
erdEnvironmentName :: Lens' EnvironmentResourceDescription (Maybe Text)
erdEnvironmentName =
lens _erdEnvironmentName (\s a -> s { _erdEnvironmentName = a })
erdInstances :: Lens' EnvironmentResourceDescription [Instance]
erdInstances = lens _erdInstances (\s a -> s { _erdInstances = a }) . _List
erdLaunchConfigurations :: Lens' EnvironmentResourceDescription [LaunchConfiguration]
erdLaunchConfigurations =
lens _erdLaunchConfigurations (\s a -> s { _erdLaunchConfigurations = a })
. _List
erdLoadBalancers :: Lens' EnvironmentResourceDescription [LoadBalancer]
erdLoadBalancers = lens _erdLoadBalancers (\s a -> s { _erdLoadBalancers = a }) . _List
erdQueues :: Lens' EnvironmentResourceDescription [Queue]
erdQueues = lens _erdQueues (\s a -> s { _erdQueues = a }) . _List
erdTriggers :: Lens' EnvironmentResourceDescription [Trigger]
erdTriggers = lens _erdTriggers (\s a -> s { _erdTriggers = a }) . _List
instance FromXML EnvironmentResourceDescription where
parseXML x = EnvironmentResourceDescription
<$> x .@? "AutoScalingGroups" .!@ mempty
<*> x .@? "EnvironmentName"
<*> x .@? "Instances" .!@ mempty
<*> x .@? "LaunchConfigurations" .!@ mempty
<*> x .@? "LoadBalancers" .!@ mempty
<*> x .@? "Queues" .!@ mempty
<*> x .@? "Triggers" .!@ mempty
instance ToQuery EnvironmentResourceDescription where
toQuery EnvironmentResourceDescription{..} = mconcat
[ "AutoScalingGroups" =? _erdAutoScalingGroups
, "EnvironmentName" =? _erdEnvironmentName
, "Instances" =? _erdInstances
, "LaunchConfigurations" =? _erdLaunchConfigurations
, "LoadBalancers" =? _erdLoadBalancers
, "Queues" =? _erdQueues
, "Triggers" =? _erdTriggers
]
data Queue = Queue
{ _qName :: Maybe Text
, _qURL :: Maybe Text
} deriving (Eq, Ord, Show)
queue :: Queue
queue = Queue
{ _qName = Nothing
, _qURL = Nothing
}
qName :: Lens' Queue (Maybe Text)
qName = lens _qName (\s a -> s { _qName = a })
qURL :: Lens' Queue (Maybe Text)
qURL = lens _qURL (\s a -> s { _qURL = a })
instance FromXML Queue where
parseXML x = Queue
<$> x .@? "Name"
<*> x .@? "URL"
instance ToQuery Queue where
toQuery Queue{..} = mconcat
[ "Name" =? _qName
, "URL" =? _qURL
]
data EnvironmentStatus
= Launching
| Ready
| Terminated
| Terminating
| Updating
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable EnvironmentStatus
instance FromText EnvironmentStatus where
parser = takeText >>= \case
"Launching" -> pure Launching
"Ready" -> pure Ready
"Terminated" -> pure Terminated
"Terminating" -> pure Terminating
"Updating" -> pure Updating
e -> fail $
"Failure parsing EnvironmentStatus from " ++ show e
instance ToText EnvironmentStatus where
toText = \case
Launching -> "Launching"
Ready -> "Ready"
Terminated -> "Terminated"
Terminating -> "Terminating"
Updating -> "Updating"
instance ToByteString EnvironmentStatus
instance ToHeader EnvironmentStatus
instance ToQuery EnvironmentStatus
instance FromXML EnvironmentStatus where
parseXML = parseXMLText "EnvironmentStatus"
data LoadBalancerDescription = LoadBalancerDescription
{ _lbdDomain :: Maybe Text
, _lbdListeners :: List "member" Listener
, _lbdLoadBalancerName :: Maybe Text
} deriving (Eq, Show)
loadBalancerDescription :: LoadBalancerDescription
loadBalancerDescription = LoadBalancerDescription
{ _lbdLoadBalancerName = Nothing
, _lbdDomain = Nothing
, _lbdListeners = mempty
}
lbdDomain :: Lens' LoadBalancerDescription (Maybe Text)
lbdDomain = lens _lbdDomain (\s a -> s { _lbdDomain = a })
lbdListeners :: Lens' LoadBalancerDescription [Listener]
lbdListeners = lens _lbdListeners (\s a -> s { _lbdListeners = a }) . _List
lbdLoadBalancerName :: Lens' LoadBalancerDescription (Maybe Text)
lbdLoadBalancerName =
lens _lbdLoadBalancerName (\s a -> s { _lbdLoadBalancerName = a })
instance FromXML LoadBalancerDescription where
parseXML x = LoadBalancerDescription
<$> x .@? "Domain"
<*> x .@? "Listeners" .!@ mempty
<*> x .@? "LoadBalancerName"
instance ToQuery LoadBalancerDescription where
toQuery LoadBalancerDescription{..} = mconcat
[ "Domain" =? _lbdDomain
, "Listeners" =? _lbdListeners
, "LoadBalancerName" =? _lbdLoadBalancerName
]
newtype ApplicationDescriptionMessage = ApplicationDescriptionMessage
{ _admApplication :: Maybe ApplicationDescription
} deriving (Eq, Show)
applicationDescriptionMessage :: ApplicationDescriptionMessage
applicationDescriptionMessage = ApplicationDescriptionMessage
{ _admApplication = Nothing
}
admApplication :: Lens' ApplicationDescriptionMessage (Maybe ApplicationDescription)
admApplication = lens _admApplication (\s a -> s { _admApplication = a })
instance FromXML ApplicationDescriptionMessage where
parseXML x = ApplicationDescriptionMessage
<$> x .@? "Application"
instance ToQuery ApplicationDescriptionMessage where
toQuery ApplicationDescriptionMessage{..} = mconcat
[ "Application" =? _admApplication
]
data EnvironmentTier = EnvironmentTier
{ _etName :: Maybe Text
, _etType :: Maybe Text
, _etVersion :: Maybe Text
} deriving (Eq, Ord, Show)
environmentTier :: EnvironmentTier
environmentTier = EnvironmentTier
{ _etName = Nothing
, _etType = Nothing
, _etVersion = Nothing
}
etName :: Lens' EnvironmentTier (Maybe Text)
etName = lens _etName (\s a -> s { _etName = a })
etType :: Lens' EnvironmentTier (Maybe Text)
etType = lens _etType (\s a -> s { _etType = a })
etVersion :: Lens' EnvironmentTier (Maybe Text)
etVersion = lens _etVersion (\s a -> s { _etVersion = a })
instance FromXML EnvironmentTier where
parseXML x = EnvironmentTier
<$> x .@? "Name"
<*> x .@? "Type"
<*> x .@? "Version"
instance ToQuery EnvironmentTier where
toQuery EnvironmentTier{..} = mconcat
[ "Name" =? _etName
, "Type" =? _etType
, "Version" =? _etVersion
]
newtype LoadBalancer = LoadBalancer
{ _lbName :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
loadBalancer :: LoadBalancer
loadBalancer = LoadBalancer
{ _lbName = Nothing
}
lbName :: Lens' LoadBalancer (Maybe Text)
lbName = lens _lbName (\s a -> s { _lbName = a })
instance FromXML LoadBalancer where
parseXML x = LoadBalancer
<$> x .@? "Name"
instance ToQuery LoadBalancer where
toQuery LoadBalancer{..} = mconcat
[ "Name" =? _lbName
]
newtype EnvironmentResourcesDescription = EnvironmentResourcesDescription
{ _erdLoadBalancer :: Maybe LoadBalancerDescription
} deriving (Eq, Show)
environmentResourcesDescription :: EnvironmentResourcesDescription
environmentResourcesDescription = EnvironmentResourcesDescription
{ _erdLoadBalancer = Nothing
}
erdLoadBalancer :: Lens' EnvironmentResourcesDescription (Maybe LoadBalancerDescription)
erdLoadBalancer = lens _erdLoadBalancer (\s a -> s { _erdLoadBalancer = a })
instance FromXML EnvironmentResourcesDescription where
parseXML x = EnvironmentResourcesDescription
<$> x .@? "LoadBalancer"
instance ToQuery EnvironmentResourcesDescription where
toQuery EnvironmentResourcesDescription{..} = mconcat
[ "LoadBalancer" =? _erdLoadBalancer
]
data OptionRestrictionRegex = OptionRestrictionRegex
{ _orrLabel :: Maybe Text
, _orrPattern :: Maybe Text
} deriving (Eq, Ord, Show)
optionRestrictionRegex :: OptionRestrictionRegex
optionRestrictionRegex = OptionRestrictionRegex
{ _orrPattern = Nothing
, _orrLabel = Nothing
}
orrLabel :: Lens' OptionRestrictionRegex (Maybe Text)
orrLabel = lens _orrLabel (\s a -> s { _orrLabel = a })
orrPattern :: Lens' OptionRestrictionRegex (Maybe Text)
orrPattern = lens _orrPattern (\s a -> s { _orrPattern = a })
instance FromXML OptionRestrictionRegex where
parseXML x = OptionRestrictionRegex
<$> x .@? "Label"
<*> x .@? "Pattern"
instance ToQuery OptionRestrictionRegex where
toQuery OptionRestrictionRegex{..} = mconcat
[ "Label" =? _orrLabel
, "Pattern" =? _orrPattern
]
data ConfigurationOptionDescription = ConfigurationOptionDescription
{ _codChangeSeverity :: Maybe Text
, _codDefaultValue :: Maybe Text
, _codMaxLength :: Maybe Int
, _codMaxValue :: Maybe Int
, _codMinValue :: Maybe Int
, _codName :: Maybe Text
, _codNamespace :: Maybe Text
, _codRegex :: Maybe OptionRestrictionRegex
, _codUserDefined :: Maybe Bool
, _codValueOptions :: List "member" Text
, _codValueType :: Maybe ConfigurationOptionValueType
} deriving (Eq, Show)
configurationOptionDescription :: ConfigurationOptionDescription
configurationOptionDescription = ConfigurationOptionDescription
{ _codNamespace = Nothing
, _codName = Nothing
, _codDefaultValue = Nothing
, _codChangeSeverity = Nothing
, _codUserDefined = Nothing
, _codValueType = Nothing
, _codValueOptions = mempty
, _codMinValue = Nothing
, _codMaxValue = Nothing
, _codMaxLength = Nothing
, _codRegex = Nothing
}
codChangeSeverity :: Lens' ConfigurationOptionDescription (Maybe Text)
codChangeSeverity =
lens _codChangeSeverity (\s a -> s { _codChangeSeverity = a })
codDefaultValue :: Lens' ConfigurationOptionDescription (Maybe Text)
codDefaultValue = lens _codDefaultValue (\s a -> s { _codDefaultValue = a })
codMaxLength :: Lens' ConfigurationOptionDescription (Maybe Int)
codMaxLength = lens _codMaxLength (\s a -> s { _codMaxLength = a })
codMaxValue :: Lens' ConfigurationOptionDescription (Maybe Int)
codMaxValue = lens _codMaxValue (\s a -> s { _codMaxValue = a })
codMinValue :: Lens' ConfigurationOptionDescription (Maybe Int)
codMinValue = lens _codMinValue (\s a -> s { _codMinValue = a })
codName :: Lens' ConfigurationOptionDescription (Maybe Text)
codName = lens _codName (\s a -> s { _codName = a })
codNamespace :: Lens' ConfigurationOptionDescription (Maybe Text)
codNamespace = lens _codNamespace (\s a -> s { _codNamespace = a })
codRegex :: Lens' ConfigurationOptionDescription (Maybe OptionRestrictionRegex)
codRegex = lens _codRegex (\s a -> s { _codRegex = a })
codUserDefined :: Lens' ConfigurationOptionDescription (Maybe Bool)
codUserDefined = lens _codUserDefined (\s a -> s { _codUserDefined = a })
codValueOptions :: Lens' ConfigurationOptionDescription [Text]
codValueOptions = lens _codValueOptions (\s a -> s { _codValueOptions = a }) . _List
codValueType :: Lens' ConfigurationOptionDescription (Maybe ConfigurationOptionValueType)
codValueType = lens _codValueType (\s a -> s { _codValueType = a })
instance FromXML ConfigurationOptionDescription where
parseXML x = ConfigurationOptionDescription
<$> x .@? "ChangeSeverity"
<*> x .@? "DefaultValue"
<*> x .@? "MaxLength"
<*> x .@? "MaxValue"
<*> x .@? "MinValue"
<*> x .@? "Name"
<*> x .@? "Namespace"
<*> x .@? "Regex"
<*> x .@? "UserDefined"
<*> x .@? "ValueOptions" .!@ mempty
<*> x .@? "ValueType"
instance ToQuery ConfigurationOptionDescription where
toQuery ConfigurationOptionDescription{..} = mconcat
[ "ChangeSeverity" =? _codChangeSeverity
, "DefaultValue" =? _codDefaultValue
, "MaxLength" =? _codMaxLength
, "MaxValue" =? _codMaxValue
, "MinValue" =? _codMinValue
, "Name" =? _codName
, "Namespace" =? _codNamespace
, "Regex" =? _codRegex
, "UserDefined" =? _codUserDefined
, "ValueOptions" =? _codValueOptions
, "ValueType" =? _codValueType
]
data SourceConfiguration = SourceConfiguration
{ _scApplicationName :: Maybe Text
, _scTemplateName :: Maybe Text
} deriving (Eq, Ord, Show)
sourceConfiguration :: SourceConfiguration
sourceConfiguration = SourceConfiguration
{ _scApplicationName = Nothing
, _scTemplateName = Nothing
}
scApplicationName :: Lens' SourceConfiguration (Maybe Text)
scApplicationName =
lens _scApplicationName (\s a -> s { _scApplicationName = a })
scTemplateName :: Lens' SourceConfiguration (Maybe Text)
scTemplateName = lens _scTemplateName (\s a -> s { _scTemplateName = a })
instance FromXML SourceConfiguration where
parseXML x = SourceConfiguration
<$> x .@? "ApplicationName"
<*> x .@? "TemplateName"
instance ToQuery SourceConfiguration where
toQuery SourceConfiguration{..} = mconcat
[ "ApplicationName" =? _scApplicationName
, "TemplateName" =? _scTemplateName
]
data EnvironmentInfoDescription = EnvironmentInfoDescription
{ _eidEc2InstanceId :: Maybe Text
, _eidInfoType :: Maybe EnvironmentInfoType
, _eidMessage :: Maybe Text
, _eidSampleTimestamp :: Maybe ISO8601
} deriving (Eq, Show)
environmentInfoDescription :: EnvironmentInfoDescription
environmentInfoDescription = EnvironmentInfoDescription
{ _eidInfoType = Nothing
, _eidEc2InstanceId = Nothing
, _eidSampleTimestamp = Nothing
, _eidMessage = Nothing
}
eidEc2InstanceId :: Lens' EnvironmentInfoDescription (Maybe Text)
eidEc2InstanceId = lens _eidEc2InstanceId (\s a -> s { _eidEc2InstanceId = a })
eidInfoType :: Lens' EnvironmentInfoDescription (Maybe EnvironmentInfoType)
eidInfoType = lens _eidInfoType (\s a -> s { _eidInfoType = a })
eidMessage :: Lens' EnvironmentInfoDescription (Maybe Text)
eidMessage = lens _eidMessage (\s a -> s { _eidMessage = a })
eidSampleTimestamp :: Lens' EnvironmentInfoDescription (Maybe UTCTime)
eidSampleTimestamp =
lens _eidSampleTimestamp (\s a -> s { _eidSampleTimestamp = a })
. mapping _Time
instance FromXML EnvironmentInfoDescription where
parseXML x = EnvironmentInfoDescription
<$> x .@? "Ec2InstanceId"
<*> x .@? "InfoType"
<*> x .@? "Message"
<*> x .@? "SampleTimestamp"
instance ToQuery EnvironmentInfoDescription where
toQuery EnvironmentInfoDescription{..} = mconcat
[ "Ec2InstanceId" =? _eidEc2InstanceId
, "InfoType" =? _eidInfoType
, "Message" =? _eidMessage
, "SampleTimestamp" =? _eidSampleTimestamp
]
data S3Location = S3Location
{ _slS3Bucket :: Maybe Text
, _slS3Key :: Maybe Text
} deriving (Eq, Ord, Show)
s3Location :: S3Location
s3Location = S3Location
{ _slS3Bucket = Nothing
, _slS3Key = Nothing
}
slS3Bucket :: Lens' S3Location (Maybe Text)
slS3Bucket = lens _slS3Bucket (\s a -> s { _slS3Bucket = a })
slS3Key :: Lens' S3Location (Maybe Text)
slS3Key = lens _slS3Key (\s a -> s { _slS3Key = a })
instance FromXML S3Location where
parseXML x = S3Location
<$> x .@? "S3Bucket"
<*> x .@? "S3Key"
instance ToQuery S3Location where
toQuery S3Location{..} = mconcat
[ "S3Bucket" =? _slS3Bucket
, "S3Key" =? _slS3Key
]
data ValidationMessage = ValidationMessage
{ _vmMessage :: Maybe Text
, _vmNamespace :: Maybe Text
, _vmOptionName :: Maybe Text
, _vmSeverity :: Maybe ValidationSeverity
} deriving (Eq, Show)
validationMessage :: ValidationMessage
validationMessage = ValidationMessage
{ _vmMessage = Nothing
, _vmSeverity = Nothing
, _vmNamespace = Nothing
, _vmOptionName = Nothing
}
vmMessage :: Lens' ValidationMessage (Maybe Text)
vmMessage = lens _vmMessage (\s a -> s { _vmMessage = a })
vmNamespace :: Lens' ValidationMessage (Maybe Text)
vmNamespace = lens _vmNamespace (\s a -> s { _vmNamespace = a })
vmOptionName :: Lens' ValidationMessage (Maybe Text)
vmOptionName = lens _vmOptionName (\s a -> s { _vmOptionName = a })
vmSeverity :: Lens' ValidationMessage (Maybe ValidationSeverity)
vmSeverity = lens _vmSeverity (\s a -> s { _vmSeverity = a })
instance FromXML ValidationMessage where
parseXML x = ValidationMessage
<$> x .@? "Message"
<*> x .@? "Namespace"
<*> x .@? "OptionName"
<*> x .@? "Severity"
instance ToQuery ValidationMessage where
toQuery ValidationMessage{..} = mconcat
[ "Message" =? _vmMessage
, "Namespace" =? _vmNamespace
, "OptionName" =? _vmOptionName
, "Severity" =? _vmSeverity
]
data ValidationSeverity
= VSError
| VSWarning
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ValidationSeverity
instance FromText ValidationSeverity where
parser = takeText >>= \case
"error" -> pure VSError
"warning" -> pure VSWarning
e -> fail $
"Failure parsing ValidationSeverity from " ++ show e
instance ToText ValidationSeverity where
toText = \case
VSError -> "error"
VSWarning -> "warning"
instance ToByteString ValidationSeverity
instance ToHeader ValidationSeverity
instance ToQuery ValidationSeverity
instance FromXML ValidationSeverity where
parseXML = parseXMLText "ValidationSeverity"
newtype Trigger = Trigger
{ _tName :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
trigger :: Trigger
trigger = Trigger
{ _tName = Nothing
}
tName :: Lens' Trigger (Maybe Text)
tName = lens _tName (\s a -> s { _tName = a })
instance FromXML Trigger where
parseXML x = Trigger
<$> x .@? "Name"
instance ToQuery Trigger where
toQuery Trigger{..} = mconcat
[ "Name" =? _tName
]
data EnvironmentInfoType
= Tail'
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable EnvironmentInfoType
instance FromText EnvironmentInfoType where
parser = takeText >>= \case
"tail" -> pure Tail'
e -> fail $
"Failure parsing EnvironmentInfoType from " ++ show e
instance ToText EnvironmentInfoType where
toText Tail' = "tail"
instance ToByteString EnvironmentInfoType
instance ToHeader EnvironmentInfoType
instance ToQuery EnvironmentInfoType
instance FromXML EnvironmentInfoType where
parseXML = parseXMLText "EnvironmentInfoType"
data EnvironmentDescription = EnvironmentDescription
{ _ed1ApplicationName :: Maybe Text
, _ed1CNAME :: Maybe Text
, _ed1DateCreated :: Maybe ISO8601
, _ed1DateUpdated :: Maybe ISO8601
, _ed1Description :: Maybe Text
, _ed1EndpointURL :: Maybe Text
, _ed1EnvironmentId :: Maybe Text
, _ed1EnvironmentName :: Maybe Text
, _ed1Health :: Maybe EnvironmentHealth
, _ed1Resources :: Maybe EnvironmentResourcesDescription
, _ed1SolutionStackName :: Maybe Text
, _ed1Status :: Maybe EnvironmentStatus
, _ed1TemplateName :: Maybe Text
, _ed1Tier :: Maybe EnvironmentTier
, _ed1VersionLabel :: Maybe Text
} deriving (Eq, Show)
environmentDescription :: EnvironmentDescription
environmentDescription = EnvironmentDescription
{ _ed1EnvironmentName = Nothing
, _ed1EnvironmentId = Nothing
, _ed1ApplicationName = Nothing
, _ed1VersionLabel = Nothing
, _ed1SolutionStackName = Nothing
, _ed1TemplateName = Nothing
, _ed1Description = Nothing
, _ed1EndpointURL = Nothing
, _ed1CNAME = Nothing
, _ed1DateCreated = Nothing
, _ed1DateUpdated = Nothing
, _ed1Status = Nothing
, _ed1Health = Nothing
, _ed1Resources = Nothing
, _ed1Tier = Nothing
}
ed1ApplicationName :: Lens' EnvironmentDescription (Maybe Text)
ed1ApplicationName =
lens _ed1ApplicationName (\s a -> s { _ed1ApplicationName = a })
ed1CNAME :: Lens' EnvironmentDescription (Maybe Text)
ed1CNAME = lens _ed1CNAME (\s a -> s { _ed1CNAME = a })
ed1DateCreated :: Lens' EnvironmentDescription (Maybe UTCTime)
ed1DateCreated = lens _ed1DateCreated (\s a -> s { _ed1DateCreated = a }) . mapping _Time
ed1DateUpdated :: Lens' EnvironmentDescription (Maybe UTCTime)
ed1DateUpdated = lens _ed1DateUpdated (\s a -> s { _ed1DateUpdated = a }) . mapping _Time
ed1Description :: Lens' EnvironmentDescription (Maybe Text)
ed1Description = lens _ed1Description (\s a -> s { _ed1Description = a })
ed1EndpointURL :: Lens' EnvironmentDescription (Maybe Text)
ed1EndpointURL = lens _ed1EndpointURL (\s a -> s { _ed1EndpointURL = a })
ed1EnvironmentId :: Lens' EnvironmentDescription (Maybe Text)
ed1EnvironmentId = lens _ed1EnvironmentId (\s a -> s { _ed1EnvironmentId = a })
ed1EnvironmentName :: Lens' EnvironmentDescription (Maybe Text)
ed1EnvironmentName =
lens _ed1EnvironmentName (\s a -> s { _ed1EnvironmentName = a })
ed1Health :: Lens' EnvironmentDescription (Maybe EnvironmentHealth)
ed1Health = lens _ed1Health (\s a -> s { _ed1Health = a })
ed1Resources :: Lens' EnvironmentDescription (Maybe EnvironmentResourcesDescription)
ed1Resources = lens _ed1Resources (\s a -> s { _ed1Resources = a })
ed1SolutionStackName :: Lens' EnvironmentDescription (Maybe Text)
ed1SolutionStackName =
lens _ed1SolutionStackName (\s a -> s { _ed1SolutionStackName = a })
ed1Status :: Lens' EnvironmentDescription (Maybe EnvironmentStatus)
ed1Status = lens _ed1Status (\s a -> s { _ed1Status = a })
ed1TemplateName :: Lens' EnvironmentDescription (Maybe Text)
ed1TemplateName = lens _ed1TemplateName (\s a -> s { _ed1TemplateName = a })
ed1Tier :: Lens' EnvironmentDescription (Maybe EnvironmentTier)
ed1Tier = lens _ed1Tier (\s a -> s { _ed1Tier = a })
ed1VersionLabel :: Lens' EnvironmentDescription (Maybe Text)
ed1VersionLabel = lens _ed1VersionLabel (\s a -> s { _ed1VersionLabel = a })
instance FromXML EnvironmentDescription where
parseXML x = EnvironmentDescription
<$> x .@? "ApplicationName"
<*> x .@? "CNAME"
<*> x .@? "DateCreated"
<*> x .@? "DateUpdated"
<*> x .@? "Description"
<*> x .@? "EndpointURL"
<*> x .@? "EnvironmentId"
<*> x .@? "EnvironmentName"
<*> x .@? "Health"
<*> x .@? "Resources"
<*> x .@? "SolutionStackName"
<*> x .@? "Status"
<*> x .@? "TemplateName"
<*> x .@? "Tier"
<*> x .@? "VersionLabel"
instance ToQuery EnvironmentDescription where
toQuery EnvironmentDescription{..} = mconcat
[ "ApplicationName" =? _ed1ApplicationName
, "CNAME" =? _ed1CNAME
, "DateCreated" =? _ed1DateCreated
, "DateUpdated" =? _ed1DateUpdated
, "Description" =? _ed1Description
, "EndpointURL" =? _ed1EndpointURL
, "EnvironmentId" =? _ed1EnvironmentId
, "EnvironmentName" =? _ed1EnvironmentName
, "Health" =? _ed1Health
, "Resources" =? _ed1Resources
, "SolutionStackName" =? _ed1SolutionStackName
, "Status" =? _ed1Status
, "TemplateName" =? _ed1TemplateName
, "Tier" =? _ed1Tier
, "VersionLabel" =? _ed1VersionLabel
]
data Listener = Listener
{ _lPort :: Maybe Int
, _lProtocol :: Maybe Text
} deriving (Eq, Ord, Show)
listener :: Listener
listener = Listener
{ _lProtocol = Nothing
, _lPort = Nothing
}
lPort :: Lens' Listener (Maybe Int)
lPort = lens _lPort (\s a -> s { _lPort = a })
lProtocol :: Lens' Listener (Maybe Text)
lProtocol = lens _lProtocol (\s a -> s { _lProtocol = a })
instance FromXML Listener where
parseXML x = Listener
<$> x .@? "Port"
<*> x .@? "Protocol"
instance ToQuery Listener where
toQuery Listener{..} = mconcat
[ "Port" =? _lPort
, "Protocol" =? _lProtocol
]
data EnvironmentHealth
= Green
| Grey
| Red
| Yellow
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable EnvironmentHealth
instance FromText EnvironmentHealth where
parser = takeText >>= \case
"Green" -> pure Green
"Grey" -> pure Grey
"Red" -> pure Red
"Yellow" -> pure Yellow
e -> fail $
"Failure parsing EnvironmentHealth from " ++ show e
instance ToText EnvironmentHealth where
toText = \case
Green -> "Green"
Grey -> "Grey"
Red -> "Red"
Yellow -> "Yellow"
instance ToByteString EnvironmentHealth
instance ToHeader EnvironmentHealth
instance ToQuery EnvironmentHealth
instance FromXML EnvironmentHealth where
parseXML = parseXMLText "EnvironmentHealth"
newtype Instance = Instance
{ _iId :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
instance' :: Instance
instance' = Instance
{ _iId = Nothing
}
iId :: Lens' Instance (Maybe Text)
iId = lens _iId (\s a -> s { _iId = a })
instance FromXML Instance where
parseXML x = Instance
<$> x .@? "Id"
instance ToQuery Instance where
toQuery Instance{..} = mconcat
[ "Id" =? _iId
]
data SolutionStackDescription = SolutionStackDescription
{ _ssdPermittedFileTypes :: List "member" Text
, _ssdSolutionStackName :: Maybe Text
} deriving (Eq, Ord, Show)
solutionStackDescription :: SolutionStackDescription
solutionStackDescription = SolutionStackDescription
{ _ssdSolutionStackName = Nothing
, _ssdPermittedFileTypes = mempty
}
ssdPermittedFileTypes :: Lens' SolutionStackDescription [Text]
ssdPermittedFileTypes =
lens _ssdPermittedFileTypes (\s a -> s { _ssdPermittedFileTypes = a })
. _List
ssdSolutionStackName :: Lens' SolutionStackDescription (Maybe Text)
ssdSolutionStackName =
lens _ssdSolutionStackName (\s a -> s { _ssdSolutionStackName = a })
instance FromXML SolutionStackDescription where
parseXML x = SolutionStackDescription
<$> x .@? "PermittedFileTypes" .!@ mempty
<*> x .@? "SolutionStackName"
instance ToQuery SolutionStackDescription where
toQuery SolutionStackDescription{..} = mconcat
[ "PermittedFileTypes" =? _ssdPermittedFileTypes
, "SolutionStackName" =? _ssdSolutionStackName
]