{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.DNS.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data DNSKeySpecAlgorithm
= ECDSAP256SHA256
| ECDSAP384SHA384
| RSASHA1
| RSASHA256
| RSASHA512
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DNSKeySpecAlgorithm
instance FromHttpApiData DNSKeySpecAlgorithm where
parseQueryParam = \case
"ECDSAP256SHA256" -> Right ECDSAP256SHA256
"ECDSAP384SHA384" -> Right ECDSAP384SHA384
"RSASHA1" -> Right RSASHA1
"RSASHA256" -> Right RSASHA256
"RSASHA512" -> Right RSASHA512
x -> Left ("Unable to parse DNSKeySpecAlgorithm from: " <> x)
instance ToHttpApiData DNSKeySpecAlgorithm where
toQueryParam = \case
ECDSAP256SHA256 -> "ECDSAP256SHA256"
ECDSAP384SHA384 -> "ECDSAP384SHA384"
RSASHA1 -> "RSASHA1"
RSASHA256 -> "RSASHA256"
RSASHA512 -> "RSASHA512"
instance FromJSON DNSKeySpecAlgorithm where
parseJSON = parseJSONText "DNSKeySpecAlgorithm"
instance ToJSON DNSKeySpecAlgorithm where
toJSON = toJSONText
data ManagedZoneDNSSecConfigNonExistence
= Nsec
| NSEC3
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ManagedZoneDNSSecConfigNonExistence
instance FromHttpApiData ManagedZoneDNSSecConfigNonExistence where
parseQueryParam = \case
"NSEC" -> Right Nsec
"NSEC3" -> Right NSEC3
x -> Left ("Unable to parse ManagedZoneDNSSecConfigNonExistence from: " <> x)
instance ToHttpApiData ManagedZoneDNSSecConfigNonExistence where
toQueryParam = \case
Nsec -> "NSEC"
NSEC3 -> "NSEC3"
instance FromJSON ManagedZoneDNSSecConfigNonExistence where
parseJSON = parseJSONText "ManagedZoneDNSSecConfigNonExistence"
instance ToJSON ManagedZoneDNSSecConfigNonExistence where
toJSON = toJSONText
data ManagedZoneDNSSecConfigState
= Off
| ON
| Transfer
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ManagedZoneDNSSecConfigState
instance FromHttpApiData ManagedZoneDNSSecConfigState where
parseQueryParam = \case
"OFF" -> Right Off
"ON" -> Right ON
"TRANSFER" -> Right Transfer
x -> Left ("Unable to parse ManagedZoneDNSSecConfigState from: " <> x)
instance ToHttpApiData ManagedZoneDNSSecConfigState where
toQueryParam = \case
Off -> "OFF"
ON -> "ON"
Transfer -> "TRANSFER"
instance FromJSON ManagedZoneDNSSecConfigState where
parseJSON = parseJSONText "ManagedZoneDNSSecConfigState"
instance ToJSON ManagedZoneDNSSecConfigState where
toJSON = toJSONText
data ChangesListSortBy
= ChangeSequence
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ChangesListSortBy
instance FromHttpApiData ChangesListSortBy where
parseQueryParam = \case
"CHANGE_SEQUENCE" -> Right ChangeSequence
x -> Left ("Unable to parse ChangesListSortBy from: " <> x)
instance ToHttpApiData ChangesListSortBy where
toQueryParam = \case
ChangeSequence -> "CHANGE_SEQUENCE"
instance FromJSON ChangesListSortBy where
parseJSON = parseJSONText "ChangesListSortBy"
instance ToJSON ChangesListSortBy where
toJSON = toJSONText
data DNSKeyDigestType
= SHA1
| SHA256
| SHA384
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DNSKeyDigestType
instance FromHttpApiData DNSKeyDigestType where
parseQueryParam = \case
"SHA1" -> Right SHA1
"SHA256" -> Right SHA256
"SHA384" -> Right SHA384
x -> Left ("Unable to parse DNSKeyDigestType from: " <> x)
instance ToHttpApiData DNSKeyDigestType where
toQueryParam = \case
SHA1 -> "SHA1"
SHA256 -> "SHA256"
SHA384 -> "SHA384"
instance FromJSON DNSKeyDigestType where
parseJSON = parseJSONText "DNSKeyDigestType"
instance ToJSON DNSKeyDigestType where
toJSON = toJSONText
data OperationStatus
= Done
| Pending
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationStatus
instance FromHttpApiData OperationStatus where
parseQueryParam = \case
"DONE" -> Right Done
"PENDING" -> Right Pending
x -> Left ("Unable to parse OperationStatus from: " <> x)
instance ToHttpApiData OperationStatus where
toQueryParam = \case
Done -> "DONE"
Pending -> "PENDING"
instance FromJSON OperationStatus where
parseJSON = parseJSONText "OperationStatus"
instance ToJSON OperationStatus where
toJSON = toJSONText
data DNSKeyAlgorithm
= DKAECDSAP256SHA256
| DKAECDSAP384SHA384
| DKARSASHA1
| DKARSASHA256
| DKARSASHA512
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DNSKeyAlgorithm
instance FromHttpApiData DNSKeyAlgorithm where
parseQueryParam = \case
"ECDSAP256SHA256" -> Right DKAECDSAP256SHA256
"ECDSAP384SHA384" -> Right DKAECDSAP384SHA384
"RSASHA1" -> Right DKARSASHA1
"RSASHA256" -> Right DKARSASHA256
"RSASHA512" -> Right DKARSASHA512
x -> Left ("Unable to parse DNSKeyAlgorithm from: " <> x)
instance ToHttpApiData DNSKeyAlgorithm where
toQueryParam = \case
DKAECDSAP256SHA256 -> "ECDSAP256SHA256"
DKAECDSAP384SHA384 -> "ECDSAP384SHA384"
DKARSASHA1 -> "RSASHA1"
DKARSASHA256 -> "RSASHA256"
DKARSASHA512 -> "RSASHA512"
instance FromJSON DNSKeyAlgorithm where
parseJSON = parseJSONText "DNSKeyAlgorithm"
instance ToJSON DNSKeyAlgorithm where
toJSON = toJSONText
data DNSKeySpecKeyType
= KeySigning
| ZoneSigning
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DNSKeySpecKeyType
instance FromHttpApiData DNSKeySpecKeyType where
parseQueryParam = \case
"KEY_SIGNING" -> Right KeySigning
"ZONE_SIGNING" -> Right ZoneSigning
x -> Left ("Unable to parse DNSKeySpecKeyType from: " <> x)
instance ToHttpApiData DNSKeySpecKeyType where
toQueryParam = \case
KeySigning -> "KEY_SIGNING"
ZoneSigning -> "ZONE_SIGNING"
instance FromJSON DNSKeySpecKeyType where
parseJSON = parseJSONText "DNSKeySpecKeyType"
instance ToJSON DNSKeySpecKeyType where
toJSON = toJSONText
data ChangeStatus
= CSDone
| CSPending
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ChangeStatus
instance FromHttpApiData ChangeStatus where
parseQueryParam = \case
"DONE" -> Right CSDone
"PENDING" -> Right CSPending
x -> Left ("Unable to parse ChangeStatus from: " <> x)
instance ToHttpApiData ChangeStatus where
toQueryParam = \case
CSDone -> "DONE"
CSPending -> "PENDING"
instance FromJSON ChangeStatus where
parseJSON = parseJSONText "ChangeStatus"
instance ToJSON ChangeStatus where
toJSON = toJSONText
data DNSKeyType
= DKTKeySigning
| DKTZoneSigning
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DNSKeyType
instance FromHttpApiData DNSKeyType where
parseQueryParam = \case
"KEY_SIGNING" -> Right DKTKeySigning
"ZONE_SIGNING" -> Right DKTZoneSigning
x -> Left ("Unable to parse DNSKeyType from: " <> x)
instance ToHttpApiData DNSKeyType where
toQueryParam = \case
DKTKeySigning -> "KEY_SIGNING"
DKTZoneSigning -> "ZONE_SIGNING"
instance FromJSON DNSKeyType where
parseJSON = parseJSONText "DNSKeyType"
instance ToJSON DNSKeyType where
toJSON = toJSONText
data ManagedZoneOperationsListSortBy
= ID
| StartTime
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ManagedZoneOperationsListSortBy
instance FromHttpApiData ManagedZoneOperationsListSortBy where
parseQueryParam = \case
"ID" -> Right ID
"START_TIME" -> Right StartTime
x -> Left ("Unable to parse ManagedZoneOperationsListSortBy from: " <> x)
instance ToHttpApiData ManagedZoneOperationsListSortBy where
toQueryParam = \case
ID -> "ID"
StartTime -> "START_TIME"
instance FromJSON ManagedZoneOperationsListSortBy where
parseJSON = parseJSONText "ManagedZoneOperationsListSortBy"
instance ToJSON ManagedZoneOperationsListSortBy where
toJSON = toJSONText