module Network.TableStorage.Types (
AccountKey(..),
Signature(..),
AuthHeader(..),
Account(..),
SharedKeyAuth(..),
EntityKey(..),
EntityColumn(..),
Entity(..),
EntityQuery(..),
ComparisonType(..),
EntityFilter(..)
) where
import Data.Time ( UTCTime )
import Network.HTTP.Base ( RequestMethod )
newtype AccountKey = AccountKey { unAccountKey :: String } deriving (Show, Eq)
newtype Signature = Signature { unSignature :: String } deriving (Show, Eq)
newtype AuthHeader = AuthHeader { unAuthHeader :: String } deriving (Show, Eq)
data Account = Account
{ accountScheme :: String
, accountHost :: String
, accountPort :: Int
, accountKey :: AccountKey
, accountName :: String
, accountResourcePrefix :: String
} deriving (Show, Eq)
data SharedKeyAuth = SharedKeyAuth
{ sharedKeyAuthVerb :: RequestMethod
, sharedKeyAuthContentMD5 :: String
, sharedKeyAuthContentType :: String
, sharedKeyAuthDate :: String
, sharedKeyAuthCanonicalizedResource :: String
} deriving (Show, Eq)
data EntityKey = EntityKey
{ ekPartitionKey :: String
, ekRowKey :: String
} deriving (Show, Eq)
data EntityColumn =
EdmBinary (Maybe String) |
EdmBoolean (Maybe Bool) |
EdmDateTime (Maybe UTCTime) |
EdmDouble (Maybe Double) |
EdmGuid (Maybe String) |
EdmInt32 (Maybe Int) |
EdmInt64 (Maybe Int) |
EdmString (Maybe String)
deriving (Show, Eq)
data Entity = Entity { entityKey :: EntityKey,
entityColumns :: [(String, EntityColumn)] } deriving Show
data EntityQuery = EntityQuery
{ eqPageSize :: Maybe Int
, eqFilter :: Maybe EntityFilter
} deriving (Show, Eq)
data ComparisonType =
Equal |
GreaterThan |
GreaterThanOrEqual |
LessThan |
LessThanOrEqual |
NotEqual
deriving (Show, Eq)
data EntityFilter =
And [EntityFilter] |
Or [EntityFilter] |
Not EntityFilter |
CompareBoolean String Bool |
CompareDateTime String ComparisonType UTCTime |
CompareDouble String ComparisonType Double |
CompareGuid String String |
CompareInt32 String ComparisonType Integer |
CompareInt64 String ComparisonType Integer |
CompareString String ComparisonType String
deriving (Show, Eq)