GET | /RestApi/sitefinity/scheduling/scheduled-tasks |
---|
import 'package:servicestack/servicestack.dart';
enum OrderByType
{
ScheduledFor,
LastExecutionDate,
Status,
NameAsc,
NameDesc,
}
enum FilterByType
{
All,
Pending,
Started,
Stopped,
Failed,
Recurring,
}
class GetScheduledTasks implements IConvertible
{
int? Skip;
int? Take;
String? SearchTerm;
OrderByType? OrderBy;
FilterByType? FilterBy;
GetScheduledTasks({this.Skip,this.Take,this.SearchTerm,this.OrderBy,this.FilterBy});
GetScheduledTasks.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Skip = json['Skip'];
Take = json['Take'];
SearchTerm = json['SearchTerm'];
OrderBy = JsonConverters.fromJson(json['OrderBy'],'OrderByType',context!);
FilterBy = JsonConverters.fromJson(json['FilterBy'],'FilterByType',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Skip': Skip,
'Take': Take,
'SearchTerm': SearchTerm,
'OrderBy': JsonConverters.toJson(OrderBy,'OrderByType',context!),
'FilterBy': JsonConverters.toJson(FilterBy,'FilterByType',context!)
};
getTypeName() => "GetScheduledTasks";
TypeContext? context = _ctx;
}
class ScheduledTaskViewModel implements IConvertible
{
String? TaskId;
String? Name;
String? Title;
String? Status;
String? ErrorMessage;
String? RecurringInterval;
DateTime? ScheduledForDate;
DateTime? LastExecutionTime;
String? Hash;
ScheduledTaskViewModel({this.TaskId,this.Name,this.Title,this.Status,this.ErrorMessage,this.RecurringInterval,this.ScheduledForDate,this.LastExecutionTime,this.Hash});
ScheduledTaskViewModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TaskId = json['TaskId'];
Name = json['Name'];
Title = json['Title'];
Status = json['Status'];
ErrorMessage = json['ErrorMessage'];
RecurringInterval = json['RecurringInterval'];
ScheduledForDate = JsonConverters.fromJson(json['ScheduledForDate'],'DateTime',context!);
LastExecutionTime = JsonConverters.fromJson(json['LastExecutionTime'],'DateTime',context!);
Hash = json['Hash'];
return this;
}
Map<String, dynamic> toJson() => {
'TaskId': TaskId,
'Name': Name,
'Title': Title,
'Status': Status,
'ErrorMessage': ErrorMessage,
'RecurringInterval': RecurringInterval,
'ScheduledForDate': JsonConverters.toJson(ScheduledForDate,'DateTime',context!),
'LastExecutionTime': JsonConverters.toJson(LastExecutionTime,'DateTime',context!),
'Hash': Hash
};
getTypeName() => "ScheduledTaskViewModel";
TypeContext? context = _ctx;
}
class GetScheduledTasksResponse implements IConvertible
{
List<ScheduledTaskViewModel>? Items;
int? TotalCount;
GetScheduledTasksResponse({this.Items,this.TotalCount});
GetScheduledTasksResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Items = JsonConverters.fromJson(json['Items'],'List<ScheduledTaskViewModel>',context!);
TotalCount = json['TotalCount'];
return this;
}
Map<String, dynamic> toJson() => {
'Items': JsonConverters.toJson(Items,'List<ScheduledTaskViewModel>',context!),
'TotalCount': TotalCount
};
getTypeName() => "GetScheduledTasksResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
'OrderByType': TypeInfo(TypeOf.Enum, enumValues:OrderByType.values),
'FilterByType': TypeInfo(TypeOf.Enum, enumValues:FilterByType.values),
'GetScheduledTasks': TypeInfo(TypeOf.Class, create:() => GetScheduledTasks()),
'ScheduledTaskViewModel': TypeInfo(TypeOf.Class, create:() => ScheduledTaskViewModel()),
'GetScheduledTasksResponse': TypeInfo(TypeOf.Class, create:() => GetScheduledTasksResponse()),
'List<ScheduledTaskViewModel>': TypeInfo(TypeOf.Class, create:() => <ScheduledTaskViewModel>[]),
});
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.
GET /RestApi/sitefinity/scheduling/scheduled-tasks HTTP/1.1 Host: www.asg.com.au Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"TotalCount":0}