{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.ResourceManager.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data FolderLifecycleState
= LifecycleStateUnspecified
| Active
| DeleteRequested
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FolderLifecycleState
instance FromHttpApiData FolderLifecycleState where
parseQueryParam = \case
"LIFECYCLE_STATE_UNSPECIFIED" -> Right LifecycleStateUnspecified
"ACTIVE" -> Right Active
"DELETE_REQUESTED" -> Right DeleteRequested
x -> Left ("Unable to parse FolderLifecycleState from: " <> x)
instance ToHttpApiData FolderLifecycleState where
toQueryParam = \case
LifecycleStateUnspecified -> "LIFECYCLE_STATE_UNSPECIFIED"
Active -> "ACTIVE"
DeleteRequested -> "DELETE_REQUESTED"
instance FromJSON FolderLifecycleState where
parseJSON = parseJSONText "FolderLifecycleState"
instance ToJSON FolderLifecycleState where
toJSON = toJSONText
data FolderOperationErrorErrorMessageId
= ErrorTypeUnspecified
| ActiveFolderHeightViolation
| MaxChildFoldersViolation
| FolderNameUniquenessViolation
| ResourceDeletedViolation
| ParentDeletedViolation
| CycleIntroducedViolation
| FolderBeingMovedViolation
| FolderToDeleteNonEmptyViolation
| DeletedFolderHeightViolation
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FolderOperationErrorErrorMessageId
instance FromHttpApiData FolderOperationErrorErrorMessageId where
parseQueryParam = \case
"ERROR_TYPE_UNSPECIFIED" -> Right ErrorTypeUnspecified
"ACTIVE_FOLDER_HEIGHT_VIOLATION" -> Right ActiveFolderHeightViolation
"MAX_CHILD_FOLDERS_VIOLATION" -> Right MaxChildFoldersViolation
"FOLDER_NAME_UNIQUENESS_VIOLATION" -> Right FolderNameUniquenessViolation
"RESOURCE_DELETED_VIOLATION" -> Right ResourceDeletedViolation
"PARENT_DELETED_VIOLATION" -> Right ParentDeletedViolation
"CYCLE_INTRODUCED_VIOLATION" -> Right CycleIntroducedViolation
"FOLDER_BEING_MOVED_VIOLATION" -> Right FolderBeingMovedViolation
"FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" -> Right FolderToDeleteNonEmptyViolation
"DELETED_FOLDER_HEIGHT_VIOLATION" -> Right DeletedFolderHeightViolation
x -> Left ("Unable to parse FolderOperationErrorErrorMessageId from: " <> x)
instance ToHttpApiData FolderOperationErrorErrorMessageId where
toQueryParam = \case
ErrorTypeUnspecified -> "ERROR_TYPE_UNSPECIFIED"
ActiveFolderHeightViolation -> "ACTIVE_FOLDER_HEIGHT_VIOLATION"
MaxChildFoldersViolation -> "MAX_CHILD_FOLDERS_VIOLATION"
FolderNameUniquenessViolation -> "FOLDER_NAME_UNIQUENESS_VIOLATION"
ResourceDeletedViolation -> "RESOURCE_DELETED_VIOLATION"
ParentDeletedViolation -> "PARENT_DELETED_VIOLATION"
CycleIntroducedViolation -> "CYCLE_INTRODUCED_VIOLATION"
FolderBeingMovedViolation -> "FOLDER_BEING_MOVED_VIOLATION"
FolderToDeleteNonEmptyViolation -> "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION"
DeletedFolderHeightViolation -> "DELETED_FOLDER_HEIGHT_VIOLATION"
instance FromJSON FolderOperationErrorErrorMessageId where
parseJSON = parseJSONText "FolderOperationErrorErrorMessageId"
instance ToJSON FolderOperationErrorErrorMessageId where
toJSON = toJSONText
data FolderOperationOperationType
= OperationTypeUnspecified
| Create
| Move
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FolderOperationOperationType
instance FromHttpApiData FolderOperationOperationType where
parseQueryParam = \case
"OPERATION_TYPE_UNSPECIFIED" -> Right OperationTypeUnspecified
"CREATE" -> Right Create
"MOVE" -> Right Move
x -> Left ("Unable to parse FolderOperationOperationType from: " <> x)
instance ToHttpApiData FolderOperationOperationType where
toQueryParam = \case
OperationTypeUnspecified -> "OPERATION_TYPE_UNSPECIFIED"
Create -> "CREATE"
Move -> "MOVE"
instance FromJSON FolderOperationOperationType where
parseJSON = parseJSONText "FolderOperationOperationType"
instance ToJSON FolderOperationOperationType 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