| Requires any of the roles: | Worker, Agent, Administrator |
| GET,POST,PUT,OPTIONS | /v1/AllAgentTask |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class AgentTask implements IConvertible
{
String? TaskId;
String? Description;
DateTime? DueDate;
int? AssignedToAgentId;
int? RelatedToAgentId;
int? CreatedBy;
DateTime? DateCreated;
DateTime? DateCompleted;
int? CompletedBy;
DateTime? DateDeleted;
int? DeletedBy;
AgentTask({this.TaskId,this.Description,this.DueDate,this.AssignedToAgentId,this.RelatedToAgentId,this.CreatedBy,this.DateCreated,this.DateCompleted,this.CompletedBy,this.DateDeleted,this.DeletedBy});
AgentTask.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TaskId = json['TaskId'];
Description = json['Description'];
DueDate = JsonConverters.fromJson(json['DueDate'],'DateTime',context!);
AssignedToAgentId = json['AssignedToAgentId'];
RelatedToAgentId = json['RelatedToAgentId'];
CreatedBy = json['CreatedBy'];
DateCreated = JsonConverters.fromJson(json['DateCreated'],'DateTime',context!);
DateCompleted = JsonConverters.fromJson(json['DateCompleted'],'DateTime',context!);
CompletedBy = json['CompletedBy'];
DateDeleted = JsonConverters.fromJson(json['DateDeleted'],'DateTime',context!);
DeletedBy = json['DeletedBy'];
return this;
}
Map<String, dynamic> toJson() => {
'TaskId': TaskId,
'Description': Description,
'DueDate': JsonConverters.toJson(DueDate,'DateTime',context!),
'AssignedToAgentId': AssignedToAgentId,
'RelatedToAgentId': RelatedToAgentId,
'CreatedBy': CreatedBy,
'DateCreated': JsonConverters.toJson(DateCreated,'DateTime',context!),
'DateCompleted': JsonConverters.toJson(DateCompleted,'DateTime',context!),
'CompletedBy': CompletedBy,
'DateDeleted': JsonConverters.toJson(DateDeleted,'DateTime',context!),
'DeletedBy': DeletedBy
};
getTypeName() => "AgentTask";
TypeContext? context = _ctx;
}
class AgentTaskExtended extends AgentTask implements IConvertible
{
String? AssignedToName;
String? RelatedToName;
AgentTaskExtended({this.AssignedToName,this.RelatedToName});
AgentTaskExtended.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
AssignedToName = json['AssignedToName'];
RelatedToName = json['RelatedToName'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'AssignedToName': AssignedToName,
'RelatedToName': RelatedToName
});
getTypeName() => "AgentTaskExtended";
TypeContext? context = _ctx;
}
class AllAgentTaskResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<AgentTaskExtended>? Task = [];
AllAgentTaskResponse({this.ResponseStatus,this.Task});
AllAgentTaskResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Task = JsonConverters.fromJson(json['Task'],'List<AgentTaskExtended>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Task': JsonConverters.toJson(Task,'List<AgentTaskExtended>',context!)
};
getTypeName() => "AllAgentTaskResponse";
TypeContext? context = _ctx;
}
class AllAgentTaskRequest implements IConvertible
{
AllAgentTaskRequest();
AllAgentTaskRequest.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "AllAgentTaskRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'AgentTask': TypeInfo(TypeOf.Class, create:() => AgentTask()),
'AgentTaskExtended': TypeInfo(TypeOf.Class, create:() => AgentTaskExtended()),
'AllAgentTaskResponse': TypeInfo(TypeOf.Class, create:() => AllAgentTaskResponse()),
'List<AgentTaskExtended>': TypeInfo(TypeOf.Class, create:() => <AgentTaskExtended>[]),
'AllAgentTaskRequest': TypeInfo(TypeOf.Class, create:() => AllAgentTaskRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/AllAgentTask HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Task:
[
{
AssignedToName: String,
RelatedToName: String,
TaskId: 00000000000000000000000000000000,
Description: String,
DueDate: 0001-01-01,
AssignedToAgentId: 0,
RelatedToAgentId: 0,
CreatedBy: 0,
DateCreated: 0001-01-01,
DateCompleted: 0001-01-01,
CompletedBy: 0,
DateDeleted: 0001-01-01,
DeletedBy: 0
}
]
}