{-# 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.Fitness.Types.Product where
import Network.Google.Fitness.Types.Sum
import Network.Google.Prelude
data DataSet = DataSet'
{ _dsNextPageToken :: !(Maybe Text)
, _dsDataSourceId :: !(Maybe Text)
, _dsPoint :: !(Maybe [DataPoint])
, _dsMinStartTimeNs :: !(Maybe (Textual Int64))
, _dsMaxEndTimeNs :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
dataSet
:: DataSet
dataSet =
DataSet'
{ _dsNextPageToken = Nothing
, _dsDataSourceId = Nothing
, _dsPoint = Nothing
, _dsMinStartTimeNs = Nothing
, _dsMaxEndTimeNs = Nothing
}
dsNextPageToken :: Lens' DataSet (Maybe Text)
dsNextPageToken
= lens _dsNextPageToken
(\ s a -> s{_dsNextPageToken = a})
dsDataSourceId :: Lens' DataSet (Maybe Text)
dsDataSourceId
= lens _dsDataSourceId
(\ s a -> s{_dsDataSourceId = a})
dsPoint :: Lens' DataSet [DataPoint]
dsPoint
= lens _dsPoint (\ s a -> s{_dsPoint = a}) . _Default
. _Coerce
dsMinStartTimeNs :: Lens' DataSet (Maybe Int64)
dsMinStartTimeNs
= lens _dsMinStartTimeNs
(\ s a -> s{_dsMinStartTimeNs = a})
. mapping _Coerce
dsMaxEndTimeNs :: Lens' DataSet (Maybe Int64)
dsMaxEndTimeNs
= lens _dsMaxEndTimeNs
(\ s a -> s{_dsMaxEndTimeNs = a})
. mapping _Coerce
instance FromJSON DataSet where
parseJSON
= withObject "DataSet"
(\ o ->
DataSet' <$>
(o .:? "nextPageToken") <*> (o .:? "dataSourceId")
<*> (o .:? "point" .!= mempty)
<*> (o .:? "minStartTimeNs")
<*> (o .:? "maxEndTimeNs"))
instance ToJSON DataSet where
toJSON DataSet'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _dsNextPageToken,
("dataSourceId" .=) <$> _dsDataSourceId,
("point" .=) <$> _dsPoint,
("minStartTimeNs" .=) <$> _dsMinStartTimeNs,
("maxEndTimeNs" .=) <$> _dsMaxEndTimeNs])
data Application = Application'
{ _aPackageName :: !(Maybe Text)
, _aName :: !(Maybe Text)
, _aVersion :: !(Maybe Text)
, _aDetailsURL :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
application
:: Application
application =
Application'
{ _aPackageName = Nothing
, _aName = Nothing
, _aVersion = Nothing
, _aDetailsURL = Nothing
}
aPackageName :: Lens' Application (Maybe Text)
aPackageName
= lens _aPackageName (\ s a -> s{_aPackageName = a})
aName :: Lens' Application (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a})
aVersion :: Lens' Application (Maybe Text)
aVersion = lens _aVersion (\ s a -> s{_aVersion = a})
aDetailsURL :: Lens' Application (Maybe Text)
aDetailsURL
= lens _aDetailsURL (\ s a -> s{_aDetailsURL = a})
instance FromJSON Application where
parseJSON
= withObject "Application"
(\ o ->
Application' <$>
(o .:? "packageName") <*> (o .:? "name") <*>
(o .:? "version")
<*> (o .:? "detailsUrl"))
instance ToJSON Application where
toJSON Application'{..}
= object
(catMaybes
[("packageName" .=) <$> _aPackageName,
("name" .=) <$> _aName, ("version" .=) <$> _aVersion,
("detailsUrl" .=) <$> _aDetailsURL])
newtype AggregateResponse = AggregateResponse'
{ _arBucket :: Maybe [AggregateBucket]
} deriving (Eq,Show,Data,Typeable,Generic)
aggregateResponse
:: AggregateResponse
aggregateResponse =
AggregateResponse'
{ _arBucket = Nothing
}
arBucket :: Lens' AggregateResponse [AggregateBucket]
arBucket
= lens _arBucket (\ s a -> s{_arBucket = a}) .
_Default
. _Coerce
instance FromJSON AggregateResponse where
parseJSON
= withObject "AggregateResponse"
(\ o ->
AggregateResponse' <$> (o .:? "bucket" .!= mempty))
instance ToJSON AggregateResponse where
toJSON AggregateResponse'{..}
= object (catMaybes [("bucket" .=) <$> _arBucket])
data AggregateBy = AggregateBy'
{ _abDataTypeName :: !(Maybe Text)
, _abDataSourceId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
aggregateBy
:: AggregateBy
aggregateBy =
AggregateBy'
{ _abDataTypeName = Nothing
, _abDataSourceId = Nothing
}
abDataTypeName :: Lens' AggregateBy (Maybe Text)
abDataTypeName
= lens _abDataTypeName
(\ s a -> s{_abDataTypeName = a})
abDataSourceId :: Lens' AggregateBy (Maybe Text)
abDataSourceId
= lens _abDataSourceId
(\ s a -> s{_abDataSourceId = a})
instance FromJSON AggregateBy where
parseJSON
= withObject "AggregateBy"
(\ o ->
AggregateBy' <$>
(o .:? "dataTypeName") <*> (o .:? "dataSourceId"))
instance ToJSON AggregateBy where
toJSON AggregateBy'{..}
= object
(catMaybes
[("dataTypeName" .=) <$> _abDataTypeName,
("dataSourceId" .=) <$> _abDataSourceId])
data BucketByActivity = BucketByActivity'
{ _bbaMinDurationMillis :: !(Maybe (Textual Int64))
, _bbaActivityDataSourceId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketByActivity
:: BucketByActivity
bucketByActivity =
BucketByActivity'
{ _bbaMinDurationMillis = Nothing
, _bbaActivityDataSourceId = Nothing
}
bbaMinDurationMillis :: Lens' BucketByActivity (Maybe Int64)
bbaMinDurationMillis
= lens _bbaMinDurationMillis
(\ s a -> s{_bbaMinDurationMillis = a})
. mapping _Coerce
bbaActivityDataSourceId :: Lens' BucketByActivity (Maybe Text)
bbaActivityDataSourceId
= lens _bbaActivityDataSourceId
(\ s a -> s{_bbaActivityDataSourceId = a})
instance FromJSON BucketByActivity where
parseJSON
= withObject "BucketByActivity"
(\ o ->
BucketByActivity' <$>
(o .:? "minDurationMillis") <*>
(o .:? "activityDataSourceId"))
instance ToJSON BucketByActivity where
toJSON BucketByActivity'{..}
= object
(catMaybes
[("minDurationMillis" .=) <$> _bbaMinDurationMillis,
("activityDataSourceId" .=) <$>
_bbaActivityDataSourceId])
data AggregateRequest = AggregateRequest'
{ _arEndTimeMillis :: !(Maybe (Textual Int64))
, _arFilteredDataQualityStandard :: !(Maybe [AggregateRequestFilteredDataQualityStandardItem])
, _arAggregateBy :: !(Maybe [AggregateBy])
, _arBucketBySession :: !(Maybe BucketBySession)
, _arBucketByActivityType :: !(Maybe BucketByActivity)
, _arBucketByTime :: !(Maybe BucketByTime)
, _arStartTimeMillis :: !(Maybe (Textual Int64))
, _arBucketByActivitySegment :: !(Maybe BucketByActivity)
} deriving (Eq,Show,Data,Typeable,Generic)
aggregateRequest
:: AggregateRequest
aggregateRequest =
AggregateRequest'
{ _arEndTimeMillis = Nothing
, _arFilteredDataQualityStandard = Nothing
, _arAggregateBy = Nothing
, _arBucketBySession = Nothing
, _arBucketByActivityType = Nothing
, _arBucketByTime = Nothing
, _arStartTimeMillis = Nothing
, _arBucketByActivitySegment = Nothing
}
arEndTimeMillis :: Lens' AggregateRequest (Maybe Int64)
arEndTimeMillis
= lens _arEndTimeMillis
(\ s a -> s{_arEndTimeMillis = a})
. mapping _Coerce
arFilteredDataQualityStandard :: Lens' AggregateRequest [AggregateRequestFilteredDataQualityStandardItem]
arFilteredDataQualityStandard
= lens _arFilteredDataQualityStandard
(\ s a -> s{_arFilteredDataQualityStandard = a})
. _Default
. _Coerce
arAggregateBy :: Lens' AggregateRequest [AggregateBy]
arAggregateBy
= lens _arAggregateBy
(\ s a -> s{_arAggregateBy = a})
. _Default
. _Coerce
arBucketBySession :: Lens' AggregateRequest (Maybe BucketBySession)
arBucketBySession
= lens _arBucketBySession
(\ s a -> s{_arBucketBySession = a})
arBucketByActivityType :: Lens' AggregateRequest (Maybe BucketByActivity)
arBucketByActivityType
= lens _arBucketByActivityType
(\ s a -> s{_arBucketByActivityType = a})
arBucketByTime :: Lens' AggregateRequest (Maybe BucketByTime)
arBucketByTime
= lens _arBucketByTime
(\ s a -> s{_arBucketByTime = a})
arStartTimeMillis :: Lens' AggregateRequest (Maybe Int64)
arStartTimeMillis
= lens _arStartTimeMillis
(\ s a -> s{_arStartTimeMillis = a})
. mapping _Coerce
arBucketByActivitySegment :: Lens' AggregateRequest (Maybe BucketByActivity)
arBucketByActivitySegment
= lens _arBucketByActivitySegment
(\ s a -> s{_arBucketByActivitySegment = a})
instance FromJSON AggregateRequest where
parseJSON
= withObject "AggregateRequest"
(\ o ->
AggregateRequest' <$>
(o .:? "endTimeMillis") <*>
(o .:? "filteredDataQualityStandard" .!= mempty)
<*> (o .:? "aggregateBy" .!= mempty)
<*> (o .:? "bucketBySession")
<*> (o .:? "bucketByActivityType")
<*> (o .:? "bucketByTime")
<*> (o .:? "startTimeMillis")
<*> (o .:? "bucketByActivitySegment"))
instance ToJSON AggregateRequest where
toJSON AggregateRequest'{..}
= object
(catMaybes
[("endTimeMillis" .=) <$> _arEndTimeMillis,
("filteredDataQualityStandard" .=) <$>
_arFilteredDataQualityStandard,
("aggregateBy" .=) <$> _arAggregateBy,
("bucketBySession" .=) <$> _arBucketBySession,
("bucketByActivityType" .=) <$>
_arBucketByActivityType,
("bucketByTime" .=) <$> _arBucketByTime,
("startTimeMillis" .=) <$> _arStartTimeMillis,
("bucketByActivitySegment" .=) <$>
_arBucketByActivitySegment])
data Device = Device'
{ _dManufacturer :: !(Maybe Text)
, _dUid :: !(Maybe Text)
, _dModel :: !(Maybe Text)
, _dVersion :: !(Maybe Text)
, _dType :: !(Maybe DeviceType)
} deriving (Eq,Show,Data,Typeable,Generic)
device
:: Device
device =
Device'
{ _dManufacturer = Nothing
, _dUid = Nothing
, _dModel = Nothing
, _dVersion = Nothing
, _dType = Nothing
}
dManufacturer :: Lens' Device (Maybe Text)
dManufacturer
= lens _dManufacturer
(\ s a -> s{_dManufacturer = a})
dUid :: Lens' Device (Maybe Text)
dUid = lens _dUid (\ s a -> s{_dUid = a})
dModel :: Lens' Device (Maybe Text)
dModel = lens _dModel (\ s a -> s{_dModel = a})
dVersion :: Lens' Device (Maybe Text)
dVersion = lens _dVersion (\ s a -> s{_dVersion = a})
dType :: Lens' Device (Maybe DeviceType)
dType = lens _dType (\ s a -> s{_dType = a})
instance FromJSON Device where
parseJSON
= withObject "Device"
(\ o ->
Device' <$>
(o .:? "manufacturer") <*> (o .:? "uid") <*>
(o .:? "model")
<*> (o .:? "version")
<*> (o .:? "type"))
instance ToJSON Device where
toJSON Device'{..}
= object
(catMaybes
[("manufacturer" .=) <$> _dManufacturer,
("uid" .=) <$> _dUid, ("model" .=) <$> _dModel,
("version" .=) <$> _dVersion,
("type" .=) <$> _dType])
data Value = Value'
{ _vMapVal :: !(Maybe [ValueMapValEntry])
, _vFpVal :: !(Maybe (Textual Double))
, _vIntVal :: !(Maybe (Textual Int32))
, _vStringVal :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
value
:: Value
value =
Value'
{ _vMapVal = Nothing
, _vFpVal = Nothing
, _vIntVal = Nothing
, _vStringVal = Nothing
}
vMapVal :: Lens' Value [ValueMapValEntry]
vMapVal
= lens _vMapVal (\ s a -> s{_vMapVal = a}) . _Default
. _Coerce
vFpVal :: Lens' Value (Maybe Double)
vFpVal
= lens _vFpVal (\ s a -> s{_vFpVal = a}) .
mapping _Coerce
vIntVal :: Lens' Value (Maybe Int32)
vIntVal
= lens _vIntVal (\ s a -> s{_vIntVal = a}) .
mapping _Coerce
vStringVal :: Lens' Value (Maybe Text)
vStringVal
= lens _vStringVal (\ s a -> s{_vStringVal = a})
instance FromJSON Value where
parseJSON
= withObject "Value"
(\ o ->
Value' <$>
(o .:? "mapVal" .!= mempty) <*> (o .:? "fpVal") <*>
(o .:? "intVal")
<*> (o .:? "stringVal"))
instance ToJSON Value where
toJSON Value'{..}
= object
(catMaybes
[("mapVal" .=) <$> _vMapVal,
("fpVal" .=) <$> _vFpVal, ("intVal" .=) <$> _vIntVal,
("stringVal" .=) <$> _vStringVal])
newtype BucketBySession = BucketBySession'
{ _bbsMinDurationMillis :: Maybe (Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketBySession
:: BucketBySession
bucketBySession =
BucketBySession'
{ _bbsMinDurationMillis = Nothing
}
bbsMinDurationMillis :: Lens' BucketBySession (Maybe Int64)
bbsMinDurationMillis
= lens _bbsMinDurationMillis
(\ s a -> s{_bbsMinDurationMillis = a})
. mapping _Coerce
instance FromJSON BucketBySession where
parseJSON
= withObject "BucketBySession"
(\ o ->
BucketBySession' <$> (o .:? "minDurationMillis"))
instance ToJSON BucketBySession where
toJSON BucketBySession'{..}
= object
(catMaybes
[("minDurationMillis" .=) <$> _bbsMinDurationMillis])
data DataPoint = DataPoint'
{ _dpOriginDataSourceId :: !(Maybe Text)
, _dpRawTimestampNanos :: !(Maybe (Textual Int64))
, _dpDataTypeName :: !(Maybe Text)
, _dpValue :: !(Maybe [Value])
, _dpComputationTimeMillis :: !(Maybe (Textual Int64))
, _dpEndTimeNanos :: !(Maybe (Textual Int64))
, _dpModifiedTimeMillis :: !(Maybe (Textual Int64))
, _dpStartTimeNanos :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
dataPoint
:: DataPoint
dataPoint =
DataPoint'
{ _dpOriginDataSourceId = Nothing
, _dpRawTimestampNanos = Nothing
, _dpDataTypeName = Nothing
, _dpValue = Nothing
, _dpComputationTimeMillis = Nothing
, _dpEndTimeNanos = Nothing
, _dpModifiedTimeMillis = Nothing
, _dpStartTimeNanos = Nothing
}
dpOriginDataSourceId :: Lens' DataPoint (Maybe Text)
dpOriginDataSourceId
= lens _dpOriginDataSourceId
(\ s a -> s{_dpOriginDataSourceId = a})
dpRawTimestampNanos :: Lens' DataPoint (Maybe Int64)
dpRawTimestampNanos
= lens _dpRawTimestampNanos
(\ s a -> s{_dpRawTimestampNanos = a})
. mapping _Coerce
dpDataTypeName :: Lens' DataPoint (Maybe Text)
dpDataTypeName
= lens _dpDataTypeName
(\ s a -> s{_dpDataTypeName = a})
dpValue :: Lens' DataPoint [Value]
dpValue
= lens _dpValue (\ s a -> s{_dpValue = a}) . _Default
. _Coerce
dpComputationTimeMillis :: Lens' DataPoint (Maybe Int64)
dpComputationTimeMillis
= lens _dpComputationTimeMillis
(\ s a -> s{_dpComputationTimeMillis = a})
. mapping _Coerce
dpEndTimeNanos :: Lens' DataPoint (Maybe Int64)
dpEndTimeNanos
= lens _dpEndTimeNanos
(\ s a -> s{_dpEndTimeNanos = a})
. mapping _Coerce
dpModifiedTimeMillis :: Lens' DataPoint (Maybe Int64)
dpModifiedTimeMillis
= lens _dpModifiedTimeMillis
(\ s a -> s{_dpModifiedTimeMillis = a})
. mapping _Coerce
dpStartTimeNanos :: Lens' DataPoint (Maybe Int64)
dpStartTimeNanos
= lens _dpStartTimeNanos
(\ s a -> s{_dpStartTimeNanos = a})
. mapping _Coerce
instance FromJSON DataPoint where
parseJSON
= withObject "DataPoint"
(\ o ->
DataPoint' <$>
(o .:? "originDataSourceId") <*>
(o .:? "rawTimestampNanos")
<*> (o .:? "dataTypeName")
<*> (o .:? "value" .!= mempty)
<*> (o .:? "computationTimeMillis")
<*> (o .:? "endTimeNanos")
<*> (o .:? "modifiedTimeMillis")
<*> (o .:? "startTimeNanos"))
instance ToJSON DataPoint where
toJSON DataPoint'{..}
= object
(catMaybes
[("originDataSourceId" .=) <$> _dpOriginDataSourceId,
("rawTimestampNanos" .=) <$> _dpRawTimestampNanos,
("dataTypeName" .=) <$> _dpDataTypeName,
("value" .=) <$> _dpValue,
("computationTimeMillis" .=) <$>
_dpComputationTimeMillis,
("endTimeNanos" .=) <$> _dpEndTimeNanos,
("modifiedTimeMillis" .=) <$> _dpModifiedTimeMillis,
("startTimeNanos" .=) <$> _dpStartTimeNanos])
data ListSessionsResponse = ListSessionsResponse'
{ _lsrNextPageToken :: !(Maybe Text)
, _lsrDeletedSession :: !(Maybe [Session])
, _lsrHasMoreData :: !(Maybe Bool)
, _lsrSession :: !(Maybe [Session])
} deriving (Eq,Show,Data,Typeable,Generic)
listSessionsResponse
:: ListSessionsResponse
listSessionsResponse =
ListSessionsResponse'
{ _lsrNextPageToken = Nothing
, _lsrDeletedSession = Nothing
, _lsrHasMoreData = Nothing
, _lsrSession = Nothing
}
lsrNextPageToken :: Lens' ListSessionsResponse (Maybe Text)
lsrNextPageToken
= lens _lsrNextPageToken
(\ s a -> s{_lsrNextPageToken = a})
lsrDeletedSession :: Lens' ListSessionsResponse [Session]
lsrDeletedSession
= lens _lsrDeletedSession
(\ s a -> s{_lsrDeletedSession = a})
. _Default
. _Coerce
lsrHasMoreData :: Lens' ListSessionsResponse (Maybe Bool)
lsrHasMoreData
= lens _lsrHasMoreData
(\ s a -> s{_lsrHasMoreData = a})
lsrSession :: Lens' ListSessionsResponse [Session]
lsrSession
= lens _lsrSession (\ s a -> s{_lsrSession = a}) .
_Default
. _Coerce
instance FromJSON ListSessionsResponse where
parseJSON
= withObject "ListSessionsResponse"
(\ o ->
ListSessionsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "deletedSession" .!= mempty)
<*> (o .:? "hasMoreData")
<*> (o .:? "session" .!= mempty))
instance ToJSON ListSessionsResponse where
toJSON ListSessionsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsrNextPageToken,
("deletedSession" .=) <$> _lsrDeletedSession,
("hasMoreData" .=) <$> _lsrHasMoreData,
("session" .=) <$> _lsrSession])
data AggregateBucket = AggregateBucket'
{ _abEndTimeMillis :: !(Maybe (Textual Int64))
, _abDataSet :: !(Maybe [DataSet])
, _abActivity :: !(Maybe (Textual Int32))
, _abType :: !(Maybe AggregateBucketType)
, _abStartTimeMillis :: !(Maybe (Textual Int64))
, _abSession :: !(Maybe Session)
} deriving (Eq,Show,Data,Typeable,Generic)
aggregateBucket
:: AggregateBucket
aggregateBucket =
AggregateBucket'
{ _abEndTimeMillis = Nothing
, _abDataSet = Nothing
, _abActivity = Nothing
, _abType = Nothing
, _abStartTimeMillis = Nothing
, _abSession = Nothing
}
abEndTimeMillis :: Lens' AggregateBucket (Maybe Int64)
abEndTimeMillis
= lens _abEndTimeMillis
(\ s a -> s{_abEndTimeMillis = a})
. mapping _Coerce
abDataSet :: Lens' AggregateBucket [DataSet]
abDataSet
= lens _abDataSet (\ s a -> s{_abDataSet = a}) .
_Default
. _Coerce
abActivity :: Lens' AggregateBucket (Maybe Int32)
abActivity
= lens _abActivity (\ s a -> s{_abActivity = a}) .
mapping _Coerce
abType :: Lens' AggregateBucket (Maybe AggregateBucketType)
abType = lens _abType (\ s a -> s{_abType = a})
abStartTimeMillis :: Lens' AggregateBucket (Maybe Int64)
abStartTimeMillis
= lens _abStartTimeMillis
(\ s a -> s{_abStartTimeMillis = a})
. mapping _Coerce
abSession :: Lens' AggregateBucket (Maybe Session)
abSession
= lens _abSession (\ s a -> s{_abSession = a})
instance FromJSON AggregateBucket where
parseJSON
= withObject "AggregateBucket"
(\ o ->
AggregateBucket' <$>
(o .:? "endTimeMillis") <*>
(o .:? "dataset" .!= mempty)
<*> (o .:? "activity")
<*> (o .:? "type")
<*> (o .:? "startTimeMillis")
<*> (o .:? "session"))
instance ToJSON AggregateBucket where
toJSON AggregateBucket'{..}
= object
(catMaybes
[("endTimeMillis" .=) <$> _abEndTimeMillis,
("dataset" .=) <$> _abDataSet,
("activity" .=) <$> _abActivity,
("type" .=) <$> _abType,
("startTimeMillis" .=) <$> _abStartTimeMillis,
("session" .=) <$> _abSession])
newtype MapValue = MapValue'
{ _mvFpVal :: Maybe (Textual Double)
} deriving (Eq,Show,Data,Typeable,Generic)
mapValue
:: MapValue
mapValue =
MapValue'
{ _mvFpVal = Nothing
}
mvFpVal :: Lens' MapValue (Maybe Double)
mvFpVal
= lens _mvFpVal (\ s a -> s{_mvFpVal = a}) .
mapping _Coerce
instance FromJSON MapValue where
parseJSON
= withObject "MapValue"
(\ o -> MapValue' <$> (o .:? "fpVal"))
instance ToJSON MapValue where
toJSON MapValue'{..}
= object (catMaybes [("fpVal" .=) <$> _mvFpVal])
newtype ListDataSourcesResponse = ListDataSourcesResponse'
{ _ldsrDataSource :: Maybe [DataSource]
} deriving (Eq,Show,Data,Typeable,Generic)
listDataSourcesResponse
:: ListDataSourcesResponse
listDataSourcesResponse =
ListDataSourcesResponse'
{ _ldsrDataSource = Nothing
}
ldsrDataSource :: Lens' ListDataSourcesResponse [DataSource]
ldsrDataSource
= lens _ldsrDataSource
(\ s a -> s{_ldsrDataSource = a})
. _Default
. _Coerce
instance FromJSON ListDataSourcesResponse where
parseJSON
= withObject "ListDataSourcesResponse"
(\ o ->
ListDataSourcesResponse' <$>
(o .:? "dataSource" .!= mempty))
instance ToJSON ListDataSourcesResponse where
toJSON ListDataSourcesResponse'{..}
= object
(catMaybes [("dataSource" .=) <$> _ldsrDataSource])
data DataTypeField = DataTypeField'
{ _dtfFormat :: !(Maybe DataTypeFieldFormat)
, _dtfName :: !(Maybe Text)
, _dtfOptional :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
dataTypeField
:: DataTypeField
dataTypeField =
DataTypeField'
{ _dtfFormat = Nothing
, _dtfName = Nothing
, _dtfOptional = Nothing
}
dtfFormat :: Lens' DataTypeField (Maybe DataTypeFieldFormat)
dtfFormat
= lens _dtfFormat (\ s a -> s{_dtfFormat = a})
dtfName :: Lens' DataTypeField (Maybe Text)
dtfName = lens _dtfName (\ s a -> s{_dtfName = a})
dtfOptional :: Lens' DataTypeField (Maybe Bool)
dtfOptional
= lens _dtfOptional (\ s a -> s{_dtfOptional = a})
instance FromJSON DataTypeField where
parseJSON
= withObject "DataTypeField"
(\ o ->
DataTypeField' <$>
(o .:? "format") <*> (o .:? "name") <*>
(o .:? "optional"))
instance ToJSON DataTypeField where
toJSON DataTypeField'{..}
= object
(catMaybes
[("format" .=) <$> _dtfFormat,
("name" .=) <$> _dtfName,
("optional" .=) <$> _dtfOptional])
data DataSource = DataSource'
{ _dsApplication :: !(Maybe Application)
, _dsDevice :: !(Maybe Device)
, _dsDataQualityStandard :: !(Maybe [DataSourceDataQualityStandardItem])
, _dsName :: !(Maybe Text)
, _dsDataType :: !(Maybe DataType)
, _dsType :: !(Maybe DataSourceType)
, _dsDataStreamName :: !(Maybe Text)
, _dsDataStreamId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
dataSource
:: DataSource
dataSource =
DataSource'
{ _dsApplication = Nothing
, _dsDevice = Nothing
, _dsDataQualityStandard = Nothing
, _dsName = Nothing
, _dsDataType = Nothing
, _dsType = Nothing
, _dsDataStreamName = Nothing
, _dsDataStreamId = Nothing
}
dsApplication :: Lens' DataSource (Maybe Application)
dsApplication
= lens _dsApplication
(\ s a -> s{_dsApplication = a})
dsDevice :: Lens' DataSource (Maybe Device)
dsDevice = lens _dsDevice (\ s a -> s{_dsDevice = a})
dsDataQualityStandard :: Lens' DataSource [DataSourceDataQualityStandardItem]
dsDataQualityStandard
= lens _dsDataQualityStandard
(\ s a -> s{_dsDataQualityStandard = a})
. _Default
. _Coerce
dsName :: Lens' DataSource (Maybe Text)
dsName = lens _dsName (\ s a -> s{_dsName = a})
dsDataType :: Lens' DataSource (Maybe DataType)
dsDataType
= lens _dsDataType (\ s a -> s{_dsDataType = a})
dsType :: Lens' DataSource (Maybe DataSourceType)
dsType = lens _dsType (\ s a -> s{_dsType = a})
dsDataStreamName :: Lens' DataSource (Maybe Text)
dsDataStreamName
= lens _dsDataStreamName
(\ s a -> s{_dsDataStreamName = a})
dsDataStreamId :: Lens' DataSource (Maybe Text)
dsDataStreamId
= lens _dsDataStreamId
(\ s a -> s{_dsDataStreamId = a})
instance FromJSON DataSource where
parseJSON
= withObject "DataSource"
(\ o ->
DataSource' <$>
(o .:? "application") <*> (o .:? "device") <*>
(o .:? "dataQualityStandard" .!= mempty)
<*> (o .:? "name")
<*> (o .:? "dataType")
<*> (o .:? "type")
<*> (o .:? "dataStreamName")
<*> (o .:? "dataStreamId"))
instance ToJSON DataSource where
toJSON DataSource'{..}
= object
(catMaybes
[("application" .=) <$> _dsApplication,
("device" .=) <$> _dsDevice,
("dataQualityStandard" .=) <$>
_dsDataQualityStandard,
("name" .=) <$> _dsName,
("dataType" .=) <$> _dsDataType,
("type" .=) <$> _dsType,
("dataStreamName" .=) <$> _dsDataStreamName,
("dataStreamId" .=) <$> _dsDataStreamId])
data BucketByTimePeriod = BucketByTimePeriod'
{ _bbtpValue :: !(Maybe (Textual Int32))
, _bbtpType :: !(Maybe BucketByTimePeriodType)
, _bbtpTimeZoneId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketByTimePeriod
:: BucketByTimePeriod
bucketByTimePeriod =
BucketByTimePeriod'
{ _bbtpValue = Nothing
, _bbtpType = Nothing
, _bbtpTimeZoneId = Nothing
}
bbtpValue :: Lens' BucketByTimePeriod (Maybe Int32)
bbtpValue
= lens _bbtpValue (\ s a -> s{_bbtpValue = a}) .
mapping _Coerce
bbtpType :: Lens' BucketByTimePeriod (Maybe BucketByTimePeriodType)
bbtpType = lens _bbtpType (\ s a -> s{_bbtpType = a})
bbtpTimeZoneId :: Lens' BucketByTimePeriod (Maybe Text)
bbtpTimeZoneId
= lens _bbtpTimeZoneId
(\ s a -> s{_bbtpTimeZoneId = a})
instance FromJSON BucketByTimePeriod where
parseJSON
= withObject "BucketByTimePeriod"
(\ o ->
BucketByTimePeriod' <$>
(o .:? "value") <*> (o .:? "type") <*>
(o .:? "timeZoneId"))
instance ToJSON BucketByTimePeriod where
toJSON BucketByTimePeriod'{..}
= object
(catMaybes
[("value" .=) <$> _bbtpValue,
("type" .=) <$> _bbtpType,
("timeZoneId" .=) <$> _bbtpTimeZoneId])
data ValueMapValEntry = ValueMapValEntry'
{ _vmveValue :: !(Maybe MapValue)
, _vmveKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
valueMapValEntry
:: ValueMapValEntry
valueMapValEntry =
ValueMapValEntry'
{ _vmveValue = Nothing
, _vmveKey = Nothing
}
vmveValue :: Lens' ValueMapValEntry (Maybe MapValue)
vmveValue
= lens _vmveValue (\ s a -> s{_vmveValue = a})
vmveKey :: Lens' ValueMapValEntry (Maybe Text)
vmveKey = lens _vmveKey (\ s a -> s{_vmveKey = a})
instance FromJSON ValueMapValEntry where
parseJSON
= withObject "ValueMapValEntry"
(\ o ->
ValueMapValEntry' <$>
(o .:? "value") <*> (o .:? "key"))
instance ToJSON ValueMapValEntry where
toJSON ValueMapValEntry'{..}
= object
(catMaybes
[("value" .=) <$> _vmveValue,
("key" .=) <$> _vmveKey])
data BucketByTime = BucketByTime'
{ _bbtPeriod :: !(Maybe BucketByTimePeriod)
, _bbtDurationMillis :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
bucketByTime
:: BucketByTime
bucketByTime =
BucketByTime'
{ _bbtPeriod = Nothing
, _bbtDurationMillis = Nothing
}
bbtPeriod :: Lens' BucketByTime (Maybe BucketByTimePeriod)
bbtPeriod
= lens _bbtPeriod (\ s a -> s{_bbtPeriod = a})
bbtDurationMillis :: Lens' BucketByTime (Maybe Int64)
bbtDurationMillis
= lens _bbtDurationMillis
(\ s a -> s{_bbtDurationMillis = a})
. mapping _Coerce
instance FromJSON BucketByTime where
parseJSON
= withObject "BucketByTime"
(\ o ->
BucketByTime' <$>
(o .:? "period") <*> (o .:? "durationMillis"))
instance ToJSON BucketByTime where
toJSON BucketByTime'{..}
= object
(catMaybes
[("period" .=) <$> _bbtPeriod,
("durationMillis" .=) <$> _bbtDurationMillis])
data DataType = DataType'
{ _dtField :: !(Maybe [DataTypeField])
, _dtName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
dataType
:: DataType
dataType =
DataType'
{ _dtField = Nothing
, _dtName = Nothing
}
dtField :: Lens' DataType [DataTypeField]
dtField
= lens _dtField (\ s a -> s{_dtField = a}) . _Default
. _Coerce
dtName :: Lens' DataType (Maybe Text)
dtName = lens _dtName (\ s a -> s{_dtName = a})
instance FromJSON DataType where
parseJSON
= withObject "DataType"
(\ o ->
DataType' <$>
(o .:? "field" .!= mempty) <*> (o .:? "name"))
instance ToJSON DataType where
toJSON DataType'{..}
= object
(catMaybes
[("field" .=) <$> _dtField, ("name" .=) <$> _dtName])
data Session = Session'
{ _sEndTimeMillis :: !(Maybe (Textual Int64))
, _sActiveTimeMillis :: !(Maybe (Textual Int64))
, _sApplication :: !(Maybe Application)
, _sActivityType :: !(Maybe (Textual Int32))
, _sName :: !(Maybe Text)
, _sModifiedTimeMillis :: !(Maybe (Textual Int64))
, _sId :: !(Maybe Text)
, _sStartTimeMillis :: !(Maybe (Textual Int64))
, _sDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
session
:: Session
session =
Session'
{ _sEndTimeMillis = Nothing
, _sActiveTimeMillis = Nothing
, _sApplication = Nothing
, _sActivityType = Nothing
, _sName = Nothing
, _sModifiedTimeMillis = Nothing
, _sId = Nothing
, _sStartTimeMillis = Nothing
, _sDescription = Nothing
}
sEndTimeMillis :: Lens' Session (Maybe Int64)
sEndTimeMillis
= lens _sEndTimeMillis
(\ s a -> s{_sEndTimeMillis = a})
. mapping _Coerce
sActiveTimeMillis :: Lens' Session (Maybe Int64)
sActiveTimeMillis
= lens _sActiveTimeMillis
(\ s a -> s{_sActiveTimeMillis = a})
. mapping _Coerce
sApplication :: Lens' Session (Maybe Application)
sApplication
= lens _sApplication (\ s a -> s{_sApplication = a})
sActivityType :: Lens' Session (Maybe Int32)
sActivityType
= lens _sActivityType
(\ s a -> s{_sActivityType = a})
. mapping _Coerce
sName :: Lens' Session (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a})
sModifiedTimeMillis :: Lens' Session (Maybe Int64)
sModifiedTimeMillis
= lens _sModifiedTimeMillis
(\ s a -> s{_sModifiedTimeMillis = a})
. mapping _Coerce
sId :: Lens' Session (Maybe Text)
sId = lens _sId (\ s a -> s{_sId = a})
sStartTimeMillis :: Lens' Session (Maybe Int64)
sStartTimeMillis
= lens _sStartTimeMillis
(\ s a -> s{_sStartTimeMillis = a})
. mapping _Coerce
sDescription :: Lens' Session (Maybe Text)
sDescription
= lens _sDescription (\ s a -> s{_sDescription = a})
instance FromJSON Session where
parseJSON
= withObject "Session"
(\ o ->
Session' <$>
(o .:? "endTimeMillis") <*>
(o .:? "activeTimeMillis")
<*> (o .:? "application")
<*> (o .:? "activityType")
<*> (o .:? "name")
<*> (o .:? "modifiedTimeMillis")
<*> (o .:? "id")
<*> (o .:? "startTimeMillis")
<*> (o .:? "description"))
instance ToJSON Session where
toJSON Session'{..}
= object
(catMaybes
[("endTimeMillis" .=) <$> _sEndTimeMillis,
("activeTimeMillis" .=) <$> _sActiveTimeMillis,
("application" .=) <$> _sApplication,
("activityType" .=) <$> _sActivityType,
("name" .=) <$> _sName,
("modifiedTimeMillis" .=) <$> _sModifiedTimeMillis,
("id" .=) <$> _sId,
("startTimeMillis" .=) <$> _sStartTimeMillis,
("description" .=) <$> _sDescription])