{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.SecurityCenter.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data ListFindingsResultStateChange
= Unused
| Changed
| Unchanged
| Added
| Removed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ListFindingsResultStateChange
instance FromHttpApiData ListFindingsResultStateChange where
parseQueryParam = \case
"UNUSED" -> Right Unused
"CHANGED" -> Right Changed
"UNCHANGED" -> Right Unchanged
"ADDED" -> Right Added
"REMOVED" -> Right Removed
x -> Left ("Unable to parse ListFindingsResultStateChange from: " <> x)
instance ToHttpApiData ListFindingsResultStateChange where
toQueryParam = \case
Unused -> "UNUSED"
Changed -> "CHANGED"
Unchanged -> "UNCHANGED"
Added -> "ADDED"
Removed -> "REMOVED"
instance FromJSON ListFindingsResultStateChange where
parseJSON = parseJSONText "ListFindingsResultStateChange"
instance ToJSON ListFindingsResultStateChange where
toJSON = toJSONText
data AssetDiscoveryConfigInclusionMode
= InclusionModeUnspecified
| IncludeOnly
| Exclude
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AssetDiscoveryConfigInclusionMode
instance FromHttpApiData AssetDiscoveryConfigInclusionMode where
parseQueryParam = \case
"INCLUSION_MODE_UNSPECIFIED" -> Right InclusionModeUnspecified
"INCLUDE_ONLY" -> Right IncludeOnly
"EXCLUDE" -> Right Exclude
x -> Left ("Unable to parse AssetDiscoveryConfigInclusionMode from: " <> x)
instance ToHttpApiData AssetDiscoveryConfigInclusionMode where
toQueryParam = \case
InclusionModeUnspecified -> "INCLUSION_MODE_UNSPECIFIED"
IncludeOnly -> "INCLUDE_ONLY"
Exclude -> "EXCLUDE"
instance FromJSON AssetDiscoveryConfigInclusionMode where
parseJSON = parseJSONText "AssetDiscoveryConfigInclusionMode"
instance ToJSON AssetDiscoveryConfigInclusionMode where
toJSON = toJSONText
data SetFindingStateRequestState
= StateUnspecified
| Active
| Inactive
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SetFindingStateRequestState
instance FromHttpApiData SetFindingStateRequestState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right StateUnspecified
"ACTIVE" -> Right Active
"INACTIVE" -> Right Inactive
x -> Left ("Unable to parse SetFindingStateRequestState from: " <> x)
instance ToHttpApiData SetFindingStateRequestState where
toQueryParam = \case
StateUnspecified -> "STATE_UNSPECIFIED"
Active -> "ACTIVE"
Inactive -> "INACTIVE"
instance FromJSON SetFindingStateRequestState where
parseJSON = parseJSONText "SetFindingStateRequestState"
instance ToJSON SetFindingStateRequestState where
toJSON = toJSONText
data ListAssetsResultStateChange
= LARSCUnused
| LARSCAdded
| LARSCRemoved
| LARSCActive
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ListAssetsResultStateChange
instance FromHttpApiData ListAssetsResultStateChange where
parseQueryParam = \case
"UNUSED" -> Right LARSCUnused
"ADDED" -> Right LARSCAdded
"REMOVED" -> Right LARSCRemoved
"ACTIVE" -> Right LARSCActive
x -> Left ("Unable to parse ListAssetsResultStateChange from: " <> x)
instance ToHttpApiData ListAssetsResultStateChange where
toQueryParam = \case
LARSCUnused -> "UNUSED"
LARSCAdded -> "ADDED"
LARSCRemoved -> "REMOVED"
LARSCActive -> "ACTIVE"
instance FromJSON ListAssetsResultStateChange where
parseJSON = parseJSONText "ListAssetsResultStateChange"
instance ToJSON ListAssetsResultStateChange 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 FindingState
= FSStateUnspecified
| FSActive
| FSInactive
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FindingState
instance FromHttpApiData FindingState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right FSStateUnspecified
"ACTIVE" -> Right FSActive
"INACTIVE" -> Right FSInactive
x -> Left ("Unable to parse FindingState from: " <> x)
instance ToHttpApiData FindingState where
toQueryParam = \case
FSStateUnspecified -> "STATE_UNSPECIFIED"
FSActive -> "ACTIVE"
FSInactive -> "INACTIVE"
instance FromJSON FindingState where
parseJSON = parseJSONText "FindingState"
instance ToJSON FindingState 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 GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState
= GCSVRADRSStateUnspecified
| GCSVRADRSCompleted
| GCSVRADRSSuperseded
| GCSVRADRSTerminated
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState
instance FromHttpApiData GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right GCSVRADRSStateUnspecified
"COMPLETED" -> Right GCSVRADRSCompleted
"SUPERSEDED" -> Right GCSVRADRSSuperseded
"TERMINATED" -> Right GCSVRADRSTerminated
x -> Left ("Unable to parse GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState from: " <> x)
instance ToHttpApiData GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState where
toQueryParam = \case
GCSVRADRSStateUnspecified -> "STATE_UNSPECIFIED"
GCSVRADRSCompleted -> "COMPLETED"
GCSVRADRSSuperseded -> "SUPERSEDED"
GCSVRADRSTerminated -> "TERMINATED"
instance FromJSON GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState where
parseJSON = parseJSONText "GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState"
instance ToJSON GoogleCloudSecuritycenterV1RunAssetDiscoveryResponseState where
toJSON = toJSONText
data GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState
= GStateUnspecified
| GCompleted
| GSuperseded
| GTerminated
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState
instance FromHttpApiData GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right GStateUnspecified
"COMPLETED" -> Right GCompleted
"SUPERSEDED" -> Right GSuperseded
"TERMINATED" -> Right GTerminated
x -> Left ("Unable to parse GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState from: " <> x)
instance ToHttpApiData GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState where
toQueryParam = \case
GStateUnspecified -> "STATE_UNSPECIFIED"
GCompleted -> "COMPLETED"
GSuperseded -> "SUPERSEDED"
GTerminated -> "TERMINATED"
instance FromJSON GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState where
parseJSON = parseJSONText "GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState"
instance ToJSON GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponseState where
toJSON = toJSONText