\subsection{Cardano.BM.Data.Rotation}
\label{code:Cardano.BM.Data.Rotation}

%if style == newcode
\begin{code}
{-# LANGUAGE DeriveAnyClass     #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE LambdaCase         #-}

module Cardano.BM.Data.Rotation
  ( RotationParameters (..)
  )
  where

import           Data.Aeson (FromJSON (..), ToJSON)

import           GHC.Generics (Generic)
import           GHC.Word (Word64)

\end{code}
%endif

\subsubsection{RotationParameters}\label{code:RotationParameters}\index{RotationParameters}
\label{code:rpLogLimitBytes}\index{RotationParameters!rpLogLimitBytes}
\label{code:rpMaxAgeHours}\index{RotationParameters!rpMaxAgeHours}
\label{code:rpKeepFilesNum}\index{RotationParameters!rpKeepFilesNum}
\begin{code}
data RotationParameters = RotationParameters
    { RotationParameters -> Word64
rpLogLimitBytes :: !Word64  -- max size of file in bytes
    , RotationParameters -> Word
rpMaxAgeHours   :: !Word    -- hours
    , RotationParameters -> Word
rpKeepFilesNum  :: !Word    -- number of files to keep
    } deriving ((forall x. RotationParameters -> Rep RotationParameters x)
-> (forall x. Rep RotationParameters x -> RotationParameters)
-> Generic RotationParameters
forall x. Rep RotationParameters x -> RotationParameters
forall x. RotationParameters -> Rep RotationParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RotationParameters x -> RotationParameters
$cfrom :: forall x. RotationParameters -> Rep RotationParameters x
Generic, Int -> RotationParameters -> ShowS
[RotationParameters] -> ShowS
RotationParameters -> String
(Int -> RotationParameters -> ShowS)
-> (RotationParameters -> String)
-> ([RotationParameters] -> ShowS)
-> Show RotationParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RotationParameters] -> ShowS
$cshowList :: [RotationParameters] -> ShowS
show :: RotationParameters -> String
$cshow :: RotationParameters -> String
showsPrec :: Int -> RotationParameters -> ShowS
$cshowsPrec :: Int -> RotationParameters -> ShowS
Show, RotationParameters -> RotationParameters -> Bool
(RotationParameters -> RotationParameters -> Bool)
-> (RotationParameters -> RotationParameters -> Bool)
-> Eq RotationParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RotationParameters -> RotationParameters -> Bool
$c/= :: RotationParameters -> RotationParameters -> Bool
== :: RotationParameters -> RotationParameters -> Bool
$c== :: RotationParameters -> RotationParameters -> Bool
Eq, Eq RotationParameters
Eq RotationParameters
-> (RotationParameters -> RotationParameters -> Ordering)
-> (RotationParameters -> RotationParameters -> Bool)
-> (RotationParameters -> RotationParameters -> Bool)
-> (RotationParameters -> RotationParameters -> Bool)
-> (RotationParameters -> RotationParameters -> Bool)
-> (RotationParameters -> RotationParameters -> RotationParameters)
-> (RotationParameters -> RotationParameters -> RotationParameters)
-> Ord RotationParameters
RotationParameters -> RotationParameters -> Bool
RotationParameters -> RotationParameters -> Ordering
RotationParameters -> RotationParameters -> RotationParameters
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: RotationParameters -> RotationParameters -> RotationParameters
$cmin :: RotationParameters -> RotationParameters -> RotationParameters
max :: RotationParameters -> RotationParameters -> RotationParameters
$cmax :: RotationParameters -> RotationParameters -> RotationParameters
>= :: RotationParameters -> RotationParameters -> Bool
$c>= :: RotationParameters -> RotationParameters -> Bool
> :: RotationParameters -> RotationParameters -> Bool
$c> :: RotationParameters -> RotationParameters -> Bool
<= :: RotationParameters -> RotationParameters -> Bool
$c<= :: RotationParameters -> RotationParameters -> Bool
< :: RotationParameters -> RotationParameters -> Bool
$c< :: RotationParameters -> RotationParameters -> Bool
compare :: RotationParameters -> RotationParameters -> Ordering
$ccompare :: RotationParameters -> RotationParameters -> Ordering
$cp1Ord :: Eq RotationParameters
Ord, Value -> Parser [RotationParameters]
Value -> Parser RotationParameters
(Value -> Parser RotationParameters)
-> (Value -> Parser [RotationParameters])
-> FromJSON RotationParameters
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [RotationParameters]
$cparseJSONList :: Value -> Parser [RotationParameters]
parseJSON :: Value -> Parser RotationParameters
$cparseJSON :: Value -> Parser RotationParameters
FromJSON, [RotationParameters] -> Encoding
[RotationParameters] -> Value
RotationParameters -> Encoding
RotationParameters -> Value
(RotationParameters -> Value)
-> (RotationParameters -> Encoding)
-> ([RotationParameters] -> Value)
-> ([RotationParameters] -> Encoding)
-> ToJSON RotationParameters
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [RotationParameters] -> Encoding
$ctoEncodingList :: [RotationParameters] -> Encoding
toJSONList :: [RotationParameters] -> Value
$ctoJSONList :: [RotationParameters] -> Value
toEncoding :: RotationParameters -> Encoding
$ctoEncoding :: RotationParameters -> Encoding
toJSON :: RotationParameters -> Value
$ctoJSON :: RotationParameters -> Value
ToJSON)

\end{code}