module TD.Data.PageBlockVerticalAlignment
  (PageBlockVerticalAlignment(..)) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I

-- | Describes a Vertical alignment of a table cell content
data PageBlockVerticalAlignment
  = PageBlockVerticalAlignmentTop -- ^ The content must be top-aligned
  | PageBlockVerticalAlignmentMiddle -- ^ The content must be middle-aligned
  | PageBlockVerticalAlignmentBottom -- ^ The content must be bottom-aligned
  deriving (PageBlockVerticalAlignment -> PageBlockVerticalAlignment -> Bool
(PageBlockVerticalAlignment -> PageBlockVerticalAlignment -> Bool)
-> (PageBlockVerticalAlignment
    -> PageBlockVerticalAlignment -> Bool)
-> Eq PageBlockVerticalAlignment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageBlockVerticalAlignment -> PageBlockVerticalAlignment -> Bool
== :: PageBlockVerticalAlignment -> PageBlockVerticalAlignment -> Bool
$c/= :: PageBlockVerticalAlignment -> PageBlockVerticalAlignment -> Bool
/= :: PageBlockVerticalAlignment -> PageBlockVerticalAlignment -> Bool
Eq, Int -> PageBlockVerticalAlignment -> ShowS
[PageBlockVerticalAlignment] -> ShowS
PageBlockVerticalAlignment -> String
(Int -> PageBlockVerticalAlignment -> ShowS)
-> (PageBlockVerticalAlignment -> String)
-> ([PageBlockVerticalAlignment] -> ShowS)
-> Show PageBlockVerticalAlignment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageBlockVerticalAlignment -> ShowS
showsPrec :: Int -> PageBlockVerticalAlignment -> ShowS
$cshow :: PageBlockVerticalAlignment -> String
show :: PageBlockVerticalAlignment -> String
$cshowList :: [PageBlockVerticalAlignment] -> ShowS
showList :: [PageBlockVerticalAlignment] -> ShowS
Show)

instance I.ShortShow PageBlockVerticalAlignment where
  shortShow :: PageBlockVerticalAlignment -> String
shortShow PageBlockVerticalAlignment
PageBlockVerticalAlignmentTop
      = String
"PageBlockVerticalAlignmentTop"
  shortShow PageBlockVerticalAlignment
PageBlockVerticalAlignmentMiddle
      = String
"PageBlockVerticalAlignmentMiddle"
  shortShow PageBlockVerticalAlignment
PageBlockVerticalAlignmentBottom
      = String
"PageBlockVerticalAlignmentBottom"

instance AT.FromJSON PageBlockVerticalAlignment where
  parseJSON :: Value -> Parser PageBlockVerticalAlignment
parseJSON (AT.Object Object
obj) = do
    String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String

    case String
t of
      String
"pageBlockVerticalAlignmentTop"    -> PageBlockVerticalAlignment -> Parser PageBlockVerticalAlignment
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PageBlockVerticalAlignment
PageBlockVerticalAlignmentTop
      String
"pageBlockVerticalAlignmentMiddle" -> PageBlockVerticalAlignment -> Parser PageBlockVerticalAlignment
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PageBlockVerticalAlignment
PageBlockVerticalAlignmentMiddle
      String
"pageBlockVerticalAlignmentBottom" -> PageBlockVerticalAlignment -> Parser PageBlockVerticalAlignment
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PageBlockVerticalAlignment
PageBlockVerticalAlignmentBottom
      String
_                                  -> Parser PageBlockVerticalAlignment
forall a. Monoid a => a
mempty
    
  parseJSON Value
_ = Parser PageBlockVerticalAlignment
forall a. Monoid a => a
mempty