/* Options: Date: 2025-12-06 08:56:29 Version: 8.0 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://cochraneplus-api-dev.happen.zone //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: BackgroundLocationReceived.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; abstract class IHasApiKey { String? apiKey; } class CoordsData implements IConvertible { double? speed; double? longitude; double? latitude; double? accuracy; double? altitude; double? heading; CoordsData({this.speed,this.longitude,this.latitude,this.accuracy,this.altitude,this.heading}); CoordsData.fromJson(Map json) { fromMap(json); } fromMap(Map json) { speed = JsonConverters.toDouble(json['speed']); longitude = JsonConverters.toDouble(json['longitude']); latitude = JsonConverters.toDouble(json['latitude']); accuracy = JsonConverters.toDouble(json['accuracy']); altitude = JsonConverters.toDouble(json['altitude']); heading = JsonConverters.toDouble(json['heading']); return this; } Map toJson() => { 'speed': speed, 'longitude': longitude, 'latitude': latitude, 'accuracy': accuracy, 'altitude': altitude, 'heading': heading }; getTypeName() => "CoordsData"; TypeContext? context = _ctx; } class ExtrasData implements IConvertible { int? systemUserId; String? deviceId; ExtrasData({this.systemUserId,this.deviceId}); ExtrasData.fromJson(Map json) { fromMap(json); } fromMap(Map json) { systemUserId = json['systemUserId']; deviceId = json['deviceId']; return this; } Map toJson() => { 'systemUserId': systemUserId, 'deviceId': deviceId }; getTypeName() => "ExtrasData"; TypeContext? context = _ctx; } class ActivityData implements IConvertible { String? type; int? confidence; ActivityData({this.type,this.confidence}); ActivityData.fromJson(Map json) { fromMap(json); } fromMap(Map json) { type = json['type']; confidence = json['confidence']; return this; } Map toJson() => { 'type': type, 'confidence': confidence }; getTypeName() => "ActivityData"; TypeContext? context = _ctx; } class BatteryData implements IConvertible { double? level; bool? is_charging; BatteryData({this.level,this.is_charging}); BatteryData.fromJson(Map json) { fromMap(json); } fromMap(Map json) { level = JsonConverters.toDouble(json['level']); is_charging = json['is_charging']; return this; } Map toJson() => { 'level': level, 'is_charging': is_charging }; getTypeName() => "BatteryData"; TypeContext? context = _ctx; } class LocationData implements IConvertible { CoordsData? coords; ExtrasData? extras; bool? is_moving; double? odometer; String? uuid; ActivityData? activity; BatteryData? battery; DateTime? timestamp; LocationData({this.coords,this.extras,this.is_moving,this.odometer,this.uuid,this.activity,this.battery,this.timestamp}); LocationData.fromJson(Map json) { fromMap(json); } fromMap(Map json) { coords = JsonConverters.fromJson(json['coords'],'CoordsData',context!); extras = JsonConverters.fromJson(json['extras'],'ExtrasData',context!); is_moving = json['is_moving']; odometer = JsonConverters.toDouble(json['odometer']); uuid = json['uuid']; activity = JsonConverters.fromJson(json['activity'],'ActivityData',context!); battery = JsonConverters.fromJson(json['battery'],'BatteryData',context!); timestamp = JsonConverters.fromJson(json['timestamp'],'DateTime',context!); return this; } Map toJson() => { 'coords': JsonConverters.toJson(coords,'CoordsData',context!), 'extras': JsonConverters.toJson(extras,'ExtrasData',context!), 'is_moving': is_moving, 'odometer': odometer, 'uuid': uuid, 'activity': JsonConverters.toJson(activity,'ActivityData',context!), 'battery': JsonConverters.toJson(battery,'BatteryData',context!), 'timestamp': JsonConverters.toJson(timestamp,'DateTime',context!) }; getTypeName() => "LocationData"; TypeContext? context = _ctx; } abstract class IServiceResponse { bool? wasSuccessful; String? description; String? heading; } class ApiServiceResponse implements IServiceResponse, IConvertible { String? description; String? heading; bool? wasSuccessful; dynamic? modelState; ApiServiceResponse({this.description,this.heading,this.wasSuccessful,this.modelState}); ApiServiceResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { description = json['description']; heading = json['heading']; wasSuccessful = json['wasSuccessful']; modelState = JsonConverters.fromJson(json['modelState'],'dynamic',context!); return this; } Map toJson() => { 'description': description, 'heading': heading, 'wasSuccessful': wasSuccessful, 'modelState': JsonConverters.toJson(modelState,'dynamic',context!) }; getTypeName() => "ApiServiceResponse"; TypeContext? context = _ctx; } // @Route("/location/background", "POST") class BackgroundLocationReceived implements IReturn, IHasApiKey, IConvertible, IPost { String? apiKey; LocationData? location; BackgroundLocationReceived({this.apiKey,this.location}); BackgroundLocationReceived.fromJson(Map json) { fromMap(json); } fromMap(Map json) { apiKey = json['apiKey']; location = JsonConverters.fromJson(json['location'],'LocationData',context!); return this; } Map toJson() => { 'apiKey': apiKey, 'location': JsonConverters.toJson(location,'LocationData',context!) }; createResponse() => ApiServiceResponse(); getResponseTypeName() => "ApiServiceResponse"; getTypeName() => "BackgroundLocationReceived"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'cochraneplus_api_dev.happen.zone', types: { 'IHasApiKey': TypeInfo(TypeOf.Interface), 'CoordsData': TypeInfo(TypeOf.Class, create:() => CoordsData()), 'ExtrasData': TypeInfo(TypeOf.Class, create:() => ExtrasData()), 'ActivityData': TypeInfo(TypeOf.Class, create:() => ActivityData()), 'BatteryData': TypeInfo(TypeOf.Class, create:() => BatteryData()), 'LocationData': TypeInfo(TypeOf.Class, create:() => LocationData()), 'IServiceResponse': TypeInfo(TypeOf.Interface), 'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()), 'BackgroundLocationReceived': TypeInfo(TypeOf.Class, create:() => BackgroundLocationReceived()), });