tvpl.api

<back to all web services

SubmitWorkflowDeleteRequest

Requires Authentication
The following routes are available for this service:
POST/workflow/{WorkflowId}/delete-request
import 'package:servicestack/servicestack.dart';

enum WorkflowDeleteRequestStatus
{
    Pending,
    Approved,
    Rejected,
    Cancelled,
}

class WorkflowDeleteRequestDetail implements IConvertible
{
    int? id;
    int? workflowId;
    int? requestedBy;
    String? requestedByName;
    int? approverId;
    String? approverName;
    WorkflowDeleteRequestStatus? status;
    String? reason;
    String? comment;
    DateTime? createdAt;
    DateTime? actionAt;

    WorkflowDeleteRequestDetail({this.id,this.workflowId,this.requestedBy,this.requestedByName,this.approverId,this.approverName,this.status,this.reason,this.comment,this.createdAt,this.actionAt});
    WorkflowDeleteRequestDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        workflowId = json['workflowId'];
        requestedBy = json['requestedBy'];
        requestedByName = json['requestedByName'];
        approverId = json['approverId'];
        approverName = json['approverName'];
        status = JsonConverters.fromJson(json['status'],'WorkflowDeleteRequestStatus',context!);
        reason = json['reason'];
        comment = json['comment'];
        createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
        actionAt = JsonConverters.fromJson(json['actionAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'workflowId': workflowId,
        'requestedBy': requestedBy,
        'requestedByName': requestedByName,
        'approverId': approverId,
        'approverName': approverName,
        'status': JsonConverters.toJson(status,'WorkflowDeleteRequestStatus',context!),
        'reason': reason,
        'comment': comment,
        'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
        'actionAt': JsonConverters.toJson(actionAt,'DateTime',context!)
    };

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

class WorkflowDeleteRequestResponse implements IConvertible
{
    int? code;
    String? message;
    bool? requiresApproval;
    WorkflowDeleteRequestDetail? request;

    WorkflowDeleteRequestResponse({this.code,this.message,this.requiresApproval,this.request});
    WorkflowDeleteRequestResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        message = json['message'];
        requiresApproval = json['requiresApproval'];
        request = JsonConverters.fromJson(json['request'],'WorkflowDeleteRequestDetail',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'message': message,
        'requiresApproval': requiresApproval,
        'request': JsonConverters.toJson(request,'WorkflowDeleteRequestDetail',context!)
    };

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

class SubmitWorkflowDeleteRequest implements IConvertible
{
    int? workflowId;
    String? reason;

    SubmitWorkflowDeleteRequest({this.workflowId,this.reason});
    SubmitWorkflowDeleteRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        workflowId = json['workflowId'];
        reason = json['reason'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'workflowId': workflowId,
        'reason': reason
    };

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

TypeContext _ctx = TypeContext(library: 'qlcn_api.vsmlab.vn', types: <String, TypeInfo> {
    'WorkflowDeleteRequestStatus': TypeInfo(TypeOf.Enum, enumValues:WorkflowDeleteRequestStatus.values),
    'WorkflowDeleteRequestDetail': TypeInfo(TypeOf.Class, create:() => WorkflowDeleteRequestDetail()),
    'WorkflowDeleteRequestResponse': TypeInfo(TypeOf.Class, create:() => WorkflowDeleteRequestResponse()),
    'SubmitWorkflowDeleteRequest': TypeInfo(TypeOf.Class, create:() => SubmitWorkflowDeleteRequest()),
});

Dart SubmitWorkflowDeleteRequest DTOs

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

HTTP + CSV

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

POST /workflow/{WorkflowId}/delete-request HTTP/1.1 
Host: qlcn-api.vsmlab.vn 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"workflowId":0,"reason":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"code":0,"message":"String","requiresApproval":false,"request":{"id":0,"workflowId":0,"requestedBy":0,"requestedByName":"String","approverId":0,"approverName":"String","status":"Pending","reason":"String","comment":"String","createdAt":"0001-01-01T00:00:00.0000000+07:06","actionAt":"0001-01-01T00:00:00.0000000+07:06"}}