{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.CloudAsset.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data ExportAssetsRequestContentType
= EARCTContentTypeUnspecified
| EARCTResource
| EARCTIAMPolicy
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ExportAssetsRequestContentType
instance FromHttpApiData ExportAssetsRequestContentType where
parseQueryParam = \case
"CONTENT_TYPE_UNSPECIFIED" -> Right EARCTContentTypeUnspecified
"RESOURCE" -> Right EARCTResource
"IAM_POLICY" -> Right EARCTIAMPolicy
x -> Left ("Unable to parse ExportAssetsRequestContentType from: " <> x)
instance ToHttpApiData ExportAssetsRequestContentType where
toQueryParam = \case
EARCTContentTypeUnspecified -> "CONTENT_TYPE_UNSPECIFIED"
EARCTResource -> "RESOURCE"
EARCTIAMPolicy -> "IAM_POLICY"
instance FromJSON ExportAssetsRequestContentType where
parseJSON = parseJSONText "ExportAssetsRequestContentType"
instance ToJSON ExportAssetsRequestContentType 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