Trendsic Platform Service

<back to all web services

DispatchModulesSaveRequest

Requires Authentication
The following routes are available for this service:
PUT,OPTIONS/v1/dispatch/settings/modules
import 'package:servicestack/servicestack.dart';

class DispatchModuleView implements IConvertible
{
    String? Key;
    String? Mode;
    bool? Allowed;
    bool? Enabled;
    int? InFlight;

    DispatchModuleView({this.Key,this.Mode,this.Allowed,this.Enabled,this.InFlight});
    DispatchModuleView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Key = json['Key'];
        Mode = json['Mode'];
        Allowed = json['Allowed'];
        Enabled = json['Enabled'];
        InFlight = json['InFlight'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Mode': Mode,
        'Allowed': Allowed,
        'Enabled': Enabled,
        'InFlight': InFlight
    };

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

class DispatchPatternView implements IConvertible
{
    String? PatternId;
    String? Name;
    String? Source;
    String? Facility;
    String? Unit;
    bool? HasQuotas;
    bool? IsInverted;
    int? LoadLimitMins;
    String? TicketSource;
    String? PayBasis;
    bool? IsActive;

    DispatchPatternView({this.PatternId,this.Name,this.Source,this.Facility,this.Unit,this.HasQuotas,this.IsInverted,this.LoadLimitMins,this.TicketSource,this.PayBasis,this.IsActive});
    DispatchPatternView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PatternId = json['PatternId'];
        Name = json['Name'];
        Source = json['Source'];
        Facility = json['Facility'];
        Unit = json['Unit'];
        HasQuotas = json['HasQuotas'];
        IsInverted = json['IsInverted'];
        LoadLimitMins = json['LoadLimitMins'];
        TicketSource = json['TicketSource'];
        PayBasis = json['PayBasis'];
        IsActive = json['IsActive'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PatternId': PatternId,
        'Name': Name,
        'Source': Source,
        'Facility': Facility,
        'Unit': Unit,
        'HasQuotas': HasQuotas,
        'IsInverted': IsInverted,
        'LoadLimitMins': LoadLimitMins,
        'TicketSource': TicketSource,
        'PayBasis': PayBasis,
        'IsActive': IsActive
    };

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

class DispatchModulesResponse implements IConvertible
{
    List<DispatchModuleView>? Modules = [];
    List<DispatchPatternView>? Patterns = [];
    ResponseStatus? ResponseStatus;

    DispatchModulesResponse({this.Modules,this.Patterns,this.ResponseStatus});
    DispatchModulesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Modules = JsonConverters.fromJson(json['Modules'],'List<DispatchModuleView>',context!);
        Patterns = JsonConverters.fromJson(json['Patterns'],'List<DispatchPatternView>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Modules': JsonConverters.toJson(Modules,'List<DispatchModuleView>',context!),
        'Patterns': JsonConverters.toJson(Patterns,'List<DispatchPatternView>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class DispatchModulesSaveRequest implements IConvertible
{
    String? Key;
    bool? Enabled;

    DispatchModulesSaveRequest({this.Key,this.Enabled});
    DispatchModulesSaveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Enabled': Enabled
    };

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

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

Dart DispatchModulesSaveRequest 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.

PUT /v1/dispatch/settings/modules HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Key: String,
	Enabled: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Modules: 
	[
		{
			Key: String,
			Mode: String,
			Allowed: False,
			Enabled: False,
			InFlight: 0
		}
	],
	Patterns: 
	[
		{
			PatternId: String,
			Name: String,
			Source: String,
			Facility: String,
			Unit: String,
			HasQuotas: False,
			IsInverted: False,
			LoadLimitMins: 0,
			TicketSource: String,
			PayBasis: String,
			IsActive: False
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}