Required role: | Admin |
import 'package:servicestack/servicestack.dart';
enum PostReport
{
Offensive,
Spam,
Nudity,
Illegal,
Other,
}
class ArtifactCommentReport implements IConvertible
{
int? id;
// @References(typeof(ArtifactComment))
int? artifactCommentId;
int? appUserId;
PostReport? postReport;
String? description;
DateTime? createdDate;
ArtifactCommentReport({this.id,this.artifactCommentId,this.appUserId,this.postReport,this.description,this.createdDate});
ArtifactCommentReport.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
artifactCommentId = json['artifactCommentId'];
appUserId = json['appUserId'];
postReport = JsonConverters.fromJson(json['postReport'],'PostReport',context!);
description = json['description'];
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'artifactCommentId': artifactCommentId,
'appUserId': appUserId,
'postReport': JsonConverters.toJson(postReport,'PostReport',context!),
'description': description,
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!)
};
getTypeName() => "ArtifactCommentReport";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAdmin")
class AdminUpdateArtifactCommentReport implements IPatchDb<ArtifactCommentReport>, IConvertible
{
int? id;
PostReport? postReport;
String? description;
AdminUpdateArtifactCommentReport({this.id,this.postReport,this.description});
AdminUpdateArtifactCommentReport.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
postReport = JsonConverters.fromJson(json['postReport'],'PostReport',context!);
description = json['description'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'postReport': JsonConverters.toJson(postReport,'PostReport',context!),
'description': description
};
getTypeName() => "AdminUpdateArtifactCommentReport";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
'PostReport': TypeInfo(TypeOf.Enum, enumValues:PostReport.values),
'ArtifactCommentReport': TypeInfo(TypeOf.Class, create:() => ArtifactCommentReport()),
'AdminUpdateArtifactCommentReport': TypeInfo(TypeOf.Class, create:() => AdminUpdateArtifactCommentReport()),
});
Dart AdminUpdateArtifactCommentReport 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/AdminUpdateArtifactCommentReport HTTP/1.1
Host: blazordiffusion.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":0,"postReport":"Offensive","description":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"id":0,"artifactCommentId":0,"appUserId":0,"postReport":"Offensive","description":"String","createdDate":"0001-01-01T00:00:00"}