module Stratosphere.ResourceProperties.ConnectionDrainingPolicy where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data ConnectionDrainingPolicy =
ConnectionDrainingPolicy
{ _connectionDrainingPolicyEnabled :: Val Bool'
, _connectionDrainingPolicyTimeout :: Maybe (Val Integer')
} deriving (Show, Generic)
instance ToJSON ConnectionDrainingPolicy where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 25, omitNothingFields = True }
instance FromJSON ConnectionDrainingPolicy where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 25, omitNothingFields = True }
connectionDrainingPolicy
:: Val Bool'
-> ConnectionDrainingPolicy
connectionDrainingPolicy enabledarg =
ConnectionDrainingPolicy
{ _connectionDrainingPolicyEnabled = enabledarg
, _connectionDrainingPolicyTimeout = Nothing
}
cdpEnabled :: Lens' ConnectionDrainingPolicy (Val Bool')
cdpEnabled = lens _connectionDrainingPolicyEnabled (\s a -> s { _connectionDrainingPolicyEnabled = a })
cdpTimeout :: Lens' ConnectionDrainingPolicy (Maybe (Val Integer'))
cdpTimeout = lens _connectionDrainingPolicyTimeout (\s a -> s { _connectionDrainingPolicyTimeout = a })