PUT | /rating/ | Update RatingScore | Update rating from booking |
---|
import 'package:servicestack/servicestack.dart';
class RatingReviewResponse implements IConvertible
{
/**
* The title for the review
*/
// @ApiMember(Description="The title for the review")
String? Title;
/**
* The description for the review
*/
// @ApiMember(Description="The description for the review")
String? Description;
/**
* The rating score
*/
// @ApiMember(Description="The rating score")
int? RatingScore;
/**
* The review author
*/
// @ApiMember(Description="The review author")
String? Author;
/**
* The created date
*/
// @ApiMember(Description="The created date")
DateTime? Created;
/**
* The review answer from the company
*/
// @ApiMember(Description="The review answer from the company")
String? ReviewAnswer;
RatingReviewResponse({this.Title,this.Description,this.RatingScore,this.Author,this.Created,this.ReviewAnswer});
RatingReviewResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Title = json['Title'];
Description = json['Description'];
RatingScore = json['RatingScore'];
Author = json['Author'];
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
ReviewAnswer = json['ReviewAnswer'];
return this;
}
Map<String, dynamic> toJson() => {
'Title': Title,
'Description': Description,
'RatingScore': RatingScore,
'Author': Author,
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'ReviewAnswer': ReviewAnswer
};
getTypeName() => "RatingReviewResponse";
TypeContext? context = _ctx;
}
class CompanyRatingResponse implements IConvertible
{
/**
*
*/
// @ApiMember(Description="")
String? CompanyId;
/**
* Id of the booking
*/
// @ApiMember(Description="Id of the booking")
int? BookingId;
/**
* The status of the rating, 1 = Active
*/
// @ApiMember(Description="The status of the rating, 1 = Active")
int? Status;
/**
* The rating score
*/
// @ApiMember(Description="The rating score")
int? RatingScore;
/**
* The review if any exists to the rating
*/
// @ApiMember(Description="The review if any exists to the rating")
RatingReviewResponse? Review;
DateTime? CreatedDate;
DateTime? UpdatedDate;
CompanyRatingResponse({this.CompanyId,this.BookingId,this.Status,this.RatingScore,this.Review,this.CreatedDate,this.UpdatedDate});
CompanyRatingResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
BookingId = json['BookingId'];
Status = json['Status'];
RatingScore = json['RatingScore'];
Review = JsonConverters.fromJson(json['Review'],'RatingReviewResponse',context!);
CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'BookingId': BookingId,
'Status': Status,
'RatingScore': RatingScore,
'Review': JsonConverters.toJson(Review,'RatingReviewResponse',context!),
'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!)
};
getTypeName() => "CompanyRatingResponse";
TypeContext? context = _ctx;
}
class UpdateReview implements IConvertible
{
/**
* The title for the review
*/
// @ApiMember(Description="The title for the review")
String? Title;
/**
* The description for the review
*/
// @ApiMember(Description="The description for the review")
String? Description;
/**
* The review author
*/
// @ApiMember(Description="The review author")
String? Author;
/**
* The review answer from the company. Only the company can respond to this
*/
// @ApiMember(Description="The review answer from the company. Only the company can respond to this")
String? ReviewAnswer;
UpdateReview({this.Title,this.Description,this.Author,this.ReviewAnswer});
UpdateReview.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Title = json['Title'];
Description = json['Description'];
Author = json['Author'];
ReviewAnswer = json['ReviewAnswer'];
return this;
}
Map<String, dynamic> toJson() => {
'Title': Title,
'Description': Description,
'Author': Author,
'ReviewAnswer': ReviewAnswer
};
getTypeName() => "UpdateReview";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class UpdateRating implements IConvertible
{
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? CompanyId;
/**
* Id of the booking
*/
// @ApiMember(Description="Id of the booking", IsRequired=true)
int? BookingId;
/**
* The identifier for the booking, use to verify the booking. Only needed when a customer, not admin
*/
// @ApiMember(Description="The identifier for the booking, use to verify the booking. Only needed when a customer, not admin")
String? Identifier;
/**
* The rating score between 1 and 5.
*/
// @ApiMember(Description="The rating score between 1 and 5.")
int? RatingScore;
/**
* The review for the rating
*/
// @ApiMember(Description="The review for the rating")
UpdateReview? Review;
UpdateRating({this.CompanyId,this.BookingId,this.Identifier,this.RatingScore,this.Review});
UpdateRating.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
BookingId = json['BookingId'];
Identifier = json['Identifier'];
RatingScore = json['RatingScore'];
Review = JsonConverters.fromJson(json['Review'],'UpdateReview',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'BookingId': BookingId,
'Identifier': Identifier,
'RatingScore': RatingScore,
'Review': JsonConverters.toJson(Review,'UpdateReview',context!)
};
getTypeName() => "UpdateRating";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'RatingReviewResponse': TypeInfo(TypeOf.Class, create:() => RatingReviewResponse()),
'CompanyRatingResponse': TypeInfo(TypeOf.Class, create:() => CompanyRatingResponse()),
'UpdateReview': TypeInfo(TypeOf.Class, create:() => UpdateReview()),
'UpdateRating': TypeInfo(TypeOf.Class, create:() => UpdateRating()),
});
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 /rating/ HTTP/1.1
Host: api.bokamera.se
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","BookingId":0,"Identifier":"String","RatingScore":0,"Review":{"Title":"String","Description":"String","Author":"String","ReviewAnswer":"String"}}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"BookingId":0,"Status":0,"RatingScore":0,"Review":{"Title":"String","Description":"String","RatingScore":0,"Author":"String","ReviewAnswer":"String"}}