Required role: | Admin |
import 'package:servicestack/servicestack.dart';
// @DataContract
abstract class AuditBase
{
// @DataMember(Order=1)
DateTime? createdDate;
// @DataMember(Order=2)
// @required()
String? createdBy;
// @DataMember(Order=3)
DateTime? modifiedDate;
// @DataMember(Order=4)
// @required()
String? modifiedBy;
// @DataMember(Order=5)
DateTime? deletedDate;
// @DataMember(Order=6)
String? deletedBy;
AuditBase({this.createdDate,this.createdBy,this.modifiedDate,this.modifiedBy,this.deletedDate,this.deletedBy});
AuditBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
createdBy = json['createdBy'];
modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
modifiedBy = json['modifiedBy'];
deletedDate = JsonConverters.fromJson(json['deletedDate'],'DateTime',context!);
deletedBy = json['deletedBy'];
return this;
}
Map<String, dynamic> toJson() => {
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'createdBy': createdBy,
'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!),
'modifiedBy': modifiedBy,
'deletedDate': JsonConverters.toJson(deletedDate,'DateTime',context!),
'deletedBy': deletedBy
};
getTypeName() => "AuditBase";
TypeContext? context = _ctx;
}
class ArtifactComment extends AuditBase implements IConvertible
{
int? id;
int? artifactId;
int? replyId;
String? content;
int? upVotes;
int? downVotes;
int? votes;
String? flagReason;
String? notes;
String? refId;
int? appUserId;
ArtifactComment({this.id,this.artifactId,this.replyId,this.content,this.upVotes,this.downVotes,this.votes,this.flagReason,this.notes,this.refId,this.appUserId});
ArtifactComment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
artifactId = json['artifactId'];
replyId = json['replyId'];
content = json['content'];
upVotes = json['upVotes'];
downVotes = json['downVotes'];
votes = json['votes'];
flagReason = json['flagReason'];
notes = json['notes'];
refId = json['refId'];
appUserId = json['appUserId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id,
'artifactId': artifactId,
'replyId': replyId,
'content': content,
'upVotes': upVotes,
'downVotes': downVotes,
'votes': votes,
'flagReason': flagReason,
'notes': notes,
'refId': refId,
'appUserId': appUserId
});
getTypeName() => "ArtifactComment";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAdmin")
class AdminUpdateArtifactComment implements IPatchDb<ArtifactComment>, IConvertible
{
int? id;
int? replyId;
// @Validate(Validator="Length(1,280)")
String? content;
String? notes;
String? flagReason;
AdminUpdateArtifactComment({this.id,this.replyId,this.content,this.notes,this.flagReason});
AdminUpdateArtifactComment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
replyId = json['replyId'];
content = json['content'];
notes = json['notes'];
flagReason = json['flagReason'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'replyId': replyId,
'content': content,
'notes': notes,
'flagReason': flagReason
};
getTypeName() => "AdminUpdateArtifactComment";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
'ArtifactComment': TypeInfo(TypeOf.Class, create:() => ArtifactComment()),
'AdminUpdateArtifactComment': TypeInfo(TypeOf.Class, create:() => AdminUpdateArtifactComment()),
});
Dart AdminUpdateArtifactComment 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.
POST /json/reply/AdminUpdateArtifactComment HTTP/1.1
Host: blazordiffusion.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":0,"replyId":0,"content":"String","notes":"String","flagReason":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"id":0,"artifactId":0,"replyId":0,"content":"String","upVotes":0,"downVotes":0,"votes":0,"flagReason":"String","notes":"String","refId":"String","appUserId":0,"createdDate":"0001-01-01T00:00:00","createdBy":"String","modifiedDate":"0001-01-01T00:00:00","modifiedBy":"String","deletedDate":"0001-01-01T00:00:00","deletedBy":"String"}