Field Squared API Services

<back to all web services

OptimizeScheduleRequest

The following routes are available for this service:
POST/{Workspace}/OptimizeSchedule
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 OptimizeScheduleRequest implements IConvertible
{
    String? Workspace;
    String? UserId;
    String? Date;
    List<String>? TaskIds;
    int? RoundStartTimes;
    int? TransitionTime;
    int? StartTime;
    Location? StartLocation;
    Location? EndLocation;
    bool? AllowReorder;
    int? LunchStart;
    int? LunchDuration;
    String? DebugRequestTime;
    bool? Debug;

    OptimizeScheduleRequest({this.Workspace,this.UserId,this.Date,this.TaskIds,this.RoundStartTimes,this.TransitionTime,this.StartTime,this.StartLocation,this.EndLocation,this.AllowReorder,this.LunchStart,this.LunchDuration,this.DebugRequestTime,this.Debug});
    OptimizeScheduleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        UserId = json['UserId'];
        Date = json['Date'];
        TaskIds = JsonConverters.fromJson(json['TaskIds'],'List<String>',context!);
        RoundStartTimes = json['RoundStartTimes'];
        TransitionTime = json['TransitionTime'];
        StartTime = json['StartTime'];
        StartLocation = JsonConverters.fromJson(json['StartLocation'],'Location',context!);
        EndLocation = JsonConverters.fromJson(json['EndLocation'],'Location',context!);
        AllowReorder = json['AllowReorder'];
        LunchStart = json['LunchStart'];
        LunchDuration = json['LunchDuration'];
        DebugRequestTime = json['DebugRequestTime'];
        Debug = json['Debug'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'UserId': UserId,
        'Date': Date,
        'TaskIds': JsonConverters.toJson(TaskIds,'List<String>',context!),
        'RoundStartTimes': RoundStartTimes,
        'TransitionTime': TransitionTime,
        'StartTime': StartTime,
        'StartLocation': JsonConverters.toJson(StartLocation,'Location',context!),
        'EndLocation': JsonConverters.toJson(EndLocation,'Location',context!),
        'AllowReorder': AllowReorder,
        'LunchStart': LunchStart,
        'LunchDuration': LunchDuration,
        'DebugRequestTime': DebugRequestTime,
        'Debug': Debug
    };

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

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

Dart OptimizeScheduleRequest DTOs

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

HTTP + CSV

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

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

{"Workspace":"String","UserId":"String","Date":"String","TaskIds":["String"],"RoundStartTimes":0,"TransitionTime":0,"StartTime":0,"StartLocation":{"y":0,"x":0},"EndLocation":{"y":0,"x":0},"AllowReorder":false,"LunchStart":0,"LunchDuration":0,"DebugRequestTime":"String","Debug":false}