| POST | /WorkflowStep/update |
|---|
import 'package:servicestack/servicestack.dart';
class WorkflowStep implements IConvertible
{
int? id;
// @References(typeof(Document))
int? workflowId;
int? stepOrder;
// @required()
// @StringLength(255)
String? stepName;
// @required()
bool? isRequired;
int? slaLegalValue;
bool? slaLegalIsByDay;
int? slaInternalValue;
bool? slaInternalIsByDay;
bool? requireAttachment;
// @required()
String? description;
int? createdBy;
// @ignore()
List<int>? departmentIds;
// @ignore()
List<int>? stepBasisDocumentIds;
// @ignore()
List<int>? stepAttachedIds;
// @ignore()
List<int>? mainAssigneeIds;
WorkflowStep({this.id,this.workflowId,this.stepOrder,this.stepName,this.isRequired,this.slaLegalValue,this.slaLegalIsByDay,this.slaInternalValue,this.slaInternalIsByDay,this.requireAttachment,this.description,this.createdBy,this.departmentIds,this.stepBasisDocumentIds,this.stepAttachedIds,this.mainAssigneeIds});
WorkflowStep.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
workflowId = json['workflowId'];
stepOrder = json['stepOrder'];
stepName = json['stepName'];
isRequired = json['isRequired'];
slaLegalValue = json['slaLegalValue'];
slaLegalIsByDay = json['slaLegalIsByDay'];
slaInternalValue = json['slaInternalValue'];
slaInternalIsByDay = json['slaInternalIsByDay'];
requireAttachment = json['requireAttachment'];
description = json['description'];
createdBy = json['createdBy'];
departmentIds = JsonConverters.fromJson(json['departmentIds'],'List<int>',context!);
stepBasisDocumentIds = JsonConverters.fromJson(json['stepBasisDocumentIds'],'List<int>',context!);
stepAttachedIds = JsonConverters.fromJson(json['stepAttachedIds'],'List<int>',context!);
mainAssigneeIds = JsonConverters.fromJson(json['mainAssigneeIds'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'workflowId': workflowId,
'stepOrder': stepOrder,
'stepName': stepName,
'isRequired': isRequired,
'slaLegalValue': slaLegalValue,
'slaLegalIsByDay': slaLegalIsByDay,
'slaInternalValue': slaInternalValue,
'slaInternalIsByDay': slaInternalIsByDay,
'requireAttachment': requireAttachment,
'description': description,
'createdBy': createdBy,
'departmentIds': JsonConverters.toJson(departmentIds,'List<int>',context!),
'stepBasisDocumentIds': JsonConverters.toJson(stepBasisDocumentIds,'List<int>',context!),
'stepAttachedIds': JsonConverters.toJson(stepAttachedIds,'List<int>',context!),
'mainAssigneeIds': JsonConverters.toJson(mainAssigneeIds,'List<int>',context!)
};
getTypeName() => "WorkflowStep";
TypeContext? context = _ctx;
}
class WorkflowStepResponse implements IResponseRequest, IConvertible
{
int? code;
String? message;
int? insertedId;
WorkflowStepResponse({this.code,this.message,this.insertedId});
WorkflowStepResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
insertedId = json['insertedId'];
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'insertedId': insertedId
};
getTypeName() => "WorkflowStepResponse";
TypeContext? context = _ctx;
}
class BasicUploadedFile implements IConvertible
{
String? fileName;
String? filekey;
String? fileUrl;
String? checksum;
String? eTag;
int? fileSize;
BasicUploadedFile({this.fileName,this.filekey,this.fileUrl,this.checksum,this.eTag,this.fileSize});
BasicUploadedFile.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
fileName = json['fileName'];
filekey = json['filekey'];
fileUrl = json['fileUrl'];
checksum = json['checksum'];
eTag = json['eTag'];
fileSize = json['fileSize'];
return this;
}
Map<String, dynamic> toJson() => {
'fileName': fileName,
'filekey': filekey,
'fileUrl': fileUrl,
'checksum': checksum,
'eTag': eTag,
'fileSize': fileSize
};
getTypeName() => "BasicUploadedFile";
TypeContext? context = _ctx;
}
class UploadedFiles extends BasicUploadedFile implements IConvertible
{
int? id;
String? uploadedFile;
int? subDocumentId;
int? stepId;
int? code;
UploadedFiles({this.id,this.uploadedFile,this.subDocumentId,this.stepId,this.code});
UploadedFiles.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
uploadedFile = json['uploadedFile'];
subDocumentId = json['subDocumentId'];
stepId = json['stepId'];
code = json['code'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id,
'uploadedFile': uploadedFile,
'subDocumentId': subDocumentId,
'stepId': stepId,
'code': code
});
getTypeName() => "UploadedFiles";
TypeContext? context = _ctx;
}
class CreateWorkflowStepRequest extends WorkflowStep implements IConvertible
{
List<UploadedFiles>? stepAttachFiles;
CreateWorkflowStepRequest({this.stepAttachFiles});
CreateWorkflowStepRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
stepAttachFiles = JsonConverters.fromJson(json['stepAttachFiles'],'List<UploadedFiles>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'stepAttachFiles': JsonConverters.toJson(stepAttachFiles,'List<UploadedFiles>',context!)
});
getTypeName() => "CreateWorkflowStepRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'WorkflowStep': TypeInfo(TypeOf.Class, create:() => WorkflowStep()),
'WorkflowStepResponse': TypeInfo(TypeOf.Class, create:() => WorkflowStepResponse()),
'BasicUploadedFile': TypeInfo(TypeOf.Class, create:() => BasicUploadedFile()),
'UploadedFiles': TypeInfo(TypeOf.Class, create:() => UploadedFiles()),
'CreateWorkflowStepRequest': TypeInfo(TypeOf.Class, create:() => CreateWorkflowStepRequest()),
'List<UploadedFiles>': TypeInfo(TypeOf.Class, create:() => <UploadedFiles>[]),
});
Dart CreateWorkflowStepRequest DTOs
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 /WorkflowStep/update HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateWorkflowStepRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
<CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
<CreatedBy xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</CreatedBy>
<DeletedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</DeletedAt>
<DeletedBy xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</DeletedBy>
<DepartmentIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
<d2p1:int>0</d2p1:int>
</DepartmentIds>
<Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
<Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
<IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
<MainAssigneeIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
<d2p1:int>0</d2p1:int>
</MainAssigneeIds>
<RequireAttachment xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</RequireAttachment>
<SLAInternalIsByDay xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</SLAInternalIsByDay>
<SLAInternalValue xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</SLAInternalValue>
<SLALegalIsByDay xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</SLALegalIsByDay>
<SLALegalValue xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</SLALegalValue>
<SLAWarningSentAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</SLAWarningSentAt>
<SLAWarningSentCount xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</SLAWarningSentCount>
<StepAttachedIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
<d2p1:int>0</d2p1:int>
</StepAttachedIds>
<StepBasisDocumentIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
<d2p1:int>0</d2p1:int>
</StepBasisDocumentIds>
<StepName xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</StepName>
<StepOrder xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</StepOrder>
<UpdatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</UpdatedAt>
<UpdatedBy xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</UpdatedBy>
<WorkflowId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</WorkflowId>
<StepAttachFiles>
<UploadedFiles>
<Checksum xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Checksum>
<ETag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ETag>
<FileName xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</FileName>
<FileSize xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</FileSize>
<FileUrl xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</FileUrl>
<Filekey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Filekey>
<Code>0</Code>
<Id>0</Id>
<StepId>0</StepId>
<SubDocumentId>0</SubDocumentId>
<UploadedFile>String</UploadedFile>
</UploadedFiles>
</StepAttachFiles>
</CreateWorkflowStepRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <WorkflowStepResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel"> <Code>0</Code> <InsertedId>0</InsertedId> <Message>String</Message> </WorkflowStepResponse>