Field Squared API Services

<back to all web services

ArrivalDeparture

Service representing an ArrivalDeparture object in a workspace.

The following routes are available for this service:
POST/{Workspace}/ArrivalDeparture/{ObjectId}
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;
}

/**
* Service representing an ArrivalDeparture object in a workspace.
*/
class ArrivalDeparture implements IConvertible
{
    String? Workspace;
    String? ObjectId;
    String? ArrivalTime;
    String? DepartureTime;
    Location? GeofenceLocation;
    String? GeofenceId;
    double? GeofenceRadius;
    String? User;
    String? Task;

    ArrivalDeparture({this.Workspace,this.ObjectId,this.ArrivalTime,this.DepartureTime,this.GeofenceLocation,this.GeofenceId,this.GeofenceRadius,this.User,this.Task});
    ArrivalDeparture.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        ObjectId = json['ObjectId'];
        ArrivalTime = json['ArrivalTime'];
        DepartureTime = json['DepartureTime'];
        GeofenceLocation = JsonConverters.fromJson(json['GeofenceLocation'],'Location',context!);
        GeofenceId = json['GeofenceId'];
        GeofenceRadius = JsonConverters.toDouble(json['GeofenceRadius']);
        User = json['User'];
        Task = json['Task'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'ObjectId': ObjectId,
        'ArrivalTime': ArrivalTime,
        'DepartureTime': DepartureTime,
        'GeofenceLocation': JsonConverters.toJson(GeofenceLocation,'Location',context!),
        'GeofenceId': GeofenceId,
        'GeofenceRadius': GeofenceRadius,
        'User': User,
        'Task': Task
    };

    getTypeName() => "ArrivalDeparture";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'Location': TypeInfo(TypeOf.Class, create:() => Location()),
    'ArrivalDeparture': TypeInfo(TypeOf.Class, create:() => ArrivalDeparture()),
});

Dart ArrivalDeparture DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /{Workspace}/ArrivalDeparture/{ObjectId} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Workspace: String,
	ObjectId: String,
	ArrivalTime: String,
	DepartureTime: String,
	GeofenceLocation: 
	{
		y: 0,
		x: 0
	},
	GeofenceId: String,
	GeofenceRadius: 0,
	User: String,
	Task: String
}