PUT | /RestApi/comments-api/threads |
---|
import 'package:servicestack/servicestack.dart';
class ThreadUpdateRequest implements IConvertible
{
String? Key;
bool? IsClosed;
ThreadUpdateRequest({this.Key,this.IsClosed});
ThreadUpdateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
IsClosed = json['IsClosed'];
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'IsClosed': IsClosed
};
getTypeName() => "ThreadUpdateRequest";
TypeContext? context = _ctx;
}
class ThreadResponse implements IConvertible
{
String? Key;
String? Type;
int? CommentsCount;
String? Title;
String? Language;
bool? IsClosed;
String? GroupKey;
String? ItemUrl;
String? DataSource;
double? AverageRating;
ThreadResponse({this.Key,this.Type,this.CommentsCount,this.Title,this.Language,this.IsClosed,this.GroupKey,this.ItemUrl,this.DataSource,this.AverageRating});
ThreadResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Type = json['Type'];
CommentsCount = json['CommentsCount'];
Title = json['Title'];
Language = json['Language'];
IsClosed = json['IsClosed'];
GroupKey = json['GroupKey'];
ItemUrl = json['ItemUrl'];
DataSource = json['DataSource'];
AverageRating = JsonConverters.toDouble(json['AverageRating']);
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Type': Type,
'CommentsCount': CommentsCount,
'Title': Title,
'Language': Language,
'IsClosed': IsClosed,
'GroupKey': GroupKey,
'ItemUrl': ItemUrl,
'DataSource': DataSource,
'AverageRating': AverageRating
};
getTypeName() => "ThreadResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
'ThreadUpdateRequest': TypeInfo(TypeOf.Class, create:() => ThreadUpdateRequest()),
'ThreadResponse': TypeInfo(TypeOf.Class, create:() => ThreadResponse()),
});
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.
PUT /RestApi/comments-api/threads HTTP/1.1
Host: www.asg.com.au
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Key: String,
IsClosed: False
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Key: String, Type: String, CommentsCount: 0, Title: String, Language: String, IsClosed: False, GroupKey: String, ItemUrl: String, DataSource: String, AverageRating: 0 }