{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.ContainerAnalysis.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data LayerDirective
= DirectiveUnspecified
| Maintainer
| Run
| Cmd
| Label
| Expose
| Env
| Add
| Copy
| Entrypoint
| Volume
| User
| Workdir
| Arg
| Onbuild
| Stopsignal
| Healthcheck
| Shell
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LayerDirective
instance FromHttpApiData LayerDirective where
parseQueryParam = \case
"DIRECTIVE_UNSPECIFIED" -> Right DirectiveUnspecified
"MAINTAINER" -> Right Maintainer
"RUN" -> Right Run
"CMD" -> Right Cmd
"LABEL" -> Right Label
"EXPOSE" -> Right Expose
"ENV" -> Right Env
"ADD" -> Right Add
"COPY" -> Right Copy
"ENTRYPOINT" -> Right Entrypoint
"VOLUME" -> Right Volume
"USER" -> Right User
"WORKDIR" -> Right Workdir
"ARG" -> Right Arg
"ONBUILD" -> Right Onbuild
"STOPSIGNAL" -> Right Stopsignal
"HEALTHCHECK" -> Right Healthcheck
"SHELL" -> Right Shell
x -> Left ("Unable to parse LayerDirective from: " <> x)
instance ToHttpApiData LayerDirective where
toQueryParam = \case
DirectiveUnspecified -> "DIRECTIVE_UNSPECIFIED"
Maintainer -> "MAINTAINER"
Run -> "RUN"
Cmd -> "CMD"
Label -> "LABEL"
Expose -> "EXPOSE"
Env -> "ENV"
Add -> "ADD"
Copy -> "COPY"
Entrypoint -> "ENTRYPOINT"
Volume -> "VOLUME"
User -> "USER"
Workdir -> "WORKDIR"
Arg -> "ARG"
Onbuild -> "ONBUILD"
Stopsignal -> "STOPSIGNAL"
Healthcheck -> "HEALTHCHECK"
Shell -> "SHELL"
instance FromJSON LayerDirective where
parseJSON = parseJSONText "LayerDirective"
instance ToJSON LayerDirective where
toJSON = toJSONText
data DiscoveredAnalysisStatus
= AnalysisStatusUnspecified
| Pending
| Scanning
| FinishedSuccess
| FinishedFailed
| FinishedUnsupported
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DiscoveredAnalysisStatus
instance FromHttpApiData DiscoveredAnalysisStatus where
parseQueryParam = \case
"ANALYSIS_STATUS_UNSPECIFIED" -> Right AnalysisStatusUnspecified
"PENDING" -> Right Pending
"SCANNING" -> Right Scanning
"FINISHED_SUCCESS" -> Right FinishedSuccess
"FINISHED_FAILED" -> Right FinishedFailed
"FINISHED_UNSUPPORTED" -> Right FinishedUnsupported
x -> Left ("Unable to parse DiscoveredAnalysisStatus from: " <> x)
instance ToHttpApiData DiscoveredAnalysisStatus where
toQueryParam = \case
AnalysisStatusUnspecified -> "ANALYSIS_STATUS_UNSPECIFIED"
Pending -> "PENDING"
Scanning -> "SCANNING"
FinishedSuccess -> "FINISHED_SUCCESS"
FinishedFailed -> "FINISHED_FAILED"
FinishedUnsupported -> "FINISHED_UNSUPPORTED"
instance FromJSON DiscoveredAnalysisStatus where
parseJSON = parseJSONText "DiscoveredAnalysisStatus"
instance ToJSON DiscoveredAnalysisStatus where
toJSON = toJSONText
data GrafeasV1beta1VulnerabilityDetailsSeverity
= SeverityUnspecified
| Minimal
| Low
| Medium
| High
| Critical
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GrafeasV1beta1VulnerabilityDetailsSeverity
instance FromHttpApiData GrafeasV1beta1VulnerabilityDetailsSeverity where
parseQueryParam = \case
"SEVERITY_UNSPECIFIED" -> Right SeverityUnspecified
"MINIMAL" -> Right Minimal
"LOW" -> Right Low
"MEDIUM" -> Right Medium
"HIGH" -> Right High
"CRITICAL" -> Right Critical
x -> Left ("Unable to parse GrafeasV1beta1VulnerabilityDetailsSeverity from: " <> x)
instance ToHttpApiData GrafeasV1beta1VulnerabilityDetailsSeverity where
toQueryParam = \case
SeverityUnspecified -> "SEVERITY_UNSPECIFIED"
Minimal -> "MINIMAL"
Low -> "LOW"
Medium -> "MEDIUM"
High -> "HIGH"
Critical -> "CRITICAL"
instance FromJSON GrafeasV1beta1VulnerabilityDetailsSeverity where
parseJSON = parseJSONText "GrafeasV1beta1VulnerabilityDetailsSeverity"
instance ToJSON GrafeasV1beta1VulnerabilityDetailsSeverity where
toJSON = toJSONText
data OccurrenceKind
= OKNoteKindUnspecified
| OKVulnerability
| OKBuild
| OKImage
| OKPackage
| OKDeployment
| OKDiscovery
| OKAttestation
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OccurrenceKind
instance FromHttpApiData OccurrenceKind where
parseQueryParam = \case
"NOTE_KIND_UNSPECIFIED" -> Right OKNoteKindUnspecified
"VULNERABILITY" -> Right OKVulnerability
"BUILD" -> Right OKBuild
"IMAGE" -> Right OKImage
"PACKAGE" -> Right OKPackage
"DEPLOYMENT" -> Right OKDeployment
"DISCOVERY" -> Right OKDiscovery
"ATTESTATION" -> Right OKAttestation
x -> Left ("Unable to parse OccurrenceKind from: " <> x)
instance ToHttpApiData OccurrenceKind where
toQueryParam = \case
OKNoteKindUnspecified -> "NOTE_KIND_UNSPECIFIED"
OKVulnerability -> "VULNERABILITY"
OKBuild -> "BUILD"
OKImage -> "IMAGE"
OKPackage -> "PACKAGE"
OKDeployment -> "DEPLOYMENT"
OKDiscovery -> "DISCOVERY"
OKAttestation -> "ATTESTATION"
instance FromJSON OccurrenceKind where
parseJSON = parseJSONText "OccurrenceKind"
instance ToJSON OccurrenceKind where
toJSON = toJSONText
data VulnerabilitySeverity
= VSSeverityUnspecified
| VSMinimal
| VSLow
| VSMedium
| VSHigh
| VSCritical
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable VulnerabilitySeverity
instance FromHttpApiData VulnerabilitySeverity where
parseQueryParam = \case
"SEVERITY_UNSPECIFIED" -> Right VSSeverityUnspecified
"MINIMAL" -> Right VSMinimal
"LOW" -> Right VSLow
"MEDIUM" -> Right VSMedium
"HIGH" -> Right VSHigh
"CRITICAL" -> Right VSCritical
x -> Left ("Unable to parse VulnerabilitySeverity from: " <> x)
instance ToHttpApiData VulnerabilitySeverity where
toQueryParam = \case
VSSeverityUnspecified -> "SEVERITY_UNSPECIFIED"
VSMinimal -> "MINIMAL"
VSLow -> "LOW"
VSMedium -> "MEDIUM"
VSHigh -> "HIGH"
VSCritical -> "CRITICAL"
instance FromJSON VulnerabilitySeverity where
parseJSON = parseJSONText "VulnerabilitySeverity"
instance ToJSON VulnerabilitySeverity where
toJSON = toJSONText
data DiscoveredContinuousAnalysis
= ContinuousAnalysisUnspecified
| Active
| Inactive
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DiscoveredContinuousAnalysis
instance FromHttpApiData DiscoveredContinuousAnalysis where
parseQueryParam = \case
"CONTINUOUS_ANALYSIS_UNSPECIFIED" -> Right ContinuousAnalysisUnspecified
"ACTIVE" -> Right Active
"INACTIVE" -> Right Inactive
x -> Left ("Unable to parse DiscoveredContinuousAnalysis from: " <> x)
instance ToHttpApiData DiscoveredContinuousAnalysis where
toQueryParam = \case
ContinuousAnalysisUnspecified -> "CONTINUOUS_ANALYSIS_UNSPECIFIED"
Active -> "ACTIVE"
Inactive -> "INACTIVE"
instance FromJSON DiscoveredContinuousAnalysis where
parseJSON = parseJSONText "DiscoveredContinuousAnalysis"
instance ToJSON DiscoveredContinuousAnalysis where
toJSON = toJSONText
data NoteKind
= NKNoteKindUnspecified
| NKVulnerability
| NKBuild
| NKImage
| NKPackage
| NKDeployment
| NKDiscovery
| NKAttestation
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable NoteKind
instance FromHttpApiData NoteKind where
parseQueryParam = \case
"NOTE_KIND_UNSPECIFIED" -> Right NKNoteKindUnspecified
"VULNERABILITY" -> Right NKVulnerability
"BUILD" -> Right NKBuild
"IMAGE" -> Right NKImage
"PACKAGE" -> Right NKPackage
"DEPLOYMENT" -> Right NKDeployment
"DISCOVERY" -> Right NKDiscovery
"ATTESTATION" -> Right NKAttestation
x -> Left ("Unable to parse NoteKind from: " <> x)
instance ToHttpApiData NoteKind where
toQueryParam = \case
NKNoteKindUnspecified -> "NOTE_KIND_UNSPECIFIED"
NKVulnerability -> "VULNERABILITY"
NKBuild -> "BUILD"
NKImage -> "IMAGE"
NKPackage -> "PACKAGE"
NKDeployment -> "DEPLOYMENT"
NKDiscovery -> "DISCOVERY"
NKAttestation -> "ATTESTATION"
instance FromJSON NoteKind where
parseJSON = parseJSONText "NoteKind"
instance ToJSON NoteKind where
toJSON = toJSONText
data DeploymentPlatform
= PlatformUnspecified
| Gke
| Flex
| Custom
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DeploymentPlatform
instance FromHttpApiData DeploymentPlatform where
parseQueryParam = \case
"PLATFORM_UNSPECIFIED" -> Right PlatformUnspecified
"GKE" -> Right Gke
"FLEX" -> Right Flex
"CUSTOM" -> Right Custom
x -> Left ("Unable to parse DeploymentPlatform from: " <> x)
instance ToHttpApiData DeploymentPlatform where
toQueryParam = \case
PlatformUnspecified -> "PLATFORM_UNSPECIFIED"
Gke -> "GKE"
Flex -> "FLEX"
Custom -> "CUSTOM"
instance FromJSON DeploymentPlatform where
parseJSON = parseJSONText "DeploymentPlatform"
instance ToJSON DeploymentPlatform where
toJSON = toJSONText
data DistributionArchitecture
= ArchitectureUnspecified
| X86
| X64
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DistributionArchitecture
instance FromHttpApiData DistributionArchitecture where
parseQueryParam = \case
"ARCHITECTURE_UNSPECIFIED" -> Right ArchitectureUnspecified
"X86" -> Right X86
"X64" -> Right X64
x -> Left ("Unable to parse DistributionArchitecture from: " <> x)
instance ToHttpApiData DistributionArchitecture where
toQueryParam = \case
ArchitectureUnspecified -> "ARCHITECTURE_UNSPECIFIED"
X86 -> "X86"
X64 -> "X64"
instance FromJSON DistributionArchitecture where
parseJSON = parseJSONText "DistributionArchitecture"
instance ToJSON DistributionArchitecture where
toJSON = toJSONText
data FixableTotalByDigestSeverity
= FTBDSSeverityUnspecified
| FTBDSMinimal
| FTBDSLow
| FTBDSMedium
| FTBDSHigh
| FTBDSCritical
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FixableTotalByDigestSeverity
instance FromHttpApiData FixableTotalByDigestSeverity where
parseQueryParam = \case
"SEVERITY_UNSPECIFIED" -> Right FTBDSSeverityUnspecified
"MINIMAL" -> Right FTBDSMinimal
"LOW" -> Right FTBDSLow
"MEDIUM" -> Right FTBDSMedium
"HIGH" -> Right FTBDSHigh
"CRITICAL" -> Right FTBDSCritical
x -> Left ("Unable to parse FixableTotalByDigestSeverity from: " <> x)
instance ToHttpApiData FixableTotalByDigestSeverity where
toQueryParam = \case
FTBDSSeverityUnspecified -> "SEVERITY_UNSPECIFIED"
FTBDSMinimal -> "MINIMAL"
FTBDSLow -> "LOW"
FTBDSMedium -> "MEDIUM"
FTBDSHigh -> "HIGH"
FTBDSCritical -> "CRITICAL"
instance FromJSON FixableTotalByDigestSeverity where
parseJSON = parseJSONText "FixableTotalByDigestSeverity"
instance ToJSON FixableTotalByDigestSeverity 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 PgpSignedAttestationContentType
= ContentTypeUnspecified
| SimpleSigningJSON
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PgpSignedAttestationContentType
instance FromHttpApiData PgpSignedAttestationContentType where
parseQueryParam = \case
"CONTENT_TYPE_UNSPECIFIED" -> Right ContentTypeUnspecified
"SIMPLE_SIGNING_JSON" -> Right SimpleSigningJSON
x -> Left ("Unable to parse PgpSignedAttestationContentType from: " <> x)
instance ToHttpApiData PgpSignedAttestationContentType where
toQueryParam = \case
ContentTypeUnspecified -> "CONTENT_TYPE_UNSPECIFIED"
SimpleSigningJSON -> "SIMPLE_SIGNING_JSON"
instance FromJSON PgpSignedAttestationContentType where
parseJSON = parseJSONText "PgpSignedAttestationContentType"
instance ToJSON PgpSignedAttestationContentType 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 VersionKind
= VersionKindUnspecified
| Normal
| Minimum
| Maximum
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable VersionKind
instance FromHttpApiData VersionKind where
parseQueryParam = \case
"VERSION_KIND_UNSPECIFIED" -> Right VersionKindUnspecified
"NORMAL" -> Right Normal
"MINIMUM" -> Right Minimum
"MAXIMUM" -> Right Maximum
x -> Left ("Unable to parse VersionKind from: " <> x)
instance ToHttpApiData VersionKind where
toQueryParam = \case
VersionKindUnspecified -> "VERSION_KIND_UNSPECIFIED"
Normal -> "NORMAL"
Minimum -> "MINIMUM"
Maximum -> "MAXIMUM"
instance FromJSON VersionKind where
parseJSON = parseJSONText "VersionKind"
instance ToJSON VersionKind where
toJSON = toJSONText
data HashType
= HashTypeUnspecified
| SHA256
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable HashType
instance FromHttpApiData HashType where
parseQueryParam = \case
"HASH_TYPE_UNSPECIFIED" -> Right HashTypeUnspecified
"SHA256" -> Right SHA256
x -> Left ("Unable to parse HashType from: " <> x)
instance ToHttpApiData HashType where
toQueryParam = \case
HashTypeUnspecified -> "HASH_TYPE_UNSPECIFIED"
SHA256 -> "SHA256"
instance FromJSON HashType where
parseJSON = parseJSONText "HashType"
instance ToJSON HashType where
toJSON = toJSONText
data BuildSignatureKeyType
= KeyTypeUnspecified
| PgpAsciiArmored
| PkixPem
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildSignatureKeyType
instance FromHttpApiData BuildSignatureKeyType where
parseQueryParam = \case
"KEY_TYPE_UNSPECIFIED" -> Right KeyTypeUnspecified
"PGP_ASCII_ARMORED" -> Right PgpAsciiArmored
"PKIX_PEM" -> Right PkixPem
x -> Left ("Unable to parse BuildSignatureKeyType from: " <> x)
instance ToHttpApiData BuildSignatureKeyType where
toQueryParam = \case
KeyTypeUnspecified -> "KEY_TYPE_UNSPECIFIED"
PgpAsciiArmored -> "PGP_ASCII_ARMORED"
PkixPem -> "PKIX_PEM"
instance FromJSON BuildSignatureKeyType where
parseJSON = parseJSONText "BuildSignatureKeyType"
instance ToJSON BuildSignatureKeyType where
toJSON = toJSONText
data DiscoveryAnalysisKind
= DAKNoteKindUnspecified
| DAKVulnerability
| DAKBuild
| DAKImage
| DAKPackage
| DAKDeployment
| DAKDiscovery
| DAKAttestation
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DiscoveryAnalysisKind
instance FromHttpApiData DiscoveryAnalysisKind where
parseQueryParam = \case
"NOTE_KIND_UNSPECIFIED" -> Right DAKNoteKindUnspecified
"VULNERABILITY" -> Right DAKVulnerability
"BUILD" -> Right DAKBuild
"IMAGE" -> Right DAKImage
"PACKAGE" -> Right DAKPackage
"DEPLOYMENT" -> Right DAKDeployment
"DISCOVERY" -> Right DAKDiscovery
"ATTESTATION" -> Right DAKAttestation
x -> Left ("Unable to parse DiscoveryAnalysisKind from: " <> x)
instance ToHttpApiData DiscoveryAnalysisKind where
toQueryParam = \case
DAKNoteKindUnspecified -> "NOTE_KIND_UNSPECIFIED"
DAKVulnerability -> "VULNERABILITY"
DAKBuild -> "BUILD"
DAKImage -> "IMAGE"
DAKPackage -> "PACKAGE"
DAKDeployment -> "DEPLOYMENT"
DAKDiscovery -> "DISCOVERY"
DAKAttestation -> "ATTESTATION"
instance FromJSON DiscoveryAnalysisKind where
parseJSON = parseJSONText "DiscoveryAnalysisKind"
instance ToJSON DiscoveryAnalysisKind where
toJSON = toJSONText
data AliasContextKind
= KindUnspecified
| Fixed
| Movable
| Other
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AliasContextKind
instance FromHttpApiData AliasContextKind where
parseQueryParam = \case
"KIND_UNSPECIFIED" -> Right KindUnspecified
"FIXED" -> Right Fixed
"MOVABLE" -> Right Movable
"OTHER" -> Right Other
x -> Left ("Unable to parse AliasContextKind from: " <> x)
instance ToHttpApiData AliasContextKind where
toQueryParam = \case
KindUnspecified -> "KIND_UNSPECIFIED"
Fixed -> "FIXED"
Movable -> "MOVABLE"
Other -> "OTHER"
instance FromJSON AliasContextKind where
parseJSON = parseJSONText "AliasContextKind"
instance ToJSON AliasContextKind where
toJSON = toJSONText