module Stratosphere.ResourceProperties.HealthCheck where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data HealthCheck =
HealthCheck
{ _healthCheckHealthyThreshold :: Val Text
, _healthCheckInterval :: Val Text
, _healthCheckTarget :: Val Text
, _healthCheckTimeout :: Val Text
, _healthCheckUnhealthyThreshold :: Val Text
} deriving (Show, Generic)
instance ToJSON HealthCheck where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 12, omitNothingFields = True }
instance FromJSON HealthCheck where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 12, omitNothingFields = True }
healthCheck
:: Val Text
-> Val Text
-> Val Text
-> Val Text
-> Val Text
-> HealthCheck
healthCheck healthyThresholdarg intervalarg targetarg timeoutarg unhealthyThresholdarg =
HealthCheck
{ _healthCheckHealthyThreshold = healthyThresholdarg
, _healthCheckInterval = intervalarg
, _healthCheckTarget = targetarg
, _healthCheckTimeout = timeoutarg
, _healthCheckUnhealthyThreshold = unhealthyThresholdarg
}
hcHealthyThreshold :: Lens' HealthCheck (Val Text)
hcHealthyThreshold = lens _healthCheckHealthyThreshold (\s a -> s { _healthCheckHealthyThreshold = a })
hcInterval :: Lens' HealthCheck (Val Text)
hcInterval = lens _healthCheckInterval (\s a -> s { _healthCheckInterval = a })
hcTarget :: Lens' HealthCheck (Val Text)
hcTarget = lens _healthCheckTarget (\s a -> s { _healthCheckTarget = a })
hcTimeout :: Lens' HealthCheck (Val Text)
hcTimeout = lens _healthCheckTimeout (\s a -> s { _healthCheckTimeout = a })
hcUnhealthyThreshold :: Lens' HealthCheck (Val Text)
hcUnhealthyThreshold = lens _healthCheckUnhealthyThreshold (\s a -> s { _healthCheckUnhealthyThreshold = a })