{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.DataFusion.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data CloudAuditOptionsLogName
= UnspecifiedLogName
| AdminActivity
| DataAccess
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable CloudAuditOptionsLogName
instance FromHttpApiData CloudAuditOptionsLogName where
parseQueryParam = \case
"UNSPECIFIED_LOG_NAME" -> Right UnspecifiedLogName
"ADMIN_ACTIVITY" -> Right AdminActivity
"DATA_ACCESS" -> Right DataAccess
x -> Left ("Unable to parse CloudAuditOptionsLogName from: " <> x)
instance ToHttpApiData CloudAuditOptionsLogName where
toQueryParam = \case
UnspecifiedLogName -> "UNSPECIFIED_LOG_NAME"
AdminActivity -> "ADMIN_ACTIVITY"
DataAccess -> "DATA_ACCESS"
instance FromJSON CloudAuditOptionsLogName where
parseJSON = parseJSONText "CloudAuditOptionsLogName"
instance ToJSON CloudAuditOptionsLogName where
toJSON = toJSONText
data ConditionSys
= NoAttr
| Region
| Service
| Name
| IP
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ConditionSys
instance FromHttpApiData ConditionSys where
parseQueryParam = \case
"NO_ATTR" -> Right NoAttr
"REGION" -> Right Region
"SERVICE" -> Right Service
"NAME" -> Right Name
"IP" -> Right IP
x -> Left ("Unable to parse ConditionSys from: " <> x)
instance ToHttpApiData ConditionSys where
toQueryParam = \case
NoAttr -> "NO_ATTR"
Region -> "REGION"
Service -> "SERVICE"
Name -> "NAME"
IP -> "IP"
instance FromJSON ConditionSys where
parseJSON = parseJSONText "ConditionSys"
instance ToJSON ConditionSys where
toJSON = toJSONText
data RuleAction
= NoAction
| Allow
| AllowWithLog
| Deny
| DenyWithLog
| Log
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RuleAction
instance FromHttpApiData RuleAction where
parseQueryParam = \case
"NO_ACTION" -> Right NoAction
"ALLOW" -> Right Allow
"ALLOW_WITH_LOG" -> Right AllowWithLog
"DENY" -> Right Deny
"DENY_WITH_LOG" -> Right DenyWithLog
"LOG" -> Right Log
x -> Left ("Unable to parse RuleAction from: " <> x)
instance ToHttpApiData RuleAction where
toQueryParam = \case
NoAction -> "NO_ACTION"
Allow -> "ALLOW"
AllowWithLog -> "ALLOW_WITH_LOG"
Deny -> "DENY"
DenyWithLog -> "DENY_WITH_LOG"
Log -> "LOG"
instance FromJSON RuleAction where
parseJSON = parseJSONText "RuleAction"
instance ToJSON RuleAction where
toJSON = toJSONText
data InstanceType
= TypeUnspecified
| Basic
| Enterprise
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable InstanceType
instance FromHttpApiData InstanceType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"BASIC" -> Right Basic
"ENTERPRISE" -> Right Enterprise
x -> Left ("Unable to parse InstanceType from: " <> x)
instance ToHttpApiData InstanceType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
Basic -> "BASIC"
Enterprise -> "ENTERPRISE"
instance FromJSON InstanceType where
parseJSON = parseJSONText "InstanceType"
instance ToJSON InstanceType where
toJSON = toJSONText
data ConditionOp
= NoOp
| Equals
| NotEquals
| IN
| NotIn
| Discharged
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ConditionOp
instance FromHttpApiData ConditionOp where
parseQueryParam = \case
"NO_OP" -> Right NoOp
"EQUALS" -> Right Equals
"NOT_EQUALS" -> Right NotEquals
"IN" -> Right IN
"NOT_IN" -> Right NotIn
"DISCHARGED" -> Right Discharged
x -> Left ("Unable to parse ConditionOp from: " <> x)
instance ToHttpApiData ConditionOp where
toQueryParam = \case
NoOp -> "NO_OP"
Equals -> "EQUALS"
NotEquals -> "NOT_EQUALS"
IN -> "IN"
NotIn -> "NOT_IN"
Discharged -> "DISCHARGED"
instance FromJSON ConditionOp where
parseJSON = parseJSONText "ConditionOp"
instance ToJSON ConditionOp where
toJSON = toJSONText
data AuditLogConfigLogType
= LogTypeUnspecified
| AdminRead
| DataWrite
| DataRead
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AuditLogConfigLogType
instance FromHttpApiData AuditLogConfigLogType where
parseQueryParam = \case
"LOG_TYPE_UNSPECIFIED" -> Right LogTypeUnspecified
"ADMIN_READ" -> Right AdminRead
"DATA_WRITE" -> Right DataWrite
"DATA_READ" -> Right DataRead
x -> Left ("Unable to parse AuditLogConfigLogType from: " <> x)
instance ToHttpApiData AuditLogConfigLogType where
toQueryParam = \case
LogTypeUnspecified -> "LOG_TYPE_UNSPECIFIED"
AdminRead -> "ADMIN_READ"
DataWrite -> "DATA_WRITE"
DataRead -> "DATA_READ"
instance FromJSON AuditLogConfigLogType where
parseJSON = parseJSONText "AuditLogConfigLogType"
instance ToJSON AuditLogConfigLogType where
toJSON = toJSONText
data Xgafv
= X1
| X2
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable Xgafv
instance FromHttpApiData Xgafv where
parseQueryParam = \case
"1" -> Right X1
"2" -> Right X2
x -> Left ("Unable to parse Xgafv from: " <> x)
instance ToHttpApiData Xgafv where
toQueryParam = \case
X1 -> "1"
X2 -> "2"
instance FromJSON Xgafv where
parseJSON = parseJSONText "Xgafv"
instance ToJSON Xgafv where
toJSON = toJSONText
data DataAccessOptionsLogMode
= LogModeUnspecified
| LogFailClosed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DataAccessOptionsLogMode
instance FromHttpApiData DataAccessOptionsLogMode where
parseQueryParam = \case
"LOG_MODE_UNSPECIFIED" -> Right LogModeUnspecified
"LOG_FAIL_CLOSED" -> Right LogFailClosed
x -> Left ("Unable to parse DataAccessOptionsLogMode from: " <> x)
instance ToHttpApiData DataAccessOptionsLogMode where
toQueryParam = \case
LogModeUnspecified -> "LOG_MODE_UNSPECIFIED"
LogFailClosed -> "LOG_FAIL_CLOSED"
instance FromJSON DataAccessOptionsLogMode where
parseJSON = parseJSONText "DataAccessOptionsLogMode"
instance ToJSON DataAccessOptionsLogMode where
toJSON = toJSONText
data AuthorizationLoggingOptionsPermissionType
= ALOPTPermissionTypeUnspecified
| ALOPTAdminRead
| ALOPTAdminWrite
| ALOPTDataRead
| ALOPTDataWrite
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AuthorizationLoggingOptionsPermissionType
instance FromHttpApiData AuthorizationLoggingOptionsPermissionType where
parseQueryParam = \case
"PERMISSION_TYPE_UNSPECIFIED" -> Right ALOPTPermissionTypeUnspecified
"ADMIN_READ" -> Right ALOPTAdminRead
"ADMIN_WRITE" -> Right ALOPTAdminWrite
"DATA_READ" -> Right ALOPTDataRead
"DATA_WRITE" -> Right ALOPTDataWrite
x -> Left ("Unable to parse AuthorizationLoggingOptionsPermissionType from: " <> x)
instance ToHttpApiData AuthorizationLoggingOptionsPermissionType where
toQueryParam = \case
ALOPTPermissionTypeUnspecified -> "PERMISSION_TYPE_UNSPECIFIED"
ALOPTAdminRead -> "ADMIN_READ"
ALOPTAdminWrite -> "ADMIN_WRITE"
ALOPTDataRead -> "DATA_READ"
ALOPTDataWrite -> "DATA_WRITE"
instance FromJSON AuthorizationLoggingOptionsPermissionType where
parseJSON = parseJSONText "AuthorizationLoggingOptionsPermissionType"
instance ToJSON AuthorizationLoggingOptionsPermissionType where
toJSON = toJSONText
data InstanceState
= StateUnspecified
| Creating
| Running
| Failed
| Deleting
| Upgrading
| Restarting
| Updating
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable InstanceState
instance FromHttpApiData InstanceState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right StateUnspecified
"CREATING" -> Right Creating
"RUNNING" -> Right Running
"FAILED" -> Right Failed
"DELETING" -> Right Deleting
"UPGRADING" -> Right Upgrading
"RESTARTING" -> Right Restarting
"UPDATING" -> Right Updating
x -> Left ("Unable to parse InstanceState from: " <> x)
instance ToHttpApiData InstanceState where
toQueryParam = \case
StateUnspecified -> "STATE_UNSPECIFIED"
Creating -> "CREATING"
Running -> "RUNNING"
Failed -> "FAILED"
Deleting -> "DELETING"
Upgrading -> "UPGRADING"
Restarting -> "RESTARTING"
Updating -> "UPDATING"
instance FromJSON InstanceState where
parseJSON = parseJSONText "InstanceState"
instance ToJSON InstanceState where
toJSON = toJSONText
data ConditionIAM
= CINoAttr
| CIAuthority
| CIAttribution
| CISecurityRealm
| CIApprover
| CIJustificationType
| CICredentialsType
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ConditionIAM
instance FromHttpApiData ConditionIAM where
parseQueryParam = \case
"NO_ATTR" -> Right CINoAttr
"AUTHORITY" -> Right CIAuthority
"ATTRIBUTION" -> Right CIAttribution
"SECURITY_REALM" -> Right CISecurityRealm
"APPROVER" -> Right CIApprover
"JUSTIFICATION_TYPE" -> Right CIJustificationType
"CREDENTIALS_TYPE" -> Right CICredentialsType
x -> Left ("Unable to parse ConditionIAM from: " <> x)
instance ToHttpApiData ConditionIAM where
toQueryParam = \case
CINoAttr -> "NO_ATTR"
CIAuthority -> "AUTHORITY"
CIAttribution -> "ATTRIBUTION"
CISecurityRealm -> "SECURITY_REALM"
CIApprover -> "APPROVER"
CIJustificationType -> "JUSTIFICATION_TYPE"
CICredentialsType -> "CREDENTIALS_TYPE"
instance FromJSON ConditionIAM where
parseJSON = parseJSONText "ConditionIAM"
instance ToJSON ConditionIAM where
toJSON = toJSONText