| GET | /document-permission/Pending-Access-Requests |
|---|
import 'package:servicestack/servicestack.dart';
class PagingRequest implements IConvertible
{
int? page;
int? limit;
PagingRequest({this.page,this.limit});
PagingRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
page = json['page'];
limit = json['limit'];
return this;
}
Map<String, dynamic> toJson() => {
'page': page,
'limit': limit
};
getTypeName() => "PagingRequest";
TypeContext? context = _ctx;
}
enum DocumentAccessPermissions
{
Read,
Write,
GrantRead,
}
enum DocumentApprovalStatus
{
Pending,
Approved,
Rejected,
}
class DocumentAccessRequest implements IConvertible
{
int? id;
int? documentId;
int? requestedBy;
DocumentAccessPermissions? requestPermission;
DocumentApprovalStatus? status;
DateTime? createdDate;
int? approvedBy;
DateTime? approvedDate;
String? note;
String? comment;
DateTime? dueDate;
DocumentAccessRequest({this.id,this.documentId,this.requestedBy,this.requestPermission,this.status,this.createdDate,this.approvedBy,this.approvedDate,this.note,this.comment,this.dueDate});
DocumentAccessRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
documentId = json['documentId'];
requestedBy = json['requestedBy'];
requestPermission = JsonConverters.fromJson(json['requestPermission'],'DocumentAccessPermissions',context!);
status = JsonConverters.fromJson(json['status'],'DocumentApprovalStatus',context!);
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
approvedBy = json['approvedBy'];
approvedDate = JsonConverters.fromJson(json['approvedDate'],'DateTime',context!);
note = json['note'];
comment = json['comment'];
dueDate = JsonConverters.fromJson(json['dueDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'documentId': documentId,
'requestedBy': requestedBy,
'requestPermission': JsonConverters.toJson(requestPermission,'DocumentAccessPermissions',context!),
'status': JsonConverters.toJson(status,'DocumentApprovalStatus',context!),
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'approvedBy': approvedBy,
'approvedDate': JsonConverters.toJson(approvedDate,'DateTime',context!),
'note': note,
'comment': comment,
'dueDate': JsonConverters.toJson(dueDate,'DateTime',context!)
};
getTypeName() => "DocumentAccessRequest";
TypeContext? context = _ctx;
}
class DocumentAccessRequestView extends DocumentAccessRequest implements IConvertible
{
String? approvedByName;
String? requestedName;
String? documentTitle;
DocumentAccessRequestView({this.approvedByName,this.requestedName,this.documentTitle});
DocumentAccessRequestView.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
approvedByName = json['approvedByName'];
requestedName = json['requestedName'];
documentTitle = json['documentTitle'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'approvedByName': approvedByName,
'requestedName': requestedName,
'documentTitle': documentTitle
});
getTypeName() => "DocumentAccessRequestView";
TypeContext? context = _ctx;
}
class PendingAccessResponse implements IConvertible
{
int? total;
int? code;
String? message;
List<DocumentAccessRequestView>? requests;
PendingAccessResponse({this.total,this.code,this.message,this.requests});
PendingAccessResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
total = json['total'];
code = json['code'];
message = json['message'];
requests = JsonConverters.fromJson(json['requests'],'List<DocumentAccessRequestView>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'total': total,
'code': code,
'message': message,
'requests': JsonConverters.toJson(requests,'List<DocumentAccessRequestView>',context!)
};
getTypeName() => "PendingAccessResponse";
TypeContext? context = _ctx;
}
class PendingAccessRequests extends PagingRequest implements IConvertible
{
DocumentApprovalStatus? status;
PendingAccessRequests({this.status});
PendingAccessRequests.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
status = JsonConverters.fromJson(json['status'],'DocumentApprovalStatus',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'status': JsonConverters.toJson(status,'DocumentApprovalStatus',context!)
});
getTypeName() => "PendingAccessRequests";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
'DocumentAccessPermissions': TypeInfo(TypeOf.Enum, enumValues:DocumentAccessPermissions.values),
'DocumentApprovalStatus': TypeInfo(TypeOf.Enum, enumValues:DocumentApprovalStatus.values),
'DocumentAccessRequest': TypeInfo(TypeOf.Class, create:() => DocumentAccessRequest()),
'DocumentAccessRequestView': TypeInfo(TypeOf.Class, create:() => DocumentAccessRequestView()),
'PendingAccessResponse': TypeInfo(TypeOf.Class, create:() => PendingAccessResponse()),
'List<DocumentAccessRequestView>': TypeInfo(TypeOf.Class, create:() => <DocumentAccessRequestView>[]),
'PendingAccessRequests': TypeInfo(TypeOf.Class, create:() => PendingAccessRequests()),
});
Dart PendingAccessRequests DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /document-permission/Pending-Access-Requests HTTP/1.1 Host: etc-api.vsmlab.vn Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"total":0,"code":0,"message":"String","requests":[{"approvedByName":"String","requestedName":"String","documentTitle":"String","id":0,"documentId":0,"requestedBy":0,"requestPermission":"Read","status":"Pending","createdDate":"0001-01-01T00:00:00.0000000+07:06","approvedBy":0,"approvedDate":"0001-01-01T00:00:00.0000000+07:06","note":"String","comment":"String","dueDate":"0001-01-01T00:00:00.0000000+07:06"}]}