module Kubernetes.Model.V1.Probe
( Probe (..)
, exec
, httpGet
, tcpSocket
, initialDelaySeconds
, timeoutSeconds
, periodSeconds
, successThreshold
, failureThreshold
, mkProbe
) where
import Control.Lens.TH (makeLenses)
import Data.Aeson.TH (defaultOptions,
deriveJSON,
fieldLabelModifier)
import GHC.Generics (Generic)
import Kubernetes.Model.V1.ExecAction (ExecAction)
import Kubernetes.Model.V1.HTTPGetAction (HTTPGetAction)
import Kubernetes.Model.V1.TCPSocketAction (TCPSocketAction)
import Prelude hiding (drop, error, max,
min)
import qualified Prelude as P
import Test.QuickCheck (Arbitrary, arbitrary)
import Test.QuickCheck.Instances ()
data Probe = Probe
{ _exec :: !(Maybe ExecAction)
, _httpGet :: !(Maybe HTTPGetAction)
, _tcpSocket :: !(Maybe TCPSocketAction)
, _initialDelaySeconds :: !(Maybe Integer)
, _timeoutSeconds :: !(Maybe Integer)
, _periodSeconds :: !(Maybe Integer)
, _successThreshold :: !(Maybe Integer)
, _failureThreshold :: !(Maybe Integer)
} deriving (Show, Eq, Generic)
makeLenses ''Probe
$(deriveJSON defaultOptions{fieldLabelModifier = (\n -> if n == "_type_" then "type" else P.drop 1 n)} ''Probe)
instance Arbitrary Probe where
arbitrary = Probe <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
mkProbe :: Probe
mkProbe = Probe Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing