| GET | /{Workspace}/TeamCurrentLocation |
|---|
import 'package:servicestack/servicestack.dart';
class Location implements IConvertible
{
double? y;
double? x;
Location({this.y,this.x});
Location.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
y = JsonConverters.toDouble(json['y']);
x = JsonConverters.toDouble(json['x']);
return this;
}
Map<String, dynamic> toJson() => {
'y': y,
'x': x
};
getTypeName() => "Location";
TypeContext? context = _ctx;
}
class UserCurrentLocation extends Location implements IConvertible
{
String? ObjectId;
String? TimeStamp;
UserCurrentLocation({this.ObjectId,this.TimeStamp});
UserCurrentLocation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ObjectId = json['ObjectId'];
TimeStamp = json['TimeStamp'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ObjectId': ObjectId,
'TimeStamp': TimeStamp
});
getTypeName() => "UserCurrentLocation";
TypeContext? context = _ctx;
}
class TeamLocation implements IConvertible
{
String? ObjectId;
List<UserCurrentLocation>? UserLocations;
TeamLocation({this.ObjectId,this.UserLocations});
TeamLocation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ObjectId = json['ObjectId'];
UserLocations = JsonConverters.fromJson(json['UserLocations'],'List<UserCurrentLocation>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ObjectId': ObjectId,
'UserLocations': JsonConverters.toJson(UserLocations,'List<UserCurrentLocation>',context!)
};
getTypeName() => "TeamLocation";
TypeContext? context = _ctx;
}
/**
* GET /{Workspace}/TeamCurrentLocation - Returns the current location of all users in the workspace, grouped by team.
*/
class TeamCurrentLocation implements IConvertible
{
String? Workspace;
List<TeamLocation>? TeamLocations;
TeamCurrentLocation({this.Workspace,this.TeamLocations});
TeamCurrentLocation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
TeamLocations = JsonConverters.fromJson(json['TeamLocations'],'List<TeamLocation>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'TeamLocations': JsonConverters.toJson(TeamLocations,'List<TeamLocation>',context!)
};
getTypeName() => "TeamCurrentLocation";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'Location': TypeInfo(TypeOf.Class, create:() => Location()),
'UserCurrentLocation': TypeInfo(TypeOf.Class, create:() => UserCurrentLocation()),
'TeamLocation': TypeInfo(TypeOf.Class, create:() => TeamLocation()),
'List<UserCurrentLocation>': TypeInfo(TypeOf.Class, create:() => <UserCurrentLocation>[]),
'TeamCurrentLocation': TypeInfo(TypeOf.Class, create:() => TeamCurrentLocation()),
'List<TeamLocation>': TypeInfo(TypeOf.Class, create:() => <TeamLocation>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /{Workspace}/TeamCurrentLocation HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv