{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.ProximityBeacon.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data BeaconExpectedStability
= StabilityUnspecified
| Stable
| Portable
| Mobile
| Roving
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BeaconExpectedStability
instance FromHttpApiData BeaconExpectedStability where
parseQueryParam = \case
"STABILITY_UNSPECIFIED" -> Right StabilityUnspecified
"STABLE" -> Right Stable
"PORTABLE" -> Right Portable
"MOBILE" -> Right Mobile
"ROVING" -> Right Roving
x -> Left ("Unable to parse BeaconExpectedStability from: " <> x)
instance ToHttpApiData BeaconExpectedStability where
toQueryParam = \case
StabilityUnspecified -> "STABILITY_UNSPECIFIED"
Stable -> "STABLE"
Portable -> "PORTABLE"
Mobile -> "MOBILE"
Roving -> "ROVING"
instance FromJSON BeaconExpectedStability where
parseJSON = parseJSONText "BeaconExpectedStability"
instance ToJSON BeaconExpectedStability where
toJSON = toJSONText
data NamespaceServingVisibility
= VisibilityUnspecified
| UnListed
| Public
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable NamespaceServingVisibility
instance FromHttpApiData NamespaceServingVisibility where
parseQueryParam = \case
"VISIBILITY_UNSPECIFIED" -> Right VisibilityUnspecified
"UNLISTED" -> Right UnListed
"PUBLIC" -> Right Public
x -> Left ("Unable to parse NamespaceServingVisibility from: " <> x)
instance ToHttpApiData NamespaceServingVisibility where
toQueryParam = \case
VisibilityUnspecified -> "VISIBILITY_UNSPECIFIED"
UnListed -> "UNLISTED"
Public -> "PUBLIC"
instance FromJSON NamespaceServingVisibility where
parseJSON = parseJSONText "NamespaceServingVisibility"
instance ToJSON NamespaceServingVisibility where
toJSON = toJSONText
data AdvertisedIdType
= TypeUnspecified
| Eddystone
| Ibeacon
| Altbeacon
| EddystoneEid
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AdvertisedIdType
instance FromHttpApiData AdvertisedIdType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"EDDYSTONE" -> Right Eddystone
"IBEACON" -> Right Ibeacon
"ALTBEACON" -> Right Altbeacon
"EDDYSTONE_EID" -> Right EddystoneEid
x -> Left ("Unable to parse AdvertisedIdType from: " <> x)
instance ToHttpApiData AdvertisedIdType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
Eddystone -> "EDDYSTONE"
Ibeacon -> "IBEACON"
Altbeacon -> "ALTBEACON"
EddystoneEid -> "EDDYSTONE_EID"
instance FromJSON AdvertisedIdType where
parseJSON = parseJSONText "AdvertisedIdType"
instance ToJSON AdvertisedIdType 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 BeaconStatus
= StatusUnspecified
| Active
| Decommissioned
| Inactive
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BeaconStatus
instance FromHttpApiData BeaconStatus where
parseQueryParam = \case
"STATUS_UNSPECIFIED" -> Right StatusUnspecified
"ACTIVE" -> Right Active
"DECOMMISSIONED" -> Right Decommissioned
"INACTIVE" -> Right Inactive
x -> Left ("Unable to parse BeaconStatus from: " <> x)
instance ToHttpApiData BeaconStatus where
toQueryParam = \case
StatusUnspecified -> "STATUS_UNSPECIFIED"
Active -> "ACTIVE"
Decommissioned -> "DECOMMISSIONED"
Inactive -> "INACTIVE"
instance FromJSON BeaconStatus where
parseJSON = parseJSONText "BeaconStatus"
instance ToJSON BeaconStatus where
toJSON = toJSONText