Trendsic Platform Service

<back to all web services

AllTaskRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator
The following routes are available for this service:
GET,POST,PUT,OPTIONS/v1/AllTask
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class Task implements IConvertible
{
    String? TaskId;
    String? Description;
    DateTime? DueDate;
    int? AssignedToAgentId;
    int? RelatedToContactId;
    int? CreatedBy;
    DateTime? DateCreated;
    DateTime? DateCompleted;
    int? CompletedBy;
    DateTime? DateDeleted;
    int? DeletedBy;

    Task({this.TaskId,this.Description,this.DueDate,this.AssignedToAgentId,this.RelatedToContactId,this.CreatedBy,this.DateCreated,this.DateCompleted,this.CompletedBy,this.DateDeleted,this.DeletedBy});
    Task.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'];
        RelatedToContactId = json['RelatedToContactId'];
        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,
        'RelatedToContactId': RelatedToContactId,
        '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() => "Task";
    TypeContext? context = _ctx;
}

class TaskExtended extends Task implements IConvertible
{
    String? AssignedToName;
    String? RelatedToName;

    TaskExtended({this.AssignedToName,this.RelatedToName});
    TaskExtended.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() => "TaskExtended";
    TypeContext? context = _ctx;
}

class AllTaskResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<TaskExtended>? Task = [];

    AllTaskResponse({this.ResponseStatus,this.Task});
    AllTaskResponse.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<TaskExtended>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Task': JsonConverters.toJson(Task,'List<TaskExtended>',context!)
    };

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

class AllTaskRequest implements IConvertible
{
    AllTaskRequest();
    AllTaskRequest.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "AllTaskRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'Task': TypeInfo(TypeOf.Class, create:() => Task()),
    'TaskExtended': TypeInfo(TypeOf.Class, create:() => TaskExtended()),
    'AllTaskResponse': TypeInfo(TypeOf.Class, create:() => AllTaskResponse()),
    'List<TaskExtended>': TypeInfo(TypeOf.Class, create:() => <TaskExtended>[]),
    'AllTaskRequest': TypeInfo(TypeOf.Class, create:() => AllTaskRequest()),
});

Dart AllTaskRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/AllTask HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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-01T00:00:00.0000000","AssignedToAgentId":0,"RelatedToContactId":0,"CreatedBy":0,"DateCreated":"0001-01-01T00:00:00.0000000","DateCompleted":"0001-01-01T00:00:00.0000000","CompletedBy":0,"DateDeleted":"0001-01-01T00:00:00.0000000","DeletedBy":0}]}