module Network.Google.MapsCoordinate.Types.Product where
import Network.Google.MapsCoordinate.Types.Sum
import Network.Google.Prelude
data LocationListResponse = LocationListResponse'
{ _llrTokenPagination :: !(Maybe TokenPagination)
, _llrNextPageToken :: !(Maybe Text)
, _llrKind :: !Text
, _llrItems :: !(Maybe [LocationRecord])
} deriving (Eq,Show,Data,Typeable,Generic)
locationListResponse
:: LocationListResponse
locationListResponse =
LocationListResponse'
{ _llrTokenPagination = Nothing
, _llrNextPageToken = Nothing
, _llrKind = "coordinate#locationList"
, _llrItems = Nothing
}
llrTokenPagination :: Lens' LocationListResponse (Maybe TokenPagination)
llrTokenPagination
= lens _llrTokenPagination
(\ s a -> s{_llrTokenPagination = a})
llrNextPageToken :: Lens' LocationListResponse (Maybe Text)
llrNextPageToken
= lens _llrNextPageToken
(\ s a -> s{_llrNextPageToken = a})
llrKind :: Lens' LocationListResponse Text
llrKind = lens _llrKind (\ s a -> s{_llrKind = a})
llrItems :: Lens' LocationListResponse [LocationRecord]
llrItems
= lens _llrItems (\ s a -> s{_llrItems = a}) .
_Default
. _Coerce
instance FromJSON LocationListResponse where
parseJSON
= withObject "LocationListResponse"
(\ o ->
LocationListResponse' <$>
(o .:? "tokenPagination") <*> (o .:? "nextPageToken")
<*> (o .:? "kind" .!= "coordinate#locationList")
<*> (o .:? "items" .!= mempty))
instance ToJSON LocationListResponse where
toJSON LocationListResponse'{..}
= object
(catMaybes
[("tokenPagination" .=) <$> _llrTokenPagination,
("nextPageToken" .=) <$> _llrNextPageToken,
Just ("kind" .= _llrKind),
("items" .=) <$> _llrItems])
data TokenPagination = TokenPagination'
{ _tpNextPageToken :: !(Maybe Text)
, _tpKind :: !Text
, _tpPreviousPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
tokenPagination
:: TokenPagination
tokenPagination =
TokenPagination'
{ _tpNextPageToken = Nothing
, _tpKind = "coordinate#tokenPagination"
, _tpPreviousPageToken = Nothing
}
tpNextPageToken :: Lens' TokenPagination (Maybe Text)
tpNextPageToken
= lens _tpNextPageToken
(\ s a -> s{_tpNextPageToken = a})
tpKind :: Lens' TokenPagination Text
tpKind = lens _tpKind (\ s a -> s{_tpKind = a})
tpPreviousPageToken :: Lens' TokenPagination (Maybe Text)
tpPreviousPageToken
= lens _tpPreviousPageToken
(\ s a -> s{_tpPreviousPageToken = a})
instance FromJSON TokenPagination where
parseJSON
= withObject "TokenPagination"
(\ o ->
TokenPagination' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "coordinate#tokenPagination")
<*> (o .:? "previousPageToken"))
instance ToJSON TokenPagination where
toJSON TokenPagination'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _tpNextPageToken,
Just ("kind" .= _tpKind),
("previousPageToken" .=) <$> _tpPreviousPageToken])
data WorkerListResponse = WorkerListResponse'
{ _wlrKind :: !Text
, _wlrItems :: !(Maybe [Worker])
} deriving (Eq,Show,Data,Typeable,Generic)
workerListResponse
:: WorkerListResponse
workerListResponse =
WorkerListResponse'
{ _wlrKind = "coordinate#workerList"
, _wlrItems = Nothing
}
wlrKind :: Lens' WorkerListResponse Text
wlrKind = lens _wlrKind (\ s a -> s{_wlrKind = a})
wlrItems :: Lens' WorkerListResponse [Worker]
wlrItems
= lens _wlrItems (\ s a -> s{_wlrItems = a}) .
_Default
. _Coerce
instance FromJSON WorkerListResponse where
parseJSON
= withObject "WorkerListResponse"
(\ o ->
WorkerListResponse' <$>
(o .:? "kind" .!= "coordinate#workerList") <*>
(o .:? "items" .!= mempty))
instance ToJSON WorkerListResponse where
toJSON WorkerListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _wlrKind),
("items" .=) <$> _wlrItems])
data Schedule = Schedule'
{ _sAllDay :: !(Maybe Bool)
, _sStartTime :: !(Maybe (Textual Word64))
, _sKind :: !Text
, _sEndTime :: !(Maybe (Textual Word64))
, _sDuration :: !(Maybe (Textual Word64))
} deriving (Eq,Show,Data,Typeable,Generic)
schedule
:: Schedule
schedule =
Schedule'
{ _sAllDay = Nothing
, _sStartTime = Nothing
, _sKind = "coordinate#schedule"
, _sEndTime = Nothing
, _sDuration = Nothing
}
sAllDay :: Lens' Schedule (Maybe Bool)
sAllDay = lens _sAllDay (\ s a -> s{_sAllDay = a})
sStartTime :: Lens' Schedule (Maybe Word64)
sStartTime
= lens _sStartTime (\ s a -> s{_sStartTime = a}) .
mapping _Coerce
sKind :: Lens' Schedule Text
sKind = lens _sKind (\ s a -> s{_sKind = a})
sEndTime :: Lens' Schedule (Maybe Word64)
sEndTime
= lens _sEndTime (\ s a -> s{_sEndTime = a}) .
mapping _Coerce
sDuration :: Lens' Schedule (Maybe Word64)
sDuration
= lens _sDuration (\ s a -> s{_sDuration = a}) .
mapping _Coerce
instance FromJSON Schedule where
parseJSON
= withObject "Schedule"
(\ o ->
Schedule' <$>
(o .:? "allDay") <*> (o .:? "startTime") <*>
(o .:? "kind" .!= "coordinate#schedule")
<*> (o .:? "endTime")
<*> (o .:? "duration"))
instance ToJSON Schedule where
toJSON Schedule'{..}
= object
(catMaybes
[("allDay" .=) <$> _sAllDay,
("startTime" .=) <$> _sStartTime,
Just ("kind" .= _sKind),
("endTime" .=) <$> _sEndTime,
("duration" .=) <$> _sDuration])
data Location = Location'
{ _lAddressLine :: !(Maybe [Text])
, _lKind :: !Text
, _lLat :: !(Maybe (Textual Double))
, _lLng :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
location
:: Location
location =
Location'
{ _lAddressLine = Nothing
, _lKind = "coordinate#location"
, _lLat = Nothing
, _lLng = Nothing
}
lAddressLine :: Lens' Location [Text]
lAddressLine
= lens _lAddressLine (\ s a -> s{_lAddressLine = a})
. _Default
. _Coerce
lKind :: Lens' Location Text
lKind = lens _lKind (\ s a -> s{_lKind = a})
lLat :: Lens' Location (Maybe Double)
lLat
= lens _lLat (\ s a -> s{_lLat = a}) .
mapping _Coerce
lLng :: Lens' Location (Maybe Double)
lLng
= lens _lLng (\ s a -> s{_lLng = a}) .
mapping _Coerce
instance FromJSON Location where
parseJSON
= withObject "Location"
(\ o ->
Location' <$>
(o .:? "addressLine" .!= mempty) <*>
(o .:? "kind" .!= "coordinate#location")
<*> (o .:? "lat")
<*> (o .:? "lng"))
instance ToJSON Location where
toJSON Location'{..}
= object
(catMaybes
[("addressLine" .=) <$> _lAddressLine,
Just ("kind" .= _lKind), ("lat" .=) <$> _lLat,
("lng" .=) <$> _lLng])
data JobState = JobState'
{ _jsLocation :: !(Maybe Location)
, _jsProgress :: !(Maybe Text)
, _jsNote :: !(Maybe [Text])
, _jsKind :: !Text
, _jsCustomerPhoneNumber :: !(Maybe Text)
, _jsCustomerName :: !(Maybe Text)
, _jsAssignee :: !(Maybe Text)
, _jsCustomFields :: !(Maybe CustomFields)
, _jsTitle :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
jobState
:: JobState
jobState =
JobState'
{ _jsLocation = Nothing
, _jsProgress = Nothing
, _jsNote = Nothing
, _jsKind = "coordinate#jobState"
, _jsCustomerPhoneNumber = Nothing
, _jsCustomerName = Nothing
, _jsAssignee = Nothing
, _jsCustomFields = Nothing
, _jsTitle = Nothing
}
jsLocation :: Lens' JobState (Maybe Location)
jsLocation
= lens _jsLocation (\ s a -> s{_jsLocation = a})
jsProgress :: Lens' JobState (Maybe Text)
jsProgress
= lens _jsProgress (\ s a -> s{_jsProgress = a})
jsNote :: Lens' JobState [Text]
jsNote
= lens _jsNote (\ s a -> s{_jsNote = a}) . _Default .
_Coerce
jsKind :: Lens' JobState Text
jsKind = lens _jsKind (\ s a -> s{_jsKind = a})
jsCustomerPhoneNumber :: Lens' JobState (Maybe Text)
jsCustomerPhoneNumber
= lens _jsCustomerPhoneNumber
(\ s a -> s{_jsCustomerPhoneNumber = a})
jsCustomerName :: Lens' JobState (Maybe Text)
jsCustomerName
= lens _jsCustomerName
(\ s a -> s{_jsCustomerName = a})
jsAssignee :: Lens' JobState (Maybe Text)
jsAssignee
= lens _jsAssignee (\ s a -> s{_jsAssignee = a})
jsCustomFields :: Lens' JobState (Maybe CustomFields)
jsCustomFields
= lens _jsCustomFields
(\ s a -> s{_jsCustomFields = a})
jsTitle :: Lens' JobState (Maybe Text)
jsTitle = lens _jsTitle (\ s a -> s{_jsTitle = a})
instance FromJSON JobState where
parseJSON
= withObject "JobState"
(\ o ->
JobState' <$>
(o .:? "location") <*> (o .:? "progress") <*>
(o .:? "note" .!= mempty)
<*> (o .:? "kind" .!= "coordinate#jobState")
<*> (o .:? "customerPhoneNumber")
<*> (o .:? "customerName")
<*> (o .:? "assignee")
<*> (o .:? "customFields")
<*> (o .:? "title"))
instance ToJSON JobState where
toJSON JobState'{..}
= object
(catMaybes
[("location" .=) <$> _jsLocation,
("progress" .=) <$> _jsProgress,
("note" .=) <$> _jsNote, Just ("kind" .= _jsKind),
("customerPhoneNumber" .=) <$>
_jsCustomerPhoneNumber,
("customerName" .=) <$> _jsCustomerName,
("assignee" .=) <$> _jsAssignee,
("customFields" .=) <$> _jsCustomFields,
("title" .=) <$> _jsTitle])
data CustomFieldDef = CustomFieldDef'
{ _cfdEnabled :: !(Maybe Bool)
, _cfdKind :: !Text
, _cfdName :: !(Maybe Text)
, _cfdRequiredForCheckout :: !(Maybe Bool)
, _cfdId :: !(Maybe (Textual Int64))
, _cfdEnumitems :: !(Maybe [EnumItemDef])
, _cfdType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
customFieldDef
:: CustomFieldDef
customFieldDef =
CustomFieldDef'
{ _cfdEnabled = Nothing
, _cfdKind = "coordinate#customFieldDef"
, _cfdName = Nothing
, _cfdRequiredForCheckout = Nothing
, _cfdId = Nothing
, _cfdEnumitems = Nothing
, _cfdType = Nothing
}
cfdEnabled :: Lens' CustomFieldDef (Maybe Bool)
cfdEnabled
= lens _cfdEnabled (\ s a -> s{_cfdEnabled = a})
cfdKind :: Lens' CustomFieldDef Text
cfdKind = lens _cfdKind (\ s a -> s{_cfdKind = a})
cfdName :: Lens' CustomFieldDef (Maybe Text)
cfdName = lens _cfdName (\ s a -> s{_cfdName = a})
cfdRequiredForCheckout :: Lens' CustomFieldDef (Maybe Bool)
cfdRequiredForCheckout
= lens _cfdRequiredForCheckout
(\ s a -> s{_cfdRequiredForCheckout = a})
cfdId :: Lens' CustomFieldDef (Maybe Int64)
cfdId
= lens _cfdId (\ s a -> s{_cfdId = a}) .
mapping _Coerce
cfdEnumitems :: Lens' CustomFieldDef [EnumItemDef]
cfdEnumitems
= lens _cfdEnumitems (\ s a -> s{_cfdEnumitems = a})
. _Default
. _Coerce
cfdType :: Lens' CustomFieldDef (Maybe Text)
cfdType = lens _cfdType (\ s a -> s{_cfdType = a})
instance FromJSON CustomFieldDef where
parseJSON
= withObject "CustomFieldDef"
(\ o ->
CustomFieldDef' <$>
(o .:? "enabled") <*>
(o .:? "kind" .!= "coordinate#customFieldDef")
<*> (o .:? "name")
<*> (o .:? "requiredForCheckout")
<*> (o .:? "id")
<*> (o .:? "enumitems" .!= mempty)
<*> (o .:? "type"))
instance ToJSON CustomFieldDef where
toJSON CustomFieldDef'{..}
= object
(catMaybes
[("enabled" .=) <$> _cfdEnabled,
Just ("kind" .= _cfdKind), ("name" .=) <$> _cfdName,
("requiredForCheckout" .=) <$>
_cfdRequiredForCheckout,
("id" .=) <$> _cfdId,
("enumitems" .=) <$> _cfdEnumitems,
("type" .=) <$> _cfdType])
data JobListResponse = JobListResponse'
{ _jlrNextPageToken :: !(Maybe Text)
, _jlrKind :: !Text
, _jlrItems :: !(Maybe [Job])
} deriving (Eq,Show,Data,Typeable,Generic)
jobListResponse
:: JobListResponse
jobListResponse =
JobListResponse'
{ _jlrNextPageToken = Nothing
, _jlrKind = "coordinate#jobList"
, _jlrItems = Nothing
}
jlrNextPageToken :: Lens' JobListResponse (Maybe Text)
jlrNextPageToken
= lens _jlrNextPageToken
(\ s a -> s{_jlrNextPageToken = a})
jlrKind :: Lens' JobListResponse Text
jlrKind = lens _jlrKind (\ s a -> s{_jlrKind = a})
jlrItems :: Lens' JobListResponse [Job]
jlrItems
= lens _jlrItems (\ s a -> s{_jlrItems = a}) .
_Default
. _Coerce
instance FromJSON JobListResponse where
parseJSON
= withObject "JobListResponse"
(\ o ->
JobListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "coordinate#jobList")
<*> (o .:? "items" .!= mempty))
instance ToJSON JobListResponse where
toJSON JobListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _jlrNextPageToken,
Just ("kind" .= _jlrKind),
("items" .=) <$> _jlrItems])
data JobChange = JobChange'
{ _jcState :: !(Maybe JobState)
, _jcKind :: !Text
, _jcTimestamp :: !(Maybe (Textual Word64))
} deriving (Eq,Show,Data,Typeable,Generic)
jobChange
:: JobChange
jobChange =
JobChange'
{ _jcState = Nothing
, _jcKind = "coordinate#jobChange"
, _jcTimestamp = Nothing
}
jcState :: Lens' JobChange (Maybe JobState)
jcState = lens _jcState (\ s a -> s{_jcState = a})
jcKind :: Lens' JobChange Text
jcKind = lens _jcKind (\ s a -> s{_jcKind = a})
jcTimestamp :: Lens' JobChange (Maybe Word64)
jcTimestamp
= lens _jcTimestamp (\ s a -> s{_jcTimestamp = a}) .
mapping _Coerce
instance FromJSON JobChange where
parseJSON
= withObject "JobChange"
(\ o ->
JobChange' <$>
(o .:? "state") <*>
(o .:? "kind" .!= "coordinate#jobChange")
<*> (o .:? "timestamp"))
instance ToJSON JobChange where
toJSON JobChange'{..}
= object
(catMaybes
[("state" .=) <$> _jcState, Just ("kind" .= _jcKind),
("timestamp" .=) <$> _jcTimestamp])
data TeamListResponse = TeamListResponse'
{ _tlrKind :: !Text
, _tlrItems :: !(Maybe [Team])
} deriving (Eq,Show,Data,Typeable,Generic)
teamListResponse
:: TeamListResponse
teamListResponse =
TeamListResponse'
{ _tlrKind = "coordinate#teamList"
, _tlrItems = Nothing
}
tlrKind :: Lens' TeamListResponse Text
tlrKind = lens _tlrKind (\ s a -> s{_tlrKind = a})
tlrItems :: Lens' TeamListResponse [Team]
tlrItems
= lens _tlrItems (\ s a -> s{_tlrItems = a}) .
_Default
. _Coerce
instance FromJSON TeamListResponse where
parseJSON
= withObject "TeamListResponse"
(\ o ->
TeamListResponse' <$>
(o .:? "kind" .!= "coordinate#teamList") <*>
(o .:? "items" .!= mempty))
instance ToJSON TeamListResponse where
toJSON TeamListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _tlrKind),
("items" .=) <$> _tlrItems])
data CustomFieldDefListResponse = CustomFieldDefListResponse'
{ _cfdlrKind :: !Text
, _cfdlrItems :: !(Maybe [CustomFieldDef])
} deriving (Eq,Show,Data,Typeable,Generic)
customFieldDefListResponse
:: CustomFieldDefListResponse
customFieldDefListResponse =
CustomFieldDefListResponse'
{ _cfdlrKind = "coordinate#customFieldDefList"
, _cfdlrItems = Nothing
}
cfdlrKind :: Lens' CustomFieldDefListResponse Text
cfdlrKind
= lens _cfdlrKind (\ s a -> s{_cfdlrKind = a})
cfdlrItems :: Lens' CustomFieldDefListResponse [CustomFieldDef]
cfdlrItems
= lens _cfdlrItems (\ s a -> s{_cfdlrItems = a}) .
_Default
. _Coerce
instance FromJSON CustomFieldDefListResponse where
parseJSON
= withObject "CustomFieldDefListResponse"
(\ o ->
CustomFieldDefListResponse' <$>
(o .:? "kind" .!= "coordinate#customFieldDefList")
<*> (o .:? "items" .!= mempty))
instance ToJSON CustomFieldDefListResponse where
toJSON CustomFieldDefListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _cfdlrKind),
("items" .=) <$> _cfdlrItems])
data Job = Job'
{ _jState :: !(Maybe JobState)
, _jKind :: !Text
, _jJobChange :: !(Maybe [JobChange])
, _jId :: !(Maybe (Textual Word64))
} deriving (Eq,Show,Data,Typeable,Generic)
job
:: Job
job =
Job'
{ _jState = Nothing
, _jKind = "coordinate#job"
, _jJobChange = Nothing
, _jId = Nothing
}
jState :: Lens' Job (Maybe JobState)
jState = lens _jState (\ s a -> s{_jState = a})
jKind :: Lens' Job Text
jKind = lens _jKind (\ s a -> s{_jKind = a})
jJobChange :: Lens' Job [JobChange]
jJobChange
= lens _jJobChange (\ s a -> s{_jJobChange = a}) .
_Default
. _Coerce
jId :: Lens' Job (Maybe Word64)
jId
= lens _jId (\ s a -> s{_jId = a}) . mapping _Coerce
instance FromJSON Job where
parseJSON
= withObject "Job"
(\ o ->
Job' <$>
(o .:? "state") <*>
(o .:? "kind" .!= "coordinate#job")
<*> (o .:? "jobChange" .!= mempty)
<*> (o .:? "id"))
instance ToJSON Job where
toJSON Job'{..}
= object
(catMaybes
[("state" .=) <$> _jState, Just ("kind" .= _jKind),
("jobChange" .=) <$> _jJobChange,
("id" .=) <$> _jId])
data CustomFields = CustomFields'
{ _cfKind :: !Text
, _cfCustomField :: !(Maybe [CustomField])
} deriving (Eq,Show,Data,Typeable,Generic)
customFields
:: CustomFields
customFields =
CustomFields'
{ _cfKind = "coordinate#customFields"
, _cfCustomField = Nothing
}
cfKind :: Lens' CustomFields Text
cfKind = lens _cfKind (\ s a -> s{_cfKind = a})
cfCustomField :: Lens' CustomFields [CustomField]
cfCustomField
= lens _cfCustomField
(\ s a -> s{_cfCustomField = a})
. _Default
. _Coerce
instance FromJSON CustomFields where
parseJSON
= withObject "CustomFields"
(\ o ->
CustomFields' <$>
(o .:? "kind" .!= "coordinate#customFields") <*>
(o .:? "customField" .!= mempty))
instance ToJSON CustomFields where
toJSON CustomFields'{..}
= object
(catMaybes
[Just ("kind" .= _cfKind),
("customField" .=) <$> _cfCustomField])
data Team = Team'
{ _tKind :: !Text
, _tName :: !(Maybe Text)
, _tId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
team
:: Team
team =
Team'
{ _tKind = "coordinate#team"
, _tName = Nothing
, _tId = Nothing
}
tKind :: Lens' Team Text
tKind = lens _tKind (\ s a -> s{_tKind = a})
tName :: Lens' Team (Maybe Text)
tName = lens _tName (\ s a -> s{_tName = a})
tId :: Lens' Team (Maybe Text)
tId = lens _tId (\ s a -> s{_tId = a})
instance FromJSON Team where
parseJSON
= withObject "Team"
(\ o ->
Team' <$>
(o .:? "kind" .!= "coordinate#team") <*>
(o .:? "name")
<*> (o .:? "id"))
instance ToJSON Team where
toJSON Team'{..}
= object
(catMaybes
[Just ("kind" .= _tKind), ("name" .=) <$> _tName,
("id" .=) <$> _tId])
data LocationRecord = LocationRecord'
{ _lrKind :: !Text
, _lrLatitude :: !(Maybe (Textual Double))
, _lrConfidenceRadius :: !(Maybe (Textual Double))
, _lrLongitude :: !(Maybe (Textual Double))
, _lrCollectionTime :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
locationRecord
:: LocationRecord
locationRecord =
LocationRecord'
{ _lrKind = "coordinate#locationRecord"
, _lrLatitude = Nothing
, _lrConfidenceRadius = Nothing
, _lrLongitude = Nothing
, _lrCollectionTime = Nothing
}
lrKind :: Lens' LocationRecord Text
lrKind = lens _lrKind (\ s a -> s{_lrKind = a})
lrLatitude :: Lens' LocationRecord (Maybe Double)
lrLatitude
= lens _lrLatitude (\ s a -> s{_lrLatitude = a}) .
mapping _Coerce
lrConfidenceRadius :: Lens' LocationRecord (Maybe Double)
lrConfidenceRadius
= lens _lrConfidenceRadius
(\ s a -> s{_lrConfidenceRadius = a})
. mapping _Coerce
lrLongitude :: Lens' LocationRecord (Maybe Double)
lrLongitude
= lens _lrLongitude (\ s a -> s{_lrLongitude = a}) .
mapping _Coerce
lrCollectionTime :: Lens' LocationRecord (Maybe Int64)
lrCollectionTime
= lens _lrCollectionTime
(\ s a -> s{_lrCollectionTime = a})
. mapping _Coerce
instance FromJSON LocationRecord where
parseJSON
= withObject "LocationRecord"
(\ o ->
LocationRecord' <$>
(o .:? "kind" .!= "coordinate#locationRecord") <*>
(o .:? "latitude")
<*> (o .:? "confidenceRadius")
<*> (o .:? "longitude")
<*> (o .:? "collectionTime"))
instance ToJSON LocationRecord where
toJSON LocationRecord'{..}
= object
(catMaybes
[Just ("kind" .= _lrKind),
("latitude" .=) <$> _lrLatitude,
("confidenceRadius" .=) <$> _lrConfidenceRadius,
("longitude" .=) <$> _lrLongitude,
("collectionTime" .=) <$> _lrCollectionTime])
data Worker = Worker'
{ _wKind :: !Text
, _wId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
worker
:: Worker
worker =
Worker'
{ _wKind = "coordinate#worker"
, _wId = Nothing
}
wKind :: Lens' Worker Text
wKind = lens _wKind (\ s a -> s{_wKind = a})
wId :: Lens' Worker (Maybe Text)
wId = lens _wId (\ s a -> s{_wId = a})
instance FromJSON Worker where
parseJSON
= withObject "Worker"
(\ o ->
Worker' <$>
(o .:? "kind" .!= "coordinate#worker") <*>
(o .:? "id"))
instance ToJSON Worker where
toJSON Worker'{..}
= object
(catMaybes
[Just ("kind" .= _wKind), ("id" .=) <$> _wId])
data CustomField = CustomField'
{ _cCustomFieldId :: !(Maybe (Textual Int64))
, _cKind :: !Text
, _cValue :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
customField
:: CustomField
customField =
CustomField'
{ _cCustomFieldId = Nothing
, _cKind = "coordinate#customField"
, _cValue = Nothing
}
cCustomFieldId :: Lens' CustomField (Maybe Int64)
cCustomFieldId
= lens _cCustomFieldId
(\ s a -> s{_cCustomFieldId = a})
. mapping _Coerce
cKind :: Lens' CustomField Text
cKind = lens _cKind (\ s a -> s{_cKind = a})
cValue :: Lens' CustomField (Maybe Text)
cValue = lens _cValue (\ s a -> s{_cValue = a})
instance FromJSON CustomField where
parseJSON
= withObject "CustomField"
(\ o ->
CustomField' <$>
(o .:? "customFieldId") <*>
(o .:? "kind" .!= "coordinate#customField")
<*> (o .:? "value"))
instance ToJSON CustomField where
toJSON CustomField'{..}
= object
(catMaybes
[("customFieldId" .=) <$> _cCustomFieldId,
Just ("kind" .= _cKind), ("value" .=) <$> _cValue])
data EnumItemDef = EnumItemDef'
{ _eidKind :: !Text
, _eidValue :: !(Maybe Text)
, _eidActive :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
enumItemDef
:: EnumItemDef
enumItemDef =
EnumItemDef'
{ _eidKind = "coordinate#enumItemDef"
, _eidValue = Nothing
, _eidActive = Nothing
}
eidKind :: Lens' EnumItemDef Text
eidKind = lens _eidKind (\ s a -> s{_eidKind = a})
eidValue :: Lens' EnumItemDef (Maybe Text)
eidValue = lens _eidValue (\ s a -> s{_eidValue = a})
eidActive :: Lens' EnumItemDef (Maybe Bool)
eidActive
= lens _eidActive (\ s a -> s{_eidActive = a})
instance FromJSON EnumItemDef where
parseJSON
= withObject "EnumItemDef"
(\ o ->
EnumItemDef' <$>
(o .:? "kind" .!= "coordinate#enumItemDef") <*>
(o .:? "value")
<*> (o .:? "active"))
instance ToJSON EnumItemDef where
toJSON EnumItemDef'{..}
= object
(catMaybes
[Just ("kind" .= _eidKind),
("value" .=) <$> _eidValue,
("active" .=) <$> _eidActive])