{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.ProximityBeacon.Types.Product where
import Network.Google.Prelude
import Network.Google.ProximityBeacon.Types.Sum
data LatLng = LatLng'
{ _llLatitude :: !(Maybe (Textual Double))
, _llLongitude :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
latLng
:: LatLng
latLng =
LatLng'
{ _llLatitude = Nothing
, _llLongitude = Nothing
}
llLatitude :: Lens' LatLng (Maybe Double)
llLatitude
= lens _llLatitude (\ s a -> s{_llLatitude = a}) .
mapping _Coerce
llLongitude :: Lens' LatLng (Maybe Double)
llLongitude
= lens _llLongitude (\ s a -> s{_llLongitude = a}) .
mapping _Coerce
instance FromJSON LatLng where
parseJSON
= withObject "LatLng"
(\ o ->
LatLng' <$>
(o .:? "latitude") <*> (o .:? "longitude"))
instance ToJSON LatLng where
toJSON LatLng'{..}
= object
(catMaybes
[("latitude" .=) <$> _llLatitude,
("longitude" .=) <$> _llLongitude])
data AttachmentInfo = AttachmentInfo'
{ _aiMaxDistanceMeters :: !(Maybe (Textual Double))
, _aiData :: !(Maybe Bytes)
, _aiNamespacedType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
attachmentInfo
:: AttachmentInfo
attachmentInfo =
AttachmentInfo'
{ _aiMaxDistanceMeters = Nothing
, _aiData = Nothing
, _aiNamespacedType = Nothing
}
aiMaxDistanceMeters :: Lens' AttachmentInfo (Maybe Double)
aiMaxDistanceMeters
= lens _aiMaxDistanceMeters
(\ s a -> s{_aiMaxDistanceMeters = a})
. mapping _Coerce
aiData :: Lens' AttachmentInfo (Maybe ByteString)
aiData
= lens _aiData (\ s a -> s{_aiData = a}) .
mapping _Bytes
aiNamespacedType :: Lens' AttachmentInfo (Maybe Text)
aiNamespacedType
= lens _aiNamespacedType
(\ s a -> s{_aiNamespacedType = a})
instance FromJSON AttachmentInfo where
parseJSON
= withObject "AttachmentInfo"
(\ o ->
AttachmentInfo' <$>
(o .:? "maxDistanceMeters") <*> (o .:? "data") <*>
(o .:? "namespacedType"))
instance ToJSON AttachmentInfo where
toJSON AttachmentInfo'{..}
= object
(catMaybes
[("maxDistanceMeters" .=) <$> _aiMaxDistanceMeters,
("data" .=) <$> _aiData,
("namespacedType" .=) <$> _aiNamespacedType])
newtype BeaconProperties = BeaconProperties'
{ _bpAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
beaconProperties
:: HashMap Text Text
-> BeaconProperties
beaconProperties pBpAddtional_ =
BeaconProperties'
{ _bpAddtional = _Coerce # pBpAddtional_
}
bpAddtional :: Lens' BeaconProperties (HashMap Text Text)
bpAddtional
= lens _bpAddtional (\ s a -> s{_bpAddtional = a}) .
_Coerce
instance FromJSON BeaconProperties where
parseJSON
= withObject "BeaconProperties"
(\ o -> BeaconProperties' <$> (parseJSONObject o))
instance ToJSON BeaconProperties where
toJSON = toJSON . _bpAddtional
data Empty =
Empty'
deriving (Eq,Show,Data,Typeable,Generic)
empty
:: Empty
empty = Empty'
instance FromJSON Empty where
parseJSON = withObject "Empty" (\ o -> pure Empty')
instance ToJSON Empty where
toJSON = const emptyObject
newtype DeleteAttachmentsResponse = DeleteAttachmentsResponse'
{ _darNumDeleted :: Maybe (Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
deleteAttachmentsResponse
:: DeleteAttachmentsResponse
deleteAttachmentsResponse =
DeleteAttachmentsResponse'
{ _darNumDeleted = Nothing
}
darNumDeleted :: Lens' DeleteAttachmentsResponse (Maybe Int32)
darNumDeleted
= lens _darNumDeleted
(\ s a -> s{_darNumDeleted = a})
. mapping _Coerce
instance FromJSON DeleteAttachmentsResponse where
parseJSON
= withObject "DeleteAttachmentsResponse"
(\ o ->
DeleteAttachmentsResponse' <$> (o .:? "numDeleted"))
instance ToJSON DeleteAttachmentsResponse where
toJSON DeleteAttachmentsResponse'{..}
= object
(catMaybes [("numDeleted" .=) <$> _darNumDeleted])
data GetInfoForObservedBeaconsRequest = GetInfoForObservedBeaconsRequest'
{ _gifobrObservations :: !(Maybe [Observation])
, _gifobrNamespacedTypes :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
getInfoForObservedBeaconsRequest
:: GetInfoForObservedBeaconsRequest
getInfoForObservedBeaconsRequest =
GetInfoForObservedBeaconsRequest'
{ _gifobrObservations = Nothing
, _gifobrNamespacedTypes = Nothing
}
gifobrObservations :: Lens' GetInfoForObservedBeaconsRequest [Observation]
gifobrObservations
= lens _gifobrObservations
(\ s a -> s{_gifobrObservations = a})
. _Default
. _Coerce
gifobrNamespacedTypes :: Lens' GetInfoForObservedBeaconsRequest [Text]
gifobrNamespacedTypes
= lens _gifobrNamespacedTypes
(\ s a -> s{_gifobrNamespacedTypes = a})
. _Default
. _Coerce
instance FromJSON GetInfoForObservedBeaconsRequest
where
parseJSON
= withObject "GetInfoForObservedBeaconsRequest"
(\ o ->
GetInfoForObservedBeaconsRequest' <$>
(o .:? "observations" .!= mempty) <*>
(o .:? "namespacedTypes" .!= mempty))
instance ToJSON GetInfoForObservedBeaconsRequest
where
toJSON GetInfoForObservedBeaconsRequest'{..}
= object
(catMaybes
[("observations" .=) <$> _gifobrObservations,
("namespacedTypes" .=) <$> _gifobrNamespacedTypes])
data Namespace = Namespace'
{ _nServingVisibility :: !(Maybe NamespaceServingVisibility)
, _nNamespaceName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
namespace
:: Namespace
namespace =
Namespace'
{ _nServingVisibility = Nothing
, _nNamespaceName = Nothing
}
nServingVisibility :: Lens' Namespace (Maybe NamespaceServingVisibility)
nServingVisibility
= lens _nServingVisibility
(\ s a -> s{_nServingVisibility = a})
nNamespaceName :: Lens' Namespace (Maybe Text)
nNamespaceName
= lens _nNamespaceName
(\ s a -> s{_nNamespaceName = a})
instance FromJSON Namespace where
parseJSON
= withObject "Namespace"
(\ o ->
Namespace' <$>
(o .:? "servingVisibility") <*>
(o .:? "namespaceName"))
instance ToJSON Namespace where
toJSON Namespace'{..}
= object
(catMaybes
[("servingVisibility" .=) <$> _nServingVisibility,
("namespaceName" .=) <$> _nNamespaceName])
data EphemeralIdRegistration = EphemeralIdRegistration'
{ _eirRotationPeriodExponent :: !(Maybe (Textual Word32))
, _eirInitialClockValue :: !(Maybe (Textual Word64))
, _eirBeaconIdentityKey :: !(Maybe Bytes)
, _eirBeaconEcdhPublicKey :: !(Maybe Bytes)
, _eirInitialEid :: !(Maybe Bytes)
, _eirServiceEcdhPublicKey :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
ephemeralIdRegistration
:: EphemeralIdRegistration
ephemeralIdRegistration =
EphemeralIdRegistration'
{ _eirRotationPeriodExponent = Nothing
, _eirInitialClockValue = Nothing
, _eirBeaconIdentityKey = Nothing
, _eirBeaconEcdhPublicKey = Nothing
, _eirInitialEid = Nothing
, _eirServiceEcdhPublicKey = Nothing
}
eirRotationPeriodExponent :: Lens' EphemeralIdRegistration (Maybe Word32)
eirRotationPeriodExponent
= lens _eirRotationPeriodExponent
(\ s a -> s{_eirRotationPeriodExponent = a})
. mapping _Coerce
eirInitialClockValue :: Lens' EphemeralIdRegistration (Maybe Word64)
eirInitialClockValue
= lens _eirInitialClockValue
(\ s a -> s{_eirInitialClockValue = a})
. mapping _Coerce
eirBeaconIdentityKey :: Lens' EphemeralIdRegistration (Maybe ByteString)
eirBeaconIdentityKey
= lens _eirBeaconIdentityKey
(\ s a -> s{_eirBeaconIdentityKey = a})
. mapping _Bytes
eirBeaconEcdhPublicKey :: Lens' EphemeralIdRegistration (Maybe ByteString)
eirBeaconEcdhPublicKey
= lens _eirBeaconEcdhPublicKey
(\ s a -> s{_eirBeaconEcdhPublicKey = a})
. mapping _Bytes
eirInitialEid :: Lens' EphemeralIdRegistration (Maybe ByteString)
eirInitialEid
= lens _eirInitialEid
(\ s a -> s{_eirInitialEid = a})
. mapping _Bytes
eirServiceEcdhPublicKey :: Lens' EphemeralIdRegistration (Maybe ByteString)
eirServiceEcdhPublicKey
= lens _eirServiceEcdhPublicKey
(\ s a -> s{_eirServiceEcdhPublicKey = a})
. mapping _Bytes
instance FromJSON EphemeralIdRegistration where
parseJSON
= withObject "EphemeralIdRegistration"
(\ o ->
EphemeralIdRegistration' <$>
(o .:? "rotationPeriodExponent") <*>
(o .:? "initialClockValue")
<*> (o .:? "beaconIdentityKey")
<*> (o .:? "beaconEcdhPublicKey")
<*> (o .:? "initialEid")
<*> (o .:? "serviceEcdhPublicKey"))
instance ToJSON EphemeralIdRegistration where
toJSON EphemeralIdRegistration'{..}
= object
(catMaybes
[("rotationPeriodExponent" .=) <$>
_eirRotationPeriodExponent,
("initialClockValue" .=) <$> _eirInitialClockValue,
("beaconIdentityKey" .=) <$> _eirBeaconIdentityKey,
("beaconEcdhPublicKey" .=) <$>
_eirBeaconEcdhPublicKey,
("initialEid" .=) <$> _eirInitialEid,
("serviceEcdhPublicKey" .=) <$>
_eirServiceEcdhPublicKey])
newtype ListNamespacesResponse = ListNamespacesResponse'
{ _lnrNamespaces :: Maybe [Namespace]
} deriving (Eq,Show,Data,Typeable,Generic)
listNamespacesResponse
:: ListNamespacesResponse
listNamespacesResponse =
ListNamespacesResponse'
{ _lnrNamespaces = Nothing
}
lnrNamespaces :: Lens' ListNamespacesResponse [Namespace]
lnrNamespaces
= lens _lnrNamespaces
(\ s a -> s{_lnrNamespaces = a})
. _Default
. _Coerce
instance FromJSON ListNamespacesResponse where
parseJSON
= withObject "ListNamespacesResponse"
(\ o ->
ListNamespacesResponse' <$>
(o .:? "namespaces" .!= mempty))
instance ToJSON ListNamespacesResponse where
toJSON ListNamespacesResponse'{..}
= object
(catMaybes [("namespaces" .=) <$> _lnrNamespaces])
data Date = Date'
{ _dDay :: !(Maybe (Textual Int32))
, _dYear :: !(Maybe (Textual Int32))
, _dMonth :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
date
:: Date
date =
Date'
{ _dDay = Nothing
, _dYear = Nothing
, _dMonth = Nothing
}
dDay :: Lens' Date (Maybe Int32)
dDay
= lens _dDay (\ s a -> s{_dDay = a}) .
mapping _Coerce
dYear :: Lens' Date (Maybe Int32)
dYear
= lens _dYear (\ s a -> s{_dYear = a}) .
mapping _Coerce
dMonth :: Lens' Date (Maybe Int32)
dMonth
= lens _dMonth (\ s a -> s{_dMonth = a}) .
mapping _Coerce
instance FromJSON Date where
parseJSON
= withObject "Date"
(\ o ->
Date' <$>
(o .:? "day") <*> (o .:? "year") <*> (o .:? "month"))
instance ToJSON Date where
toJSON Date'{..}
= object
(catMaybes
[("day" .=) <$> _dDay, ("year" .=) <$> _dYear,
("month" .=) <$> _dMonth])
data Beacon = Beacon'
{ _beaLatLng :: !(Maybe LatLng)
, _beaStatus :: !(Maybe BeaconStatus)
, _beaBeaconName :: !(Maybe Text)
, _beaEphemeralIdRegistration :: !(Maybe EphemeralIdRegistration)
, _beaIndoorLevel :: !(Maybe IndoorLevel)
, _beaExpectedStability :: !(Maybe BeaconExpectedStability)
, _beaProvisioningKey :: !(Maybe Bytes)
, _beaDescription :: !(Maybe Text)
, _beaPlaceId :: !(Maybe Text)
, _beaAdvertisedId :: !(Maybe AdvertisedId)
, _beaProperties :: !(Maybe BeaconProperties)
} deriving (Eq,Show,Data,Typeable,Generic)
beacon
:: Beacon
beacon =
Beacon'
{ _beaLatLng = Nothing
, _beaStatus = Nothing
, _beaBeaconName = Nothing
, _beaEphemeralIdRegistration = Nothing
, _beaIndoorLevel = Nothing
, _beaExpectedStability = Nothing
, _beaProvisioningKey = Nothing
, _beaDescription = Nothing
, _beaPlaceId = Nothing
, _beaAdvertisedId = Nothing
, _beaProperties = Nothing
}
beaLatLng :: Lens' Beacon (Maybe LatLng)
beaLatLng
= lens _beaLatLng (\ s a -> s{_beaLatLng = a})
beaStatus :: Lens' Beacon (Maybe BeaconStatus)
beaStatus
= lens _beaStatus (\ s a -> s{_beaStatus = a})
beaBeaconName :: Lens' Beacon (Maybe Text)
beaBeaconName
= lens _beaBeaconName
(\ s a -> s{_beaBeaconName = a})
beaEphemeralIdRegistration :: Lens' Beacon (Maybe EphemeralIdRegistration)
beaEphemeralIdRegistration
= lens _beaEphemeralIdRegistration
(\ s a -> s{_beaEphemeralIdRegistration = a})
beaIndoorLevel :: Lens' Beacon (Maybe IndoorLevel)
beaIndoorLevel
= lens _beaIndoorLevel
(\ s a -> s{_beaIndoorLevel = a})
beaExpectedStability :: Lens' Beacon (Maybe BeaconExpectedStability)
beaExpectedStability
= lens _beaExpectedStability
(\ s a -> s{_beaExpectedStability = a})
beaProvisioningKey :: Lens' Beacon (Maybe ByteString)
beaProvisioningKey
= lens _beaProvisioningKey
(\ s a -> s{_beaProvisioningKey = a})
. mapping _Bytes
beaDescription :: Lens' Beacon (Maybe Text)
beaDescription
= lens _beaDescription
(\ s a -> s{_beaDescription = a})
beaPlaceId :: Lens' Beacon (Maybe Text)
beaPlaceId
= lens _beaPlaceId (\ s a -> s{_beaPlaceId = a})
beaAdvertisedId :: Lens' Beacon (Maybe AdvertisedId)
beaAdvertisedId
= lens _beaAdvertisedId
(\ s a -> s{_beaAdvertisedId = a})
beaProperties :: Lens' Beacon (Maybe BeaconProperties)
beaProperties
= lens _beaProperties
(\ s a -> s{_beaProperties = a})
instance FromJSON Beacon where
parseJSON
= withObject "Beacon"
(\ o ->
Beacon' <$>
(o .:? "latLng") <*> (o .:? "status") <*>
(o .:? "beaconName")
<*> (o .:? "ephemeralIdRegistration")
<*> (o .:? "indoorLevel")
<*> (o .:? "expectedStability")
<*> (o .:? "provisioningKey")
<*> (o .:? "description")
<*> (o .:? "placeId")
<*> (o .:? "advertisedId")
<*> (o .:? "properties"))
instance ToJSON Beacon where
toJSON Beacon'{..}
= object
(catMaybes
[("latLng" .=) <$> _beaLatLng,
("status" .=) <$> _beaStatus,
("beaconName" .=) <$> _beaBeaconName,
("ephemeralIdRegistration" .=) <$>
_beaEphemeralIdRegistration,
("indoorLevel" .=) <$> _beaIndoorLevel,
("expectedStability" .=) <$> _beaExpectedStability,
("provisioningKey" .=) <$> _beaProvisioningKey,
("description" .=) <$> _beaDescription,
("placeId" .=) <$> _beaPlaceId,
("advertisedId" .=) <$> _beaAdvertisedId,
("properties" .=) <$> _beaProperties])
data Diagnostics = Diagnostics'
{ _dAlerts :: !(Maybe [Text])
, _dBeaconName :: !(Maybe Text)
, _dEstimatedLowBatteryDate :: !(Maybe Date)
} deriving (Eq,Show,Data,Typeable,Generic)
diagnostics
:: Diagnostics
diagnostics =
Diagnostics'
{ _dAlerts = Nothing
, _dBeaconName = Nothing
, _dEstimatedLowBatteryDate = Nothing
}
dAlerts :: Lens' Diagnostics [Text]
dAlerts
= lens _dAlerts (\ s a -> s{_dAlerts = a}) . _Default
. _Coerce
dBeaconName :: Lens' Diagnostics (Maybe Text)
dBeaconName
= lens _dBeaconName (\ s a -> s{_dBeaconName = a})
dEstimatedLowBatteryDate :: Lens' Diagnostics (Maybe Date)
dEstimatedLowBatteryDate
= lens _dEstimatedLowBatteryDate
(\ s a -> s{_dEstimatedLowBatteryDate = a})
instance FromJSON Diagnostics where
parseJSON
= withObject "Diagnostics"
(\ o ->
Diagnostics' <$>
(o .:? "alerts" .!= mempty) <*> (o .:? "beaconName")
<*> (o .:? "estimatedLowBatteryDate"))
instance ToJSON Diagnostics where
toJSON Diagnostics'{..}
= object
(catMaybes
[("alerts" .=) <$> _dAlerts,
("beaconName" .=) <$> _dBeaconName,
("estimatedLowBatteryDate" .=) <$>
_dEstimatedLowBatteryDate])
newtype ListBeaconAttachmentsResponse = ListBeaconAttachmentsResponse'
{ _lbarAttachments :: Maybe [BeaconAttachment]
} deriving (Eq,Show,Data,Typeable,Generic)
listBeaconAttachmentsResponse
:: ListBeaconAttachmentsResponse
listBeaconAttachmentsResponse =
ListBeaconAttachmentsResponse'
{ _lbarAttachments = Nothing
}
lbarAttachments :: Lens' ListBeaconAttachmentsResponse [BeaconAttachment]
lbarAttachments
= lens _lbarAttachments
(\ s a -> s{_lbarAttachments = a})
. _Default
. _Coerce
instance FromJSON ListBeaconAttachmentsResponse where
parseJSON
= withObject "ListBeaconAttachmentsResponse"
(\ o ->
ListBeaconAttachmentsResponse' <$>
(o .:? "attachments" .!= mempty))
instance ToJSON ListBeaconAttachmentsResponse where
toJSON ListBeaconAttachmentsResponse'{..}
= object
(catMaybes [("attachments" .=) <$> _lbarAttachments])
newtype IndoorLevel = IndoorLevel'
{ _ilName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
indoorLevel
:: IndoorLevel
indoorLevel =
IndoorLevel'
{ _ilName = Nothing
}
ilName :: Lens' IndoorLevel (Maybe Text)
ilName = lens _ilName (\ s a -> s{_ilName = a})
instance FromJSON IndoorLevel where
parseJSON
= withObject "IndoorLevel"
(\ o -> IndoorLevel' <$> (o .:? "name"))
instance ToJSON IndoorLevel where
toJSON IndoorLevel'{..}
= object (catMaybes [("name" .=) <$> _ilName])
data EphemeralIdRegistrationParams = EphemeralIdRegistrationParams'
{ _eirpMinRotationPeriodExponent :: !(Maybe (Textual Word32))
, _eirpMaxRotationPeriodExponent :: !(Maybe (Textual Word32))
, _eirpServiceEcdhPublicKey :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
ephemeralIdRegistrationParams
:: EphemeralIdRegistrationParams
ephemeralIdRegistrationParams =
EphemeralIdRegistrationParams'
{ _eirpMinRotationPeriodExponent = Nothing
, _eirpMaxRotationPeriodExponent = Nothing
, _eirpServiceEcdhPublicKey = Nothing
}
eirpMinRotationPeriodExponent :: Lens' EphemeralIdRegistrationParams (Maybe Word32)
eirpMinRotationPeriodExponent
= lens _eirpMinRotationPeriodExponent
(\ s a -> s{_eirpMinRotationPeriodExponent = a})
. mapping _Coerce
eirpMaxRotationPeriodExponent :: Lens' EphemeralIdRegistrationParams (Maybe Word32)
eirpMaxRotationPeriodExponent
= lens _eirpMaxRotationPeriodExponent
(\ s a -> s{_eirpMaxRotationPeriodExponent = a})
. mapping _Coerce
eirpServiceEcdhPublicKey :: Lens' EphemeralIdRegistrationParams (Maybe ByteString)
eirpServiceEcdhPublicKey
= lens _eirpServiceEcdhPublicKey
(\ s a -> s{_eirpServiceEcdhPublicKey = a})
. mapping _Bytes
instance FromJSON EphemeralIdRegistrationParams where
parseJSON
= withObject "EphemeralIdRegistrationParams"
(\ o ->
EphemeralIdRegistrationParams' <$>
(o .:? "minRotationPeriodExponent") <*>
(o .:? "maxRotationPeriodExponent")
<*> (o .:? "serviceEcdhPublicKey"))
instance ToJSON EphemeralIdRegistrationParams where
toJSON EphemeralIdRegistrationParams'{..}
= object
(catMaybes
[("minRotationPeriodExponent" .=) <$>
_eirpMinRotationPeriodExponent,
("maxRotationPeriodExponent" .=) <$>
_eirpMaxRotationPeriodExponent,
("serviceEcdhPublicKey" .=) <$>
_eirpServiceEcdhPublicKey])
data BeaconInfo = BeaconInfo'
{ _biAttachments :: !(Maybe [AttachmentInfo])
, _biBeaconName :: !(Maybe Text)
, _biAdvertisedId :: !(Maybe AdvertisedId)
} deriving (Eq,Show,Data,Typeable,Generic)
beaconInfo
:: BeaconInfo
beaconInfo =
BeaconInfo'
{ _biAttachments = Nothing
, _biBeaconName = Nothing
, _biAdvertisedId = Nothing
}
biAttachments :: Lens' BeaconInfo [AttachmentInfo]
biAttachments
= lens _biAttachments
(\ s a -> s{_biAttachments = a})
. _Default
. _Coerce
biBeaconName :: Lens' BeaconInfo (Maybe Text)
biBeaconName
= lens _biBeaconName (\ s a -> s{_biBeaconName = a})
biAdvertisedId :: Lens' BeaconInfo (Maybe AdvertisedId)
biAdvertisedId
= lens _biAdvertisedId
(\ s a -> s{_biAdvertisedId = a})
instance FromJSON BeaconInfo where
parseJSON
= withObject "BeaconInfo"
(\ o ->
BeaconInfo' <$>
(o .:? "attachments" .!= mempty) <*>
(o .:? "beaconName")
<*> (o .:? "advertisedId"))
instance ToJSON BeaconInfo where
toJSON BeaconInfo'{..}
= object
(catMaybes
[("attachments" .=) <$> _biAttachments,
("beaconName" .=) <$> _biBeaconName,
("advertisedId" .=) <$> _biAdvertisedId])
data Observation = Observation'
{ _oTelemetry :: !(Maybe Bytes)
, _oTimestampMs :: !(Maybe DateTime')
, _oAdvertisedId :: !(Maybe AdvertisedId)
} deriving (Eq,Show,Data,Typeable,Generic)
observation
:: Observation
observation =
Observation'
{ _oTelemetry = Nothing
, _oTimestampMs = Nothing
, _oAdvertisedId = Nothing
}
oTelemetry :: Lens' Observation (Maybe ByteString)
oTelemetry
= lens _oTelemetry (\ s a -> s{_oTelemetry = a}) .
mapping _Bytes
oTimestampMs :: Lens' Observation (Maybe UTCTime)
oTimestampMs
= lens _oTimestampMs (\ s a -> s{_oTimestampMs = a})
. mapping _DateTime
oAdvertisedId :: Lens' Observation (Maybe AdvertisedId)
oAdvertisedId
= lens _oAdvertisedId
(\ s a -> s{_oAdvertisedId = a})
instance FromJSON Observation where
parseJSON
= withObject "Observation"
(\ o ->
Observation' <$>
(o .:? "telemetry") <*> (o .:? "timestampMs") <*>
(o .:? "advertisedId"))
instance ToJSON Observation where
toJSON Observation'{..}
= object
(catMaybes
[("telemetry" .=) <$> _oTelemetry,
("timestampMs" .=) <$> _oTimestampMs,
("advertisedId" .=) <$> _oAdvertisedId])
data BeaconAttachment = BeaconAttachment'
{ _baMaxDistanceMeters :: !(Maybe (Textual Double))
, _baCreationTimeMs :: !(Maybe DateTime')
, _baData :: !(Maybe Bytes)
, _baAttachmentName :: !(Maybe Text)
, _baNamespacedType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
beaconAttachment
:: BeaconAttachment
beaconAttachment =
BeaconAttachment'
{ _baMaxDistanceMeters = Nothing
, _baCreationTimeMs = Nothing
, _baData = Nothing
, _baAttachmentName = Nothing
, _baNamespacedType = Nothing
}
baMaxDistanceMeters :: Lens' BeaconAttachment (Maybe Double)
baMaxDistanceMeters
= lens _baMaxDistanceMeters
(\ s a -> s{_baMaxDistanceMeters = a})
. mapping _Coerce
baCreationTimeMs :: Lens' BeaconAttachment (Maybe UTCTime)
baCreationTimeMs
= lens _baCreationTimeMs
(\ s a -> s{_baCreationTimeMs = a})
. mapping _DateTime
baData :: Lens' BeaconAttachment (Maybe ByteString)
baData
= lens _baData (\ s a -> s{_baData = a}) .
mapping _Bytes
baAttachmentName :: Lens' BeaconAttachment (Maybe Text)
baAttachmentName
= lens _baAttachmentName
(\ s a -> s{_baAttachmentName = a})
baNamespacedType :: Lens' BeaconAttachment (Maybe Text)
baNamespacedType
= lens _baNamespacedType
(\ s a -> s{_baNamespacedType = a})
instance FromJSON BeaconAttachment where
parseJSON
= withObject "BeaconAttachment"
(\ o ->
BeaconAttachment' <$>
(o .:? "maxDistanceMeters") <*>
(o .:? "creationTimeMs")
<*> (o .:? "data")
<*> (o .:? "attachmentName")
<*> (o .:? "namespacedType"))
instance ToJSON BeaconAttachment where
toJSON BeaconAttachment'{..}
= object
(catMaybes
[("maxDistanceMeters" .=) <$> _baMaxDistanceMeters,
("creationTimeMs" .=) <$> _baCreationTimeMs,
("data" .=) <$> _baData,
("attachmentName" .=) <$> _baAttachmentName,
("namespacedType" .=) <$> _baNamespacedType])
data ListDiagnosticsResponse = ListDiagnosticsResponse'
{ _ldrNextPageToken :: !(Maybe Text)
, _ldrDiagnostics :: !(Maybe [Diagnostics])
} deriving (Eq,Show,Data,Typeable,Generic)
listDiagnosticsResponse
:: ListDiagnosticsResponse
listDiagnosticsResponse =
ListDiagnosticsResponse'
{ _ldrNextPageToken = Nothing
, _ldrDiagnostics = Nothing
}
ldrNextPageToken :: Lens' ListDiagnosticsResponse (Maybe Text)
ldrNextPageToken
= lens _ldrNextPageToken
(\ s a -> s{_ldrNextPageToken = a})
ldrDiagnostics :: Lens' ListDiagnosticsResponse [Diagnostics]
ldrDiagnostics
= lens _ldrDiagnostics
(\ s a -> s{_ldrDiagnostics = a})
. _Default
. _Coerce
instance FromJSON ListDiagnosticsResponse where
parseJSON
= withObject "ListDiagnosticsResponse"
(\ o ->
ListDiagnosticsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "diagnostics" .!= mempty))
instance ToJSON ListDiagnosticsResponse where
toJSON ListDiagnosticsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ldrNextPageToken,
("diagnostics" .=) <$> _ldrDiagnostics])
data AdvertisedId = AdvertisedId'
{ _aiId :: !(Maybe Bytes)
, _aiType :: !(Maybe AdvertisedIdType)
} deriving (Eq,Show,Data,Typeable,Generic)
advertisedId
:: AdvertisedId
advertisedId =
AdvertisedId'
{ _aiId = Nothing
, _aiType = Nothing
}
aiId :: Lens' AdvertisedId (Maybe ByteString)
aiId
= lens _aiId (\ s a -> s{_aiId = a}) . mapping _Bytes
aiType :: Lens' AdvertisedId (Maybe AdvertisedIdType)
aiType = lens _aiType (\ s a -> s{_aiType = a})
instance FromJSON AdvertisedId where
parseJSON
= withObject "AdvertisedId"
(\ o ->
AdvertisedId' <$> (o .:? "id") <*> (o .:? "type"))
instance ToJSON AdvertisedId where
toJSON AdvertisedId'{..}
= object
(catMaybes
[("id" .=) <$> _aiId, ("type" .=) <$> _aiType])
data ListBeaconsResponse = ListBeaconsResponse'
{ _lbrNextPageToken :: !(Maybe Text)
, _lbrBeacons :: !(Maybe [Beacon])
, _lbrTotalCount :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
listBeaconsResponse
:: ListBeaconsResponse
listBeaconsResponse =
ListBeaconsResponse'
{ _lbrNextPageToken = Nothing
, _lbrBeacons = Nothing
, _lbrTotalCount = Nothing
}
lbrNextPageToken :: Lens' ListBeaconsResponse (Maybe Text)
lbrNextPageToken
= lens _lbrNextPageToken
(\ s a -> s{_lbrNextPageToken = a})
lbrBeacons :: Lens' ListBeaconsResponse [Beacon]
lbrBeacons
= lens _lbrBeacons (\ s a -> s{_lbrBeacons = a}) .
_Default
. _Coerce
lbrTotalCount :: Lens' ListBeaconsResponse (Maybe Int64)
lbrTotalCount
= lens _lbrTotalCount
(\ s a -> s{_lbrTotalCount = a})
. mapping _Coerce
instance FromJSON ListBeaconsResponse where
parseJSON
= withObject "ListBeaconsResponse"
(\ o ->
ListBeaconsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "beacons" .!= mempty)
<*> (o .:? "totalCount"))
instance ToJSON ListBeaconsResponse where
toJSON ListBeaconsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lbrNextPageToken,
("beacons" .=) <$> _lbrBeacons,
("totalCount" .=) <$> _lbrTotalCount])
newtype GetInfoForObservedBeaconsResponse = GetInfoForObservedBeaconsResponse'
{ _gifobrBeacons :: Maybe [BeaconInfo]
} deriving (Eq,Show,Data,Typeable,Generic)
getInfoForObservedBeaconsResponse
:: GetInfoForObservedBeaconsResponse
getInfoForObservedBeaconsResponse =
GetInfoForObservedBeaconsResponse'
{ _gifobrBeacons = Nothing
}
gifobrBeacons :: Lens' GetInfoForObservedBeaconsResponse [BeaconInfo]
gifobrBeacons
= lens _gifobrBeacons
(\ s a -> s{_gifobrBeacons = a})
. _Default
. _Coerce
instance FromJSON GetInfoForObservedBeaconsResponse
where
parseJSON
= withObject "GetInfoForObservedBeaconsResponse"
(\ o ->
GetInfoForObservedBeaconsResponse' <$>
(o .:? "beacons" .!= mempty))
instance ToJSON GetInfoForObservedBeaconsResponse
where
toJSON GetInfoForObservedBeaconsResponse'{..}
= object
(catMaybes [("beacons" .=) <$> _gifobrBeacons])