PUT | /posts/{PostId}/comments/{Id}/pin |
---|
import 'package:servicestack/servicestack.dart';
class PinPostCommentResponse implements IConvertible
{
ResponseStatus? responseStatus;
PinPostCommentResponse({this.responseStatus});
PinPostCommentResponse.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() => "PinPostCommentResponse";
TypeContext? context = _ctx;
}
class PinPostComment implements IPut, IConvertible
{
int? id;
int? postId;
bool? pin;
PinPostComment({this.id,this.postId,this.pin});
PinPostComment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
postId = json['postId'];
pin = json['pin'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'postId': postId,
'pin': pin
};
getTypeName() => "PinPostComment";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'techstacks.io', types: <String, TypeInfo> {
'PinPostCommentResponse': TypeInfo(TypeOf.Class, create:() => PinPostCommentResponse()),
'PinPostComment': TypeInfo(TypeOf.Class, create:() => PinPostComment()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /posts/{PostId}/comments/{Id}/pin HTTP/1.1
Host: techstacks.io
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"id":0,"postId":0,"pin":false}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}