| POST | /{Workspace}/ScheduleRequestList |
|---|
import 'package:servicestack/servicestack.dart';
class Schedule implements IConvertible
{
String? Workspace;
String? ObjectId;
String? VersionId;
String? BasedOn;
String? Start;
String? End;
String? TimeZone;
List<String>? Users;
List<String>? Teams;
Map<String,dynamic?>? Data;
Schedule({this.Workspace,this.ObjectId,this.VersionId,this.BasedOn,this.Start,this.End,this.TimeZone,this.Users,this.Teams,this.Data});
Schedule.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
ObjectId = json['ObjectId'];
VersionId = json['VersionId'];
BasedOn = json['BasedOn'];
Start = json['Start'];
End = json['End'];
TimeZone = json['TimeZone'];
Users = JsonConverters.fromJson(json['Users'],'List<String>',context!);
Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
Data = JsonConverters.fromJson(json['Data'],'Map<String,dynamic?>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'ObjectId': ObjectId,
'VersionId': VersionId,
'BasedOn': BasedOn,
'Start': Start,
'End': End,
'TimeZone': TimeZone,
'Users': JsonConverters.toJson(Users,'List<String>',context!),
'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
'Data': JsonConverters.toJson(Data,'Map<String,dynamic?>',context!)
};
getTypeName() => "Schedule";
TypeContext? context = _ctx;
}
class ScheduleRequest implements IConvertible
{
String? Workspace;
String? ObjectId;
String? VersionId;
List<String>? Users;
List<String>? Teams;
bool? UnassignUsers;
bool? UnassignTeams;
bool? Unschedule;
bool? DeleteTask;
String? Status;
String? Type;
String? TaskType;
String? DueDate;
bool? SetPriority;
int? Priority;
List<Schedule>? Schedules;
ScheduleRequest({this.Workspace,this.ObjectId,this.VersionId,this.Users,this.Teams,this.UnassignUsers,this.UnassignTeams,this.Unschedule,this.DeleteTask,this.Status,this.Type,this.TaskType,this.DueDate,this.SetPriority,this.Priority,this.Schedules});
ScheduleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
ObjectId = json['ObjectId'];
VersionId = json['VersionId'];
Users = JsonConverters.fromJson(json['Users'],'List<String>',context!);
Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
UnassignUsers = json['UnassignUsers'];
UnassignTeams = json['UnassignTeams'];
Unschedule = json['Unschedule'];
DeleteTask = json['DeleteTask'];
Status = json['Status'];
Type = json['Type'];
TaskType = json['TaskType'];
DueDate = json['DueDate'];
SetPriority = json['SetPriority'];
Priority = json['Priority'];
Schedules = JsonConverters.fromJson(json['Schedules'],'List<Schedule>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'ObjectId': ObjectId,
'VersionId': VersionId,
'Users': JsonConverters.toJson(Users,'List<String>',context!),
'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
'UnassignUsers': UnassignUsers,
'UnassignTeams': UnassignTeams,
'Unschedule': Unschedule,
'DeleteTask': DeleteTask,
'Status': Status,
'Type': Type,
'TaskType': TaskType,
'DueDate': DueDate,
'SetPriority': SetPriority,
'Priority': Priority,
'Schedules': JsonConverters.toJson(Schedules,'List<Schedule>',context!)
};
getTypeName() => "ScheduleRequest";
TypeContext? context = _ctx;
}
/**
* Set schedules for multiple tasks in a single operation.
*/
class ScheduleRequestList implements IConvertible
{
String? Workspace;
List<ScheduleRequest>? ScheduleRequests;
ScheduleRequestList({this.Workspace,this.ScheduleRequests});
ScheduleRequestList.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
ScheduleRequests = JsonConverters.fromJson(json['ScheduleRequests'],'List<ScheduleRequest>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'ScheduleRequests': JsonConverters.toJson(ScheduleRequests,'List<ScheduleRequest>',context!)
};
getTypeName() => "ScheduleRequestList";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'Schedule': TypeInfo(TypeOf.Class, create:() => Schedule()),
'Map<String,dynamic?>': TypeInfo(TypeOf.Class, create:() => Map<String,dynamic?>()),
'ScheduleRequest': TypeInfo(TypeOf.Class, create:() => ScheduleRequest()),
'List<Schedule>': TypeInfo(TypeOf.Class, create:() => <Schedule>[]),
'ScheduleRequestList': TypeInfo(TypeOf.Class, create:() => ScheduleRequestList()),
'List<ScheduleRequest>': TypeInfo(TypeOf.Class, create:() => <ScheduleRequest>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/ScheduleRequestList HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ScheduleRequestList xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Schedules">
<ScheduleRequests>
<ScheduleRequest>
<DeleteTask>false</DeleteTask>
<DueDate>String</DueDate>
<ObjectId>String</ObjectId>
<Priority>0</Priority>
<Schedules>
<Schedule>
<BasedOn>String</BasedOn>
<Data xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:KeyValueOfstringanyType>
<d6p1:Key>String</d6p1:Key>
<d6p1:Value />
</d6p1:KeyValueOfstringanyType>
</Data>
<End>String</End>
<ObjectId>String</ObjectId>
<Start>String</Start>
<Teams xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:string>String</d6p1:string>
</Teams>
<TimeZone>String</TimeZone>
<Users xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:string>String</d6p1:string>
</Users>
<VersionId>String</VersionId>
<Workspace>String</Workspace>
</Schedule>
</Schedules>
<SetPriority>false</SetPriority>
<Status>String</Status>
<TaskType>String</TaskType>
<Teams xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</Teams>
<Type>String</Type>
<UnassignTeams>false</UnassignTeams>
<UnassignUsers>false</UnassignUsers>
<Unschedule>false</Unschedule>
<Users xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</Users>
<VersionId>String</VersionId>
<Workspace>String</Workspace>
</ScheduleRequest>
</ScheduleRequests>
<Workspace>String</Workspace>
</ScheduleRequestList>