module Network.Google.Datastore.Types.Sum where
import Network.Google.Prelude
data PropertyOrderDirection
= Ascending
| Descending
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable PropertyOrderDirection
instance FromText PropertyOrderDirection where
fromText = \case
"ASCENDING" -> Just Ascending
"DESCENDING" -> Just Descending
_ -> Nothing
instance ToText PropertyOrderDirection where
toText = \case
Ascending -> "ASCENDING"
Descending -> "DESCENDING"
instance FromJSON PropertyOrderDirection where
parseJSON = parseJSONText "PropertyOrderDirection"
instance ToJSON PropertyOrderDirection where
toJSON = toJSONText
data QueryResultBatchEntityResultType
= Full
| KeyOnly
| Projection
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable QueryResultBatchEntityResultType
instance FromText QueryResultBatchEntityResultType where
fromText = \case
"FULL" -> Just Full
"KEY_ONLY" -> Just KeyOnly
"PROJECTION" -> Just Projection
_ -> Nothing
instance ToText QueryResultBatchEntityResultType where
toText = \case
Full -> "FULL"
KeyOnly -> "KEY_ONLY"
Projection -> "PROJECTION"
instance FromJSON QueryResultBatchEntityResultType where
parseJSON = parseJSONText "QueryResultBatchEntityResultType"
instance ToJSON QueryResultBatchEntityResultType where
toJSON = toJSONText
data CompositeFilterOperator
= And
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable CompositeFilterOperator
instance FromText CompositeFilterOperator where
fromText = \case
"AND" -> Just And
_ -> Nothing
instance ToText CompositeFilterOperator where
toText = \case
And -> "AND"
instance FromJSON CompositeFilterOperator where
parseJSON = parseJSONText "CompositeFilterOperator"
instance ToJSON CompositeFilterOperator where
toJSON = toJSONText
data QueryResultBatchMoreResults
= MoreResultsAfterLimit
| NotFinished
| NoMoreResults
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable QueryResultBatchMoreResults
instance FromText QueryResultBatchMoreResults where
fromText = \case
"MORE_RESULTS_AFTER_LIMIT" -> Just MoreResultsAfterLimit
"NOT_FINISHED" -> Just NotFinished
"NO_MORE_RESULTS" -> Just NoMoreResults
_ -> Nothing
instance ToText QueryResultBatchMoreResults where
toText = \case
MoreResultsAfterLimit -> "MORE_RESULTS_AFTER_LIMIT"
NotFinished -> "NOT_FINISHED"
NoMoreResults -> "NO_MORE_RESULTS"
instance FromJSON QueryResultBatchMoreResults where
parseJSON = parseJSONText "QueryResultBatchMoreResults"
instance ToJSON QueryResultBatchMoreResults where
toJSON = toJSONText
data ReadOptionsReadConsistency
= Default
| Eventual
| Strong
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable ReadOptionsReadConsistency
instance FromText ReadOptionsReadConsistency where
fromText = \case
"DEFAULT" -> Just Default
"EVENTUAL" -> Just Eventual
"STRONG" -> Just Strong
_ -> Nothing
instance ToText ReadOptionsReadConsistency where
toText = \case
Default -> "DEFAULT"
Eventual -> "EVENTUAL"
Strong -> "STRONG"
instance FromJSON ReadOptionsReadConsistency where
parseJSON = parseJSONText "ReadOptionsReadConsistency"
instance ToJSON ReadOptionsReadConsistency where
toJSON = toJSONText
data PropertyFilterOperator
= Equal
| GreaterThan
| GreaterThanOrEqual
| HasAncestor
| LessThan
| LessThanOrEqual
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable PropertyFilterOperator
instance FromText PropertyFilterOperator where
fromText = \case
"EQUAL" -> Just Equal
"GREATER_THAN" -> Just GreaterThan
"GREATER_THAN_OR_EQUAL" -> Just GreaterThanOrEqual
"HAS_ANCESTOR" -> Just HasAncestor
"LESS_THAN" -> Just LessThan
"LESS_THAN_OR_EQUAL" -> Just LessThanOrEqual
_ -> Nothing
instance ToText PropertyFilterOperator where
toText = \case
Equal -> "EQUAL"
GreaterThan -> "GREATER_THAN"
GreaterThanOrEqual -> "GREATER_THAN_OR_EQUAL"
HasAncestor -> "HAS_ANCESTOR"
LessThan -> "LESS_THAN"
LessThanOrEqual -> "LESS_THAN_OR_EQUAL"
instance FromJSON PropertyFilterOperator where
parseJSON = parseJSONText "PropertyFilterOperator"
instance ToJSON PropertyFilterOperator where
toJSON = toJSONText
data BeginTransactionRequestIsolationLevel
= Serializable
| Snapshot
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable BeginTransactionRequestIsolationLevel
instance FromText BeginTransactionRequestIsolationLevel where
fromText = \case
"SERIALIZABLE" -> Just Serializable
"SNAPSHOT" -> Just Snapshot
_ -> Nothing
instance ToText BeginTransactionRequestIsolationLevel where
toText = \case
Serializable -> "SERIALIZABLE"
Snapshot -> "SNAPSHOT"
instance FromJSON BeginTransactionRequestIsolationLevel where
parseJSON = parseJSONText "BeginTransactionRequestIsolationLevel"
instance ToJSON BeginTransactionRequestIsolationLevel where
toJSON = toJSONText
data CommitRequestMode
= NonTransactional
| Transactional
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable CommitRequestMode
instance FromText CommitRequestMode where
fromText = \case
"NON_TRANSACTIONAL" -> Just NonTransactional
"TRANSACTIONAL" -> Just Transactional
_ -> Nothing
instance ToText CommitRequestMode where
toText = \case
NonTransactional -> "NON_TRANSACTIONAL"
Transactional -> "TRANSACTIONAL"
instance FromJSON CommitRequestMode where
parseJSON = parseJSONText "CommitRequestMode"
instance ToJSON CommitRequestMode where
toJSON = toJSONText
data PropertyExpressionAggregationFunction
= First
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable PropertyExpressionAggregationFunction
instance FromText PropertyExpressionAggregationFunction where
fromText = \case
"FIRST" -> Just First
_ -> Nothing
instance ToText PropertyExpressionAggregationFunction where
toText = \case
First -> "FIRST"
instance FromJSON PropertyExpressionAggregationFunction where
parseJSON = parseJSONText "PropertyExpressionAggregationFunction"
instance ToJSON PropertyExpressionAggregationFunction where
toJSON = toJSONText