Trendsic Platform Service

<back to all web services

RoutePlanOptimizeRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/routeplan/optimize
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class RoutePlanOptimizeAssignment implements IConvertible
{
    int? AgreementID;
    int? CrewID;
    int? Seq;

    RoutePlanOptimizeAssignment({this.AgreementID,this.CrewID,this.Seq});
    RoutePlanOptimizeAssignment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AgreementID = json['AgreementID'];
        CrewID = json['CrewID'];
        Seq = json['Seq'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AgreementID': AgreementID,
        'CrewID': CrewID,
        'Seq': Seq
    };

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

class RoutePlanOptimizeResponse implements IConvertible
{
    List<RoutePlanOptimizeAssignment>? Assignments = [];
    int? ByDefaultCrew;
    int? ByTerritory;
    int? SkippedHeld;
    String? Engine;
    ResponseStatus? ResponseStatus;

    RoutePlanOptimizeResponse({this.Assignments,this.ByDefaultCrew,this.ByTerritory,this.SkippedHeld,this.Engine,this.ResponseStatus});
    RoutePlanOptimizeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Assignments = JsonConverters.fromJson(json['Assignments'],'List<RoutePlanOptimizeAssignment>',context!);
        ByDefaultCrew = json['ByDefaultCrew'];
        ByTerritory = json['ByTerritory'];
        SkippedHeld = json['SkippedHeld'];
        Engine = json['Engine'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Assignments': JsonConverters.toJson(Assignments,'List<RoutePlanOptimizeAssignment>',context!),
        'ByDefaultCrew': ByDefaultCrew,
        'ByTerritory': ByTerritory,
        'SkippedHeld': SkippedHeld,
        'Engine': Engine,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class RoutePlanOptimizeRequest implements IConvertible
{
    String? DateIso;
    int? HoldDays;

    RoutePlanOptimizeRequest({this.DateIso,this.HoldDays});
    RoutePlanOptimizeRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        DateIso = json['DateIso'];
        HoldDays = json['HoldDays'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'DateIso': DateIso,
        'HoldDays': HoldDays
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'RoutePlanOptimizeAssignment': TypeInfo(TypeOf.Class, create:() => RoutePlanOptimizeAssignment()),
    'RoutePlanOptimizeResponse': TypeInfo(TypeOf.Class, create:() => RoutePlanOptimizeResponse()),
    'List<RoutePlanOptimizeAssignment>': TypeInfo(TypeOf.Class, create:() => <RoutePlanOptimizeAssignment>[]),
    'RoutePlanOptimizeRequest': TypeInfo(TypeOf.Class, create:() => RoutePlanOptimizeRequest()),
});

Dart RoutePlanOptimizeRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /v1/routeplan/optimize HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"DateIso":"String","HoldDays":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Assignments":[{"AgreementID":0,"CrewID":0,"Seq":0}],"ByDefaultCrew":0,"ByTerritory":0,"SkippedHeld":0,"Engine":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}