module Hasura.RQL.Types.Schema.Options
( SchemaOptions (..),
StringifyNumbers (..),
DangerouslyCollapseBooleans (..),
InferFunctionPermissions (..),
RemoteSchemaPermissions (..),
OptimizePermissionFilters (..),
IncludeAggregationPredicates (..),
IncludeStreamFields (..),
IncludeUpdateManyFields (..),
BigQueryStringNumericInput (..),
IncludeGroupByAggregateFields (..),
UsePostgresArrays (..),
)
where
import Data.Aeson (FromJSON (..), ToJSON (..), Value (..), withBool)
import Hasura.Prelude
data SchemaOptions = SchemaOptions
{ SchemaOptions -> StringifyNumbers
soStringifyNumbers :: StringifyNumbers,
SchemaOptions -> DangerouslyCollapseBooleans
soDangerousBooleanCollapse :: DangerouslyCollapseBooleans,
SchemaOptions -> InferFunctionPermissions
soInferFunctionPermissions :: InferFunctionPermissions,
SchemaOptions -> OptimizePermissionFilters
soOptimizePermissionFilters :: OptimizePermissionFilters,
SchemaOptions -> IncludeUpdateManyFields
soIncludeUpdateManyFields :: IncludeUpdateManyFields,
SchemaOptions -> IncludeAggregationPredicates
soIncludeAggregationPredicates :: IncludeAggregationPredicates,
SchemaOptions -> IncludeStreamFields
soIncludeStreamFields :: IncludeStreamFields,
SchemaOptions -> BigQueryStringNumericInput
soBigQueryStringNumericInput :: BigQueryStringNumericInput,
SchemaOptions -> IncludeGroupByAggregateFields
soIncludeGroupByAggregateFields :: IncludeGroupByAggregateFields,
SchemaOptions -> UsePostgresArrays
soPostgresArrays :: UsePostgresArrays
}
data StringifyNumbers
= StringifyNumbers
| Don'tStringifyNumbers
deriving (StringifyNumbers -> StringifyNumbers -> Bool
(StringifyNumbers -> StringifyNumbers -> Bool)
-> (StringifyNumbers -> StringifyNumbers -> Bool)
-> Eq StringifyNumbers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StringifyNumbers -> StringifyNumbers -> Bool
== :: StringifyNumbers -> StringifyNumbers -> Bool
$c/= :: StringifyNumbers -> StringifyNumbers -> Bool
/= :: StringifyNumbers -> StringifyNumbers -> Bool
Eq, Int -> StringifyNumbers -> ShowS
[StringifyNumbers] -> ShowS
StringifyNumbers -> String
(Int -> StringifyNumbers -> ShowS)
-> (StringifyNumbers -> String)
-> ([StringifyNumbers] -> ShowS)
-> Show StringifyNumbers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StringifyNumbers -> ShowS
showsPrec :: Int -> StringifyNumbers -> ShowS
$cshow :: StringifyNumbers -> String
show :: StringifyNumbers -> String
$cshowList :: [StringifyNumbers] -> ShowS
showList :: [StringifyNumbers] -> ShowS
Show)
data IncludeUpdateManyFields
= IncludeUpdateManyFields
| Don'tIncludeUpdateManyFields
deriving (IncludeUpdateManyFields -> IncludeUpdateManyFields -> Bool
(IncludeUpdateManyFields -> IncludeUpdateManyFields -> Bool)
-> (IncludeUpdateManyFields -> IncludeUpdateManyFields -> Bool)
-> Eq IncludeUpdateManyFields
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IncludeUpdateManyFields -> IncludeUpdateManyFields -> Bool
== :: IncludeUpdateManyFields -> IncludeUpdateManyFields -> Bool
$c/= :: IncludeUpdateManyFields -> IncludeUpdateManyFields -> Bool
/= :: IncludeUpdateManyFields -> IncludeUpdateManyFields -> Bool
Eq, Int -> IncludeUpdateManyFields -> ShowS
[IncludeUpdateManyFields] -> ShowS
IncludeUpdateManyFields -> String
(Int -> IncludeUpdateManyFields -> ShowS)
-> (IncludeUpdateManyFields -> String)
-> ([IncludeUpdateManyFields] -> ShowS)
-> Show IncludeUpdateManyFields
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IncludeUpdateManyFields -> ShowS
showsPrec :: Int -> IncludeUpdateManyFields -> ShowS
$cshow :: IncludeUpdateManyFields -> String
show :: IncludeUpdateManyFields -> String
$cshowList :: [IncludeUpdateManyFields] -> ShowS
showList :: [IncludeUpdateManyFields] -> ShowS
Show)
data IncludeStreamFields
= IncludeStreamFields
| Don'tIncludeStreamFields
deriving (IncludeStreamFields -> IncludeStreamFields -> Bool
(IncludeStreamFields -> IncludeStreamFields -> Bool)
-> (IncludeStreamFields -> IncludeStreamFields -> Bool)
-> Eq IncludeStreamFields
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IncludeStreamFields -> IncludeStreamFields -> Bool
== :: IncludeStreamFields -> IncludeStreamFields -> Bool
$c/= :: IncludeStreamFields -> IncludeStreamFields -> Bool
/= :: IncludeStreamFields -> IncludeStreamFields -> Bool
Eq, Int -> IncludeStreamFields -> ShowS
[IncludeStreamFields] -> ShowS
IncludeStreamFields -> String
(Int -> IncludeStreamFields -> ShowS)
-> (IncludeStreamFields -> String)
-> ([IncludeStreamFields] -> ShowS)
-> Show IncludeStreamFields
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IncludeStreamFields -> ShowS
showsPrec :: Int -> IncludeStreamFields -> ShowS
$cshow :: IncludeStreamFields -> String
show :: IncludeStreamFields -> String
$cshowList :: [IncludeStreamFields] -> ShowS
showList :: [IncludeStreamFields] -> ShowS
Show)
data IncludeAggregationPredicates
= IncludeAggregationPredicates
| Don'tIncludeAggregationPredicates
data DangerouslyCollapseBooleans
= DangerouslyCollapseBooleans
| Don'tDangerouslyCollapseBooleans
deriving (DangerouslyCollapseBooleans -> DangerouslyCollapseBooleans -> Bool
(DangerouslyCollapseBooleans
-> DangerouslyCollapseBooleans -> Bool)
-> (DangerouslyCollapseBooleans
-> DangerouslyCollapseBooleans -> Bool)
-> Eq DangerouslyCollapseBooleans
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DangerouslyCollapseBooleans -> DangerouslyCollapseBooleans -> Bool
== :: DangerouslyCollapseBooleans -> DangerouslyCollapseBooleans -> Bool
$c/= :: DangerouslyCollapseBooleans -> DangerouslyCollapseBooleans -> Bool
/= :: DangerouslyCollapseBooleans -> DangerouslyCollapseBooleans -> Bool
Eq, Int -> DangerouslyCollapseBooleans -> ShowS
[DangerouslyCollapseBooleans] -> ShowS
DangerouslyCollapseBooleans -> String
(Int -> DangerouslyCollapseBooleans -> ShowS)
-> (DangerouslyCollapseBooleans -> String)
-> ([DangerouslyCollapseBooleans] -> ShowS)
-> Show DangerouslyCollapseBooleans
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DangerouslyCollapseBooleans -> ShowS
showsPrec :: Int -> DangerouslyCollapseBooleans -> ShowS
$cshow :: DangerouslyCollapseBooleans -> String
show :: DangerouslyCollapseBooleans -> String
$cshowList :: [DangerouslyCollapseBooleans] -> ShowS
showList :: [DangerouslyCollapseBooleans] -> ShowS
Show)
instance FromJSON DangerouslyCollapseBooleans where
parseJSON :: Value -> Parser DangerouslyCollapseBooleans
parseJSON =
String
-> (Bool -> Parser DangerouslyCollapseBooleans)
-> Value
-> Parser DangerouslyCollapseBooleans
forall a. String -> (Bool -> Parser a) -> Value -> Parser a
withBool String
"DangerouslyCollapseBooleans"
((Bool -> Parser DangerouslyCollapseBooleans)
-> Value -> Parser DangerouslyCollapseBooleans)
-> (Bool -> Parser DangerouslyCollapseBooleans)
-> Value
-> Parser DangerouslyCollapseBooleans
forall a b. (a -> b) -> a -> b
$ DangerouslyCollapseBooleans -> Parser DangerouslyCollapseBooleans
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
(DangerouslyCollapseBooleans -> Parser DangerouslyCollapseBooleans)
-> (Bool -> DangerouslyCollapseBooleans)
-> Bool
-> Parser DangerouslyCollapseBooleans
forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
Bool
True -> DangerouslyCollapseBooleans
DangerouslyCollapseBooleans
Bool
False -> DangerouslyCollapseBooleans
Don'tDangerouslyCollapseBooleans
instance ToJSON DangerouslyCollapseBooleans where
toJSON :: DangerouslyCollapseBooleans -> Value
toJSON = \case
DangerouslyCollapseBooleans
DangerouslyCollapseBooleans -> Bool -> Value
Bool Bool
True
DangerouslyCollapseBooleans
Don'tDangerouslyCollapseBooleans -> Bool -> Value
Bool Bool
False
data InferFunctionPermissions
= InferFunctionPermissions
| Don'tInferFunctionPermissions
deriving (InferFunctionPermissions -> InferFunctionPermissions -> Bool
(InferFunctionPermissions -> InferFunctionPermissions -> Bool)
-> (InferFunctionPermissions -> InferFunctionPermissions -> Bool)
-> Eq InferFunctionPermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InferFunctionPermissions -> InferFunctionPermissions -> Bool
== :: InferFunctionPermissions -> InferFunctionPermissions -> Bool
$c/= :: InferFunctionPermissions -> InferFunctionPermissions -> Bool
/= :: InferFunctionPermissions -> InferFunctionPermissions -> Bool
Eq, Int -> InferFunctionPermissions -> ShowS
[InferFunctionPermissions] -> ShowS
InferFunctionPermissions -> String
(Int -> InferFunctionPermissions -> ShowS)
-> (InferFunctionPermissions -> String)
-> ([InferFunctionPermissions] -> ShowS)
-> Show InferFunctionPermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InferFunctionPermissions -> ShowS
showsPrec :: Int -> InferFunctionPermissions -> ShowS
$cshow :: InferFunctionPermissions -> String
show :: InferFunctionPermissions -> String
$cshowList :: [InferFunctionPermissions] -> ShowS
showList :: [InferFunctionPermissions] -> ShowS
Show)
instance FromJSON InferFunctionPermissions where
parseJSON :: Value -> Parser InferFunctionPermissions
parseJSON =
String
-> (Bool -> Parser InferFunctionPermissions)
-> Value
-> Parser InferFunctionPermissions
forall a. String -> (Bool -> Parser a) -> Value -> Parser a
withBool String
"InferFunctionPermissions"
((Bool -> Parser InferFunctionPermissions)
-> Value -> Parser InferFunctionPermissions)
-> (Bool -> Parser InferFunctionPermissions)
-> Value
-> Parser InferFunctionPermissions
forall a b. (a -> b) -> a -> b
$ InferFunctionPermissions -> Parser InferFunctionPermissions
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
(InferFunctionPermissions -> Parser InferFunctionPermissions)
-> (Bool -> InferFunctionPermissions)
-> Bool
-> Parser InferFunctionPermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
Bool
True -> InferFunctionPermissions
InferFunctionPermissions
Bool
False -> InferFunctionPermissions
Don'tInferFunctionPermissions
instance ToJSON InferFunctionPermissions where
toJSON :: InferFunctionPermissions -> Value
toJSON = \case
InferFunctionPermissions
InferFunctionPermissions -> Bool -> Value
Bool Bool
True
InferFunctionPermissions
Don'tInferFunctionPermissions -> Bool -> Value
Bool Bool
False
data RemoteSchemaPermissions
= EnableRemoteSchemaPermissions
| DisableRemoteSchemaPermissions
deriving (RemoteSchemaPermissions -> RemoteSchemaPermissions -> Bool
(RemoteSchemaPermissions -> RemoteSchemaPermissions -> Bool)
-> (RemoteSchemaPermissions -> RemoteSchemaPermissions -> Bool)
-> Eq RemoteSchemaPermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoteSchemaPermissions -> RemoteSchemaPermissions -> Bool
== :: RemoteSchemaPermissions -> RemoteSchemaPermissions -> Bool
$c/= :: RemoteSchemaPermissions -> RemoteSchemaPermissions -> Bool
/= :: RemoteSchemaPermissions -> RemoteSchemaPermissions -> Bool
Eq, Int -> RemoteSchemaPermissions -> ShowS
[RemoteSchemaPermissions] -> ShowS
RemoteSchemaPermissions -> String
(Int -> RemoteSchemaPermissions -> ShowS)
-> (RemoteSchemaPermissions -> String)
-> ([RemoteSchemaPermissions] -> ShowS)
-> Show RemoteSchemaPermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoteSchemaPermissions -> ShowS
showsPrec :: Int -> RemoteSchemaPermissions -> ShowS
$cshow :: RemoteSchemaPermissions -> String
show :: RemoteSchemaPermissions -> String
$cshowList :: [RemoteSchemaPermissions] -> ShowS
showList :: [RemoteSchemaPermissions] -> ShowS
Show)
instance FromJSON RemoteSchemaPermissions where
parseJSON :: Value -> Parser RemoteSchemaPermissions
parseJSON =
String
-> (Bool -> Parser RemoteSchemaPermissions)
-> Value
-> Parser RemoteSchemaPermissions
forall a. String -> (Bool -> Parser a) -> Value -> Parser a
withBool String
"RemoteSchemaPermissions"
((Bool -> Parser RemoteSchemaPermissions)
-> Value -> Parser RemoteSchemaPermissions)
-> (Bool -> Parser RemoteSchemaPermissions)
-> Value
-> Parser RemoteSchemaPermissions
forall a b. (a -> b) -> a -> b
$ RemoteSchemaPermissions -> Parser RemoteSchemaPermissions
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
(RemoteSchemaPermissions -> Parser RemoteSchemaPermissions)
-> (Bool -> RemoteSchemaPermissions)
-> Bool
-> Parser RemoteSchemaPermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
Bool
True -> RemoteSchemaPermissions
EnableRemoteSchemaPermissions
Bool
False -> RemoteSchemaPermissions
DisableRemoteSchemaPermissions
instance ToJSON RemoteSchemaPermissions where
toJSON :: RemoteSchemaPermissions -> Value
toJSON = \case
RemoteSchemaPermissions
EnableRemoteSchemaPermissions -> Bool -> Value
Bool Bool
True
RemoteSchemaPermissions
DisableRemoteSchemaPermissions -> Bool -> Value
Bool Bool
False
data OptimizePermissionFilters
= OptimizePermissionFilters
| Don'tOptimizePermissionFilters
deriving (OptimizePermissionFilters -> OptimizePermissionFilters -> Bool
(OptimizePermissionFilters -> OptimizePermissionFilters -> Bool)
-> (OptimizePermissionFilters -> OptimizePermissionFilters -> Bool)
-> Eq OptimizePermissionFilters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OptimizePermissionFilters -> OptimizePermissionFilters -> Bool
== :: OptimizePermissionFilters -> OptimizePermissionFilters -> Bool
$c/= :: OptimizePermissionFilters -> OptimizePermissionFilters -> Bool
/= :: OptimizePermissionFilters -> OptimizePermissionFilters -> Bool
Eq, Int -> OptimizePermissionFilters -> ShowS
[OptimizePermissionFilters] -> ShowS
OptimizePermissionFilters -> String
(Int -> OptimizePermissionFilters -> ShowS)
-> (OptimizePermissionFilters -> String)
-> ([OptimizePermissionFilters] -> ShowS)
-> Show OptimizePermissionFilters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OptimizePermissionFilters -> ShowS
showsPrec :: Int -> OptimizePermissionFilters -> ShowS
$cshow :: OptimizePermissionFilters -> String
show :: OptimizePermissionFilters -> String
$cshowList :: [OptimizePermissionFilters] -> ShowS
showList :: [OptimizePermissionFilters] -> ShowS
Show)
data BigQueryStringNumericInput
= EnableBigQueryStringNumericInput
| DisableBigQueryStringNumericInput
deriving (BigQueryStringNumericInput -> BigQueryStringNumericInput -> Bool
(BigQueryStringNumericInput -> BigQueryStringNumericInput -> Bool)
-> (BigQueryStringNumericInput
-> BigQueryStringNumericInput -> Bool)
-> Eq BigQueryStringNumericInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BigQueryStringNumericInput -> BigQueryStringNumericInput -> Bool
== :: BigQueryStringNumericInput -> BigQueryStringNumericInput -> Bool
$c/= :: BigQueryStringNumericInput -> BigQueryStringNumericInput -> Bool
/= :: BigQueryStringNumericInput -> BigQueryStringNumericInput -> Bool
Eq, Int -> BigQueryStringNumericInput -> ShowS
[BigQueryStringNumericInput] -> ShowS
BigQueryStringNumericInput -> String
(Int -> BigQueryStringNumericInput -> ShowS)
-> (BigQueryStringNumericInput -> String)
-> ([BigQueryStringNumericInput] -> ShowS)
-> Show BigQueryStringNumericInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BigQueryStringNumericInput -> ShowS
showsPrec :: Int -> BigQueryStringNumericInput -> ShowS
$cshow :: BigQueryStringNumericInput -> String
show :: BigQueryStringNumericInput -> String
$cshowList :: [BigQueryStringNumericInput] -> ShowS
showList :: [BigQueryStringNumericInput] -> ShowS
Show)
data IncludeGroupByAggregateFields
= IncludeGroupByAggregateFields
| ExcludeGroupByAggregateFields
deriving (IncludeGroupByAggregateFields
-> IncludeGroupByAggregateFields -> Bool
(IncludeGroupByAggregateFields
-> IncludeGroupByAggregateFields -> Bool)
-> (IncludeGroupByAggregateFields
-> IncludeGroupByAggregateFields -> Bool)
-> Eq IncludeGroupByAggregateFields
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IncludeGroupByAggregateFields
-> IncludeGroupByAggregateFields -> Bool
== :: IncludeGroupByAggregateFields
-> IncludeGroupByAggregateFields -> Bool
$c/= :: IncludeGroupByAggregateFields
-> IncludeGroupByAggregateFields -> Bool
/= :: IncludeGroupByAggregateFields
-> IncludeGroupByAggregateFields -> Bool
Eq, Int -> IncludeGroupByAggregateFields -> ShowS
[IncludeGroupByAggregateFields] -> ShowS
IncludeGroupByAggregateFields -> String
(Int -> IncludeGroupByAggregateFields -> ShowS)
-> (IncludeGroupByAggregateFields -> String)
-> ([IncludeGroupByAggregateFields] -> ShowS)
-> Show IncludeGroupByAggregateFields
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IncludeGroupByAggregateFields -> ShowS
showsPrec :: Int -> IncludeGroupByAggregateFields -> ShowS
$cshow :: IncludeGroupByAggregateFields -> String
show :: IncludeGroupByAggregateFields -> String
$cshowList :: [IncludeGroupByAggregateFields] -> ShowS
showList :: [IncludeGroupByAggregateFields] -> ShowS
Show)
data UsePostgresArrays
= UsePostgresArrays
| DontUsePostgresArrays
deriving (UsePostgresArrays -> UsePostgresArrays -> Bool
(UsePostgresArrays -> UsePostgresArrays -> Bool)
-> (UsePostgresArrays -> UsePostgresArrays -> Bool)
-> Eq UsePostgresArrays
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UsePostgresArrays -> UsePostgresArrays -> Bool
== :: UsePostgresArrays -> UsePostgresArrays -> Bool
$c/= :: UsePostgresArrays -> UsePostgresArrays -> Bool
/= :: UsePostgresArrays -> UsePostgresArrays -> Bool
Eq, Int -> UsePostgresArrays -> ShowS
[UsePostgresArrays] -> ShowS
UsePostgresArrays -> String
(Int -> UsePostgresArrays -> ShowS)
-> (UsePostgresArrays -> String)
-> ([UsePostgresArrays] -> ShowS)
-> Show UsePostgresArrays
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UsePostgresArrays -> ShowS
showsPrec :: Int -> UsePostgresArrays -> ShowS
$cshow :: UsePostgresArrays -> String
show :: UsePostgresArrays -> String
$cshowList :: [UsePostgresArrays] -> ShowS
showList :: [UsePostgresArrays] -> ShowS
Show)