{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.IAM.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data CreateServiceAccountKeyRequestPrivateKeyType
= TypeUnspecified
| TypePKCS12File
| TypeGoogleCredentialsFile
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable CreateServiceAccountKeyRequestPrivateKeyType
instance FromHttpApiData CreateServiceAccountKeyRequestPrivateKeyType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"TYPE_PKCS12_FILE" -> Right TypePKCS12File
"TYPE_GOOGLE_CREDENTIALS_FILE" -> Right TypeGoogleCredentialsFile
x -> Left ("Unable to parse CreateServiceAccountKeyRequestPrivateKeyType from: " <> x)
instance ToHttpApiData CreateServiceAccountKeyRequestPrivateKeyType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
TypePKCS12File -> "TYPE_PKCS12_FILE"
TypeGoogleCredentialsFile -> "TYPE_GOOGLE_CREDENTIALS_FILE"
instance FromJSON CreateServiceAccountKeyRequestPrivateKeyType where
parseJSON = parseJSONText "CreateServiceAccountKeyRequestPrivateKeyType"
instance ToJSON CreateServiceAccountKeyRequestPrivateKeyType where
toJSON = toJSONText
data PermissionStage
= Alpha
| Beta
| GA
| Deprecated
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PermissionStage
instance FromHttpApiData PermissionStage where
parseQueryParam = \case
"ALPHA" -> Right Alpha
"BETA" -> Right Beta
"GA" -> Right GA
"DEPRECATED" -> Right Deprecated
x -> Left ("Unable to parse PermissionStage from: " <> x)
instance ToHttpApiData PermissionStage where
toQueryParam = \case
Alpha -> "ALPHA"
Beta -> "BETA"
GA -> "GA"
Deprecated -> "DEPRECATED"
instance FromJSON PermissionStage where
parseJSON = parseJSONText "PermissionStage"
instance ToJSON PermissionStage where
toJSON = toJSONText
data QueryGrantableRolesRequestView
= Basic
| Full
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable QueryGrantableRolesRequestView
instance FromHttpApiData QueryGrantableRolesRequestView where
parseQueryParam = \case
"BASIC" -> Right Basic
"FULL" -> Right Full
x -> Left ("Unable to parse QueryGrantableRolesRequestView from: " <> x)
instance ToHttpApiData QueryGrantableRolesRequestView where
toQueryParam = \case
Basic -> "BASIC"
Full -> "FULL"
instance FromJSON QueryGrantableRolesRequestView where
parseJSON = parseJSONText "QueryGrantableRolesRequestView"
instance ToJSON QueryGrantableRolesRequestView where
toJSON = toJSONText
data BindingDeltaAction
= ActionUnspecified
| Add
| Remove
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BindingDeltaAction
instance FromHttpApiData BindingDeltaAction where
parseQueryParam = \case
"ACTION_UNSPECIFIED" -> Right ActionUnspecified
"ADD" -> Right Add
"REMOVE" -> Right Remove
x -> Left ("Unable to parse BindingDeltaAction from: " <> x)
instance ToHttpApiData BindingDeltaAction where
toQueryParam = \case
ActionUnspecified -> "ACTION_UNSPECIFIED"
Add -> "ADD"
Remove -> "REMOVE"
instance FromJSON BindingDeltaAction where
parseJSON = parseJSONText "BindingDeltaAction"
instance ToJSON BindingDeltaAction 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 LintResultSeverity
= LRSSeverityUnspecified
| LRSError'
| LRSWarning
| LRSNotice
| LRSInfo
| LRSDeprecated
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LintResultSeverity
instance FromHttpApiData LintResultSeverity where
parseQueryParam = \case
"SEVERITY_UNSPECIFIED" -> Right LRSSeverityUnspecified
"ERROR" -> Right LRSError'
"WARNING" -> Right LRSWarning
"NOTICE" -> Right LRSNotice
"INFO" -> Right LRSInfo
"DEPRECATED" -> Right LRSDeprecated
x -> Left ("Unable to parse LintResultSeverity from: " <> x)
instance ToHttpApiData LintResultSeverity where
toQueryParam = \case
LRSSeverityUnspecified -> "SEVERITY_UNSPECIFIED"
LRSError' -> "ERROR"
LRSWarning -> "WARNING"
LRSNotice -> "NOTICE"
LRSInfo -> "INFO"
LRSDeprecated -> "DEPRECATED"
instance FromJSON LintResultSeverity where
parseJSON = parseJSONText "LintResultSeverity"
instance ToJSON LintResultSeverity where
toJSON = toJSONText
data LintResultLevel
= LRLLevelUnspecified
| LRLPolicy
| LRLBinding
| LRLCondition
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LintResultLevel
instance FromHttpApiData LintResultLevel where
parseQueryParam = \case
"LEVEL_UNSPECIFIED" -> Right LRLLevelUnspecified
"POLICY" -> Right LRLPolicy
"BINDING" -> Right LRLBinding
"CONDITION" -> Right LRLCondition
x -> Left ("Unable to parse LintResultLevel from: " <> x)
instance ToHttpApiData LintResultLevel where
toQueryParam = \case
LRLLevelUnspecified -> "LEVEL_UNSPECIFIED"
LRLPolicy -> "POLICY"
LRLBinding -> "BINDING"
LRLCondition -> "CONDITION"
instance FromJSON LintResultLevel where
parseJSON = parseJSONText "LintResultLevel"
instance ToJSON LintResultLevel where
toJSON = toJSONText
data RoleStage
= RSAlpha
| RSBeta
| RSGA
| RSDeprecated
| RSDisabled
| RSEap
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RoleStage
instance FromHttpApiData RoleStage where
parseQueryParam = \case
"ALPHA" -> Right RSAlpha
"BETA" -> Right RSBeta
"GA" -> Right RSGA
"DEPRECATED" -> Right RSDeprecated
"DISABLED" -> Right RSDisabled
"EAP" -> Right RSEap
x -> Left ("Unable to parse RoleStage from: " <> x)
instance ToHttpApiData RoleStage where
toQueryParam = \case
RSAlpha -> "ALPHA"
RSBeta -> "BETA"
RSGA -> "GA"
RSDeprecated -> "DEPRECATED"
RSDisabled -> "DISABLED"
RSEap -> "EAP"
instance FromJSON RoleStage where
parseJSON = parseJSONText "RoleStage"
instance ToJSON RoleStage where
toJSON = toJSONText
data ServiceAccountKeyKeyAlgorithm
= KeyAlgUnspecified
| KeyAlgRsa1024
| KeyAlgRsa2048
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ServiceAccountKeyKeyAlgorithm
instance FromHttpApiData ServiceAccountKeyKeyAlgorithm where
parseQueryParam = \case
"KEY_ALG_UNSPECIFIED" -> Right KeyAlgUnspecified
"KEY_ALG_RSA_1024" -> Right KeyAlgRsa1024
"KEY_ALG_RSA_2048" -> Right KeyAlgRsa2048
x -> Left ("Unable to parse ServiceAccountKeyKeyAlgorithm from: " <> x)
instance ToHttpApiData ServiceAccountKeyKeyAlgorithm where
toQueryParam = \case
KeyAlgUnspecified -> "KEY_ALG_UNSPECIFIED"
KeyAlgRsa1024 -> "KEY_ALG_RSA_1024"
KeyAlgRsa2048 -> "KEY_ALG_RSA_2048"
instance FromJSON ServiceAccountKeyKeyAlgorithm where
parseJSON = parseJSONText "ServiceAccountKeyKeyAlgorithm"
instance ToJSON ServiceAccountKeyKeyAlgorithm where
toJSON = toJSONText
data CreateServiceAccountKeyRequestKeyAlgorithm
= CSAKRKAKeyAlgUnspecified
| CSAKRKAKeyAlgRsa1024
| CSAKRKAKeyAlgRsa2048
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable CreateServiceAccountKeyRequestKeyAlgorithm
instance FromHttpApiData CreateServiceAccountKeyRequestKeyAlgorithm where
parseQueryParam = \case
"KEY_ALG_UNSPECIFIED" -> Right CSAKRKAKeyAlgUnspecified
"KEY_ALG_RSA_1024" -> Right CSAKRKAKeyAlgRsa1024
"KEY_ALG_RSA_2048" -> Right CSAKRKAKeyAlgRsa2048
x -> Left ("Unable to parse CreateServiceAccountKeyRequestKeyAlgorithm from: " <> x)
instance ToHttpApiData CreateServiceAccountKeyRequestKeyAlgorithm where
toQueryParam = \case
CSAKRKAKeyAlgUnspecified -> "KEY_ALG_UNSPECIFIED"
CSAKRKAKeyAlgRsa1024 -> "KEY_ALG_RSA_1024"
CSAKRKAKeyAlgRsa2048 -> "KEY_ALG_RSA_2048"
instance FromJSON CreateServiceAccountKeyRequestKeyAlgorithm where
parseJSON = parseJSONText "CreateServiceAccountKeyRequestKeyAlgorithm"
instance ToJSON CreateServiceAccountKeyRequestKeyAlgorithm where
toJSON = toJSONText
data PermissionCustomRolesSupportLevel
= Supported
| Testing
| NotSupported
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PermissionCustomRolesSupportLevel
instance FromHttpApiData PermissionCustomRolesSupportLevel where
parseQueryParam = \case
"SUPPORTED" -> Right Supported
"TESTING" -> Right Testing
"NOT_SUPPORTED" -> Right NotSupported
x -> Left ("Unable to parse PermissionCustomRolesSupportLevel from: " <> x)
instance ToHttpApiData PermissionCustomRolesSupportLevel where
toQueryParam = \case
Supported -> "SUPPORTED"
Testing -> "TESTING"
NotSupported -> "NOT_SUPPORTED"
instance FromJSON PermissionCustomRolesSupportLevel where
parseJSON = parseJSONText "PermissionCustomRolesSupportLevel"
instance ToJSON PermissionCustomRolesSupportLevel where
toJSON = toJSONText
data ServiceAccountKeyPrivateKeyType
= SAKPKTTypeUnspecified
| SAKPKTTypePKCS12File
| SAKPKTTypeGoogleCredentialsFile
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ServiceAccountKeyPrivateKeyType
instance FromHttpApiData ServiceAccountKeyPrivateKeyType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right SAKPKTTypeUnspecified
"TYPE_PKCS12_FILE" -> Right SAKPKTTypePKCS12File
"TYPE_GOOGLE_CREDENTIALS_FILE" -> Right SAKPKTTypeGoogleCredentialsFile
x -> Left ("Unable to parse ServiceAccountKeyPrivateKeyType from: " <> x)
instance ToHttpApiData ServiceAccountKeyPrivateKeyType where
toQueryParam = \case
SAKPKTTypeUnspecified -> "TYPE_UNSPECIFIED"
SAKPKTTypePKCS12File -> "TYPE_PKCS12_FILE"
SAKPKTTypeGoogleCredentialsFile -> "TYPE_GOOGLE_CREDENTIALS_FILE"
instance FromJSON ServiceAccountKeyPrivateKeyType where
parseJSON = parseJSONText "ServiceAccountKeyPrivateKeyType"
instance ToJSON ServiceAccountKeyPrivateKeyType where
toJSON = toJSONText