PUT | /posts/{Id}/report |
---|
import 'package:servicestack/servicestack.dart';
class UserPostReportResponse implements IConvertible
{
ResponseStatus? responseStatus;
UserPostReportResponse({this.responseStatus});
UserPostReportResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "UserPostReportResponse";
TypeContext? context = _ctx;
}
enum FlagType
{
Violation,
Spam,
Abusive,
Confidential,
OffTopic,
Other,
}
class UserPostReport implements IPut, IConvertible
{
int? id;
FlagType? flagType;
String? reportNotes;
UserPostReport({this.id,this.flagType,this.reportNotes});
UserPostReport.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
flagType = JsonConverters.fromJson(json['flagType'],'FlagType',context!);
reportNotes = json['reportNotes'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'flagType': JsonConverters.toJson(flagType,'FlagType',context!),
'reportNotes': reportNotes
};
getTypeName() => "UserPostReport";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'techstacks.io', types: <String, TypeInfo> {
'UserPostReportResponse': TypeInfo(TypeOf.Class, create:() => UserPostReportResponse()),
'FlagType': TypeInfo(TypeOf.Enum, enumValues:FlagType.values),
'UserPostReport': TypeInfo(TypeOf.Class, create:() => UserPostReport()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /posts/{Id}/report HTTP/1.1
Host: techstacks.io
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"id":0,"flagType":"Violation","reportNotes":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}