| POST | /v1/workforce/patterns |
|---|
import 'package:servicestack/servicestack.dart';
class ShiftPattern implements IConvertible
{
int? ShiftPatternID;
String? BranchId;
String? Code;
String? Name;
String? Struct;
double? HoursPerDay;
int? OnDays;
int? OffDays;
String? PatternType;
bool? IsNight;
bool? HasBoundary;
bool? IsHitch;
bool? HasTravel;
bool? IsSeasonal;
String? SeasonalWindow;
bool? IsDayRate;
String? OtRuleId;
String? PerDiemRuleId;
String? Packs;
String? Status;
bool? IsSeed;
int? AssignedCount;
ShiftPattern({this.ShiftPatternID,this.BranchId,this.Code,this.Name,this.Struct,this.HoursPerDay,this.OnDays,this.OffDays,this.PatternType,this.IsNight,this.HasBoundary,this.IsHitch,this.HasTravel,this.IsSeasonal,this.SeasonalWindow,this.IsDayRate,this.OtRuleId,this.PerDiemRuleId,this.Packs,this.Status,this.IsSeed,this.AssignedCount});
ShiftPattern.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ShiftPatternID = json['ShiftPatternID'];
BranchId = json['BranchId'];
Code = json['Code'];
Name = json['Name'];
Struct = json['Struct'];
HoursPerDay = JsonConverters.toDouble(json['HoursPerDay']);
OnDays = json['OnDays'];
OffDays = json['OffDays'];
PatternType = json['PatternType'];
IsNight = json['IsNight'];
HasBoundary = json['HasBoundary'];
IsHitch = json['IsHitch'];
HasTravel = json['HasTravel'];
IsSeasonal = json['IsSeasonal'];
SeasonalWindow = json['SeasonalWindow'];
IsDayRate = json['IsDayRate'];
OtRuleId = json['OtRuleId'];
PerDiemRuleId = json['PerDiemRuleId'];
Packs = json['Packs'];
Status = json['Status'];
IsSeed = json['IsSeed'];
AssignedCount = json['AssignedCount'];
return this;
}
Map<String, dynamic> toJson() => {
'ShiftPatternID': ShiftPatternID,
'BranchId': BranchId,
'Code': Code,
'Name': Name,
'Struct': Struct,
'HoursPerDay': HoursPerDay,
'OnDays': OnDays,
'OffDays': OffDays,
'PatternType': PatternType,
'IsNight': IsNight,
'HasBoundary': HasBoundary,
'IsHitch': IsHitch,
'HasTravel': HasTravel,
'IsSeasonal': IsSeasonal,
'SeasonalWindow': SeasonalWindow,
'IsDayRate': IsDayRate,
'OtRuleId': OtRuleId,
'PerDiemRuleId': PerDiemRuleId,
'Packs': Packs,
'Status': Status,
'IsSeed': IsSeed,
'AssignedCount': AssignedCount
};
getTypeName() => "ShiftPattern";
TypeContext? context = _ctx;
}
class ShiftPatternsResponse implements IConvertible
{
List<ShiftPattern>? Patterns = [];
ResponseStatus? ResponseStatus;
ShiftPatternsResponse({this.Patterns,this.ResponseStatus});
ShiftPatternsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Patterns = JsonConverters.fromJson(json['Patterns'],'List<ShiftPattern>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Patterns': JsonConverters.toJson(Patterns,'List<ShiftPattern>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "ShiftPatternsResponse";
TypeContext? context = _ctx;
}
class ShiftPatternSaveRequest implements IConvertible
{
ShiftPattern? Pattern;
ShiftPatternSaveRequest({this.Pattern});
ShiftPatternSaveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Pattern = JsonConverters.fromJson(json['Pattern'],'ShiftPattern',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Pattern': JsonConverters.toJson(Pattern,'ShiftPattern',context!)
};
getTypeName() => "ShiftPatternSaveRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'ShiftPattern': TypeInfo(TypeOf.Class, create:() => ShiftPattern()),
'ShiftPatternsResponse': TypeInfo(TypeOf.Class, create:() => ShiftPatternsResponse()),
'List<ShiftPattern>': TypeInfo(TypeOf.Class, create:() => <ShiftPattern>[]),
'ShiftPatternSaveRequest': TypeInfo(TypeOf.Class, create:() => ShiftPatternSaveRequest()),
});
Dart ShiftPatternSaveRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/workforce/patterns HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Pattern":{"ShiftPatternID":0,"BranchId":"00000000000000000000000000000000","Code":"String","Name":"String","Struct":"String","HoursPerDay":0,"OnDays":0,"OffDays":0,"PatternType":"String","IsNight":false,"HasBoundary":false,"IsHitch":false,"HasTravel":false,"IsSeasonal":false,"SeasonalWindow":"String","IsDayRate":false,"OtRuleId":"String","PerDiemRuleId":"String","Packs":"String","Status":"String","IsSeed":false,"AssignedCount":0}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Patterns":[{"ShiftPatternID":0,"BranchId":"00000000000000000000000000000000","Code":"String","Name":"String","Struct":"String","HoursPerDay":0,"OnDays":0,"OffDays":0,"PatternType":"String","IsNight":false,"HasBoundary":false,"IsHitch":false,"HasTravel":false,"IsSeasonal":false,"SeasonalWindow":"String","IsDayRate":false,"OtRuleId":"String","PerDiemRuleId":"String","Packs":"String","Status":"String","IsSeed":false,"AssignedCount":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}