import 'package:servicestack/servicestack.dart';
class GetArtifactUserDataResponse implements IConvertible
{
int? artifactId;
bool? liked;
List<int>? upVoted = [];
List<int>? downVoted = [];
GetArtifactUserDataResponse({this.artifactId,this.liked,this.upVoted,this.downVoted});
GetArtifactUserDataResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
artifactId = json['artifactId'];
liked = json['liked'];
upVoted = JsonConverters.fromJson(json['upVoted'],'List<int>',context!);
downVoted = JsonConverters.fromJson(json['downVoted'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'artifactId': artifactId,
'liked': liked,
'upVoted': JsonConverters.toJson(upVoted,'List<int>',context!),
'downVoted': JsonConverters.toJson(downVoted,'List<int>',context!)
};
getTypeName() => "GetArtifactUserDataResponse";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAuthenticated")
class GetArtifactUserData implements IGet, IConvertible
{
int? artifactId;
GetArtifactUserData({this.artifactId});
GetArtifactUserData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
artifactId = json['artifactId'];
return this;
}
Map<String, dynamic> toJson() => {
'artifactId': artifactId
};
getTypeName() => "GetArtifactUserData";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
'GetArtifactUserDataResponse': TypeInfo(TypeOf.Class, create:() => GetArtifactUserDataResponse()),
'GetArtifactUserData': TypeInfo(TypeOf.Class, create:() => GetArtifactUserData()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/GetArtifactUserData HTTP/1.1
Host: blazordiffusion.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
artifactId: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { artifactId: 0, liked: False, upVoted: [ 0 ], downVoted: [ 0 ] }