POST | /RestApi/reviews-api |
---|
import 'package:servicestack/servicestack.dart';
class GroupCreateRequest implements IConvertible
{
String? Key;
String? Name;
String? Description;
GroupCreateRequest({this.Key,this.Name,this.Description});
GroupCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Name = json['Name'];
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Name': Name,
'Description': Description
};
getTypeName() => "GroupCreateRequest";
TypeContext? context = _ctx;
}
class ThreadCreateRequest implements IConvertible
{
String? Key;
String? Type;
String? Behavior;
String? Title;
String? Language;
String? DataSource;
String? GroupKey;
GroupCreateRequest? Group;
ThreadCreateRequest({this.Key,this.Type,this.Behavior,this.Title,this.Language,this.DataSource,this.GroupKey,this.Group});
ThreadCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Type = json['Type'];
Behavior = json['Behavior'];
Title = json['Title'];
Language = json['Language'];
DataSource = json['DataSource'];
GroupKey = json['GroupKey'];
Group = JsonConverters.fromJson(json['Group'],'GroupCreateRequest',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Type': Type,
'Behavior': Behavior,
'Title': Title,
'Language': Language,
'DataSource': DataSource,
'GroupKey': GroupKey,
'Group': JsonConverters.toJson(Group,'GroupCreateRequest',context!)
};
getTypeName() => "ThreadCreateRequest";
TypeContext? context = _ctx;
}
class CaptchaInfo implements IConvertible
{
String? Answer;
String? CorrectAnswer;
String? InitializationVector;
String? Key;
CaptchaInfo({this.Answer,this.CorrectAnswer,this.InitializationVector,this.Key});
CaptchaInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Answer = json['Answer'];
CorrectAnswer = json['CorrectAnswer'];
InitializationVector = json['InitializationVector'];
Key = json['Key'];
return this;
}
Map<String, dynamic> toJson() => {
'Answer': Answer,
'CorrectAnswer': CorrectAnswer,
'InitializationVector': InitializationVector,
'Key': Key
};
getTypeName() => "CaptchaInfo";
TypeContext? context = _ctx;
}
class ReviewCreateRequest implements IConvertible
{
String? Message;
String? Name;
String? Email;
String? CustomData;
String? ThreadKey;
ThreadCreateRequest? Thread;
CaptchaInfo? Captcha;
double? Rating;
ReviewCreateRequest({this.Message,this.Name,this.Email,this.CustomData,this.ThreadKey,this.Thread,this.Captcha,this.Rating});
ReviewCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Message = json['Message'];
Name = json['Name'];
Email = json['Email'];
CustomData = json['CustomData'];
ThreadKey = json['ThreadKey'];
Thread = JsonConverters.fromJson(json['Thread'],'ThreadCreateRequest',context!);
Captcha = JsonConverters.fromJson(json['Captcha'],'CaptchaInfo',context!);
Rating = JsonConverters.toDouble(json['Rating']);
return this;
}
Map<String, dynamic> toJson() => {
'Message': Message,
'Name': Name,
'Email': Email,
'CustomData': CustomData,
'ThreadKey': ThreadKey,
'Thread': JsonConverters.toJson(Thread,'ThreadCreateRequest',context!),
'Captcha': JsonConverters.toJson(Captcha,'CaptchaInfo',context!),
'Rating': Rating
};
getTypeName() => "ReviewCreateRequest";
TypeContext? context = _ctx;
}
class ReviewViewModel implements IConvertible
{
String? Key;
String? Name;
String? Message;
DateTime? DateCreated;
String? ProfilePictureUrl;
String? ProfilePictureThumbnailUrl;
String? Status;
String? Email;
String? ThreadKey;
String? AuthorIpAddress;
String? CustomData;
double? Rating;
ReviewViewModel({this.Key,this.Name,this.Message,this.DateCreated,this.ProfilePictureUrl,this.ProfilePictureThumbnailUrl,this.Status,this.Email,this.ThreadKey,this.AuthorIpAddress,this.CustomData,this.Rating});
ReviewViewModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Name = json['Name'];
Message = json['Message'];
DateCreated = JsonConverters.fromJson(json['DateCreated'],'DateTime',context!);
ProfilePictureUrl = json['ProfilePictureUrl'];
ProfilePictureThumbnailUrl = json['ProfilePictureThumbnailUrl'];
Status = json['Status'];
Email = json['Email'];
ThreadKey = json['ThreadKey'];
AuthorIpAddress = json['AuthorIpAddress'];
CustomData = json['CustomData'];
Rating = JsonConverters.toDouble(json['Rating']);
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Name': Name,
'Message': Message,
'DateCreated': JsonConverters.toJson(DateCreated,'DateTime',context!),
'ProfilePictureUrl': ProfilePictureUrl,
'ProfilePictureThumbnailUrl': ProfilePictureThumbnailUrl,
'Status': Status,
'Email': Email,
'ThreadKey': ThreadKey,
'AuthorIpAddress': AuthorIpAddress,
'CustomData': CustomData,
'Rating': Rating
};
getTypeName() => "ReviewViewModel";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
'GroupCreateRequest': TypeInfo(TypeOf.Class, create:() => GroupCreateRequest()),
'ThreadCreateRequest': TypeInfo(TypeOf.Class, create:() => ThreadCreateRequest()),
'CaptchaInfo': TypeInfo(TypeOf.Class, create:() => CaptchaInfo()),
'ReviewCreateRequest': TypeInfo(TypeOf.Class, create:() => ReviewCreateRequest()),
'ReviewViewModel': TypeInfo(TypeOf.Class, create:() => ReviewViewModel()),
});
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 /RestApi/reviews-api HTTP/1.1
Host: www.asg.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Message":"String","Name":"String","Email":"String","CustomData":"String","ThreadKey":"String","Thread":{"Key":"String","Type":"String","Behavior":"String","Title":"String","Language":"String","DataSource":"String","GroupKey":"String","Group":{"Key":"String","Name":"String","Description":"String"}},"Captcha":{"Answer":"String","CorrectAnswer":"String","InitializationVector":"String","Key":"String"},"Rating":0}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Key":"String","Name":"String","Message":"String","DateCreated":"\/Date(-62135596800000-0000)\/","ProfilePictureUrl":"String","ProfilePictureThumbnailUrl":"String","Status":"String","Email":"String","ThreadKey":"String","AuthorIpAddress":"String","CustomData":"String","Rating":0}