BokaMera.API.Host

<back to all web services

AddRating

The following routes are available for this service:
POST/rating/Create RatingScoreCreate rating from booking
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    public static class AddRating
    {
        /**
        * 
        */
        @ApiMember(Description="", IsRequired=true)
        public UUID CompanyId = null;

        /**
        * Id of the booking
        */
        @ApiMember(Description="Id of the booking", IsRequired=true)
        public Integer BookingId = null;

        /**
        * The identifier for the booking, use to verify the booking.
        */
        @ApiMember(Description="The identifier for the booking, use to verify the booking.", IsRequired=true)
        public String Identifier = null;

        /**
        * The rating score between 1 and 5.
        */
        @ApiMember(Description="The rating score between 1 and 5.", IsRequired=true)
        public Integer RatingScore = null;

        /**
        * The review for the rating
        */
        @ApiMember(Description="The review for the rating")
        public CreateReview Review = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public AddRating setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getBookingId() { return BookingId; }
        public AddRating setBookingId(Integer value) { this.BookingId = value; return this; }
        public String getIdentifier() { return Identifier; }
        public AddRating setIdentifier(String value) { this.Identifier = value; return this; }
        public Integer getRatingScore() { return RatingScore; }
        public AddRating setRatingScore(Integer value) { this.RatingScore = value; return this; }
        public CreateReview getReview() { return Review; }
        public AddRating setReview(CreateReview value) { this.Review = value; return this; }
    }

    public static class CreateReview
    {
        /**
        * The title for the review
        */
        @ApiMember(Description="The title for the review")
        public String Title = null;

        /**
        * The description for the review
        */
        @ApiMember(Description="The description for the review")
        public String Description = null;

        /**
        * The review author
        */
        @ApiMember(Description="The review author")
        public String Author = null;

        /**
        * The review author
        */
        @ApiMember(Description="The review author")
        public String ReviewAnswer = null;
        
        public String getTitle() { return Title; }
        public CreateReview setTitle(String value) { this.Title = value; return this; }
        public String getDescription() { return Description; }
        public CreateReview setDescription(String value) { this.Description = value; return this; }
        public String getAuthor() { return Author; }
        public CreateReview setAuthor(String value) { this.Author = value; return this; }
        public String getReviewAnswer() { return ReviewAnswer; }
        public CreateReview setReviewAnswer(String value) { this.ReviewAnswer = value; return this; }
    }

    public static class CompanyRatingResponse
    {
        /**
        * 
        */
        @ApiMember(Description="")
        public UUID CompanyId = null;

        /**
        * Id of the booking
        */
        @ApiMember(Description="Id of the booking")
        public Integer BookingId = null;

        /**
        * The status of the rating, 1 = Active
        */
        @ApiMember(Description="The status of the rating, 1 = Active")
        public Integer Status = null;

        /**
        * The rating score
        */
        @ApiMember(Description="The rating score")
        public Integer RatingScore = null;

        /**
        * The review if any exists to the rating
        */
        @ApiMember(Description="The review if any exists to the rating")
        public RatingReviewResponse Review = null;

        public Date CreatedDate = null;
        public Date UpdatedDate = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public CompanyRatingResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getBookingId() { return BookingId; }
        public CompanyRatingResponse setBookingId(Integer value) { this.BookingId = value; return this; }
        public Integer getStatus() { return Status; }
        public CompanyRatingResponse setStatus(Integer value) { this.Status = value; return this; }
        public Integer getRatingScore() { return RatingScore; }
        public CompanyRatingResponse setRatingScore(Integer value) { this.RatingScore = value; return this; }
        public RatingReviewResponse getReview() { return Review; }
        public CompanyRatingResponse setReview(RatingReviewResponse value) { this.Review = value; return this; }
        public Date getCreatedDate() { return CreatedDate; }
        public CompanyRatingResponse setCreatedDate(Date value) { this.CreatedDate = value; return this; }
        public Date getUpdatedDate() { return UpdatedDate; }
        public CompanyRatingResponse setUpdatedDate(Date value) { this.UpdatedDate = value; return this; }
    }

    public static class RatingReviewResponse
    {
        /**
        * The title for the review
        */
        @ApiMember(Description="The title for the review")
        public String Title = null;

        /**
        * The description for the review
        */
        @ApiMember(Description="The description for the review")
        public String Description = null;

        /**
        * The rating score
        */
        @ApiMember(Description="The rating score")
        public Integer RatingScore = null;

        /**
        * The review author
        */
        @ApiMember(Description="The review author")
        public String Author = null;

        /**
        * The created date
        */
        @ApiMember(Description="The created date")
        public Date Created = null;

        /**
        * The review answer from the company
        */
        @ApiMember(Description="The review answer from the company")
        public String ReviewAnswer = null;
        
        public String getTitle() { return Title; }
        public RatingReviewResponse setTitle(String value) { this.Title = value; return this; }
        public String getDescription() { return Description; }
        public RatingReviewResponse setDescription(String value) { this.Description = value; return this; }
        public Integer getRatingScore() { return RatingScore; }
        public RatingReviewResponse setRatingScore(Integer value) { this.RatingScore = value; return this; }
        public String getAuthor() { return Author; }
        public RatingReviewResponse setAuthor(String value) { this.Author = value; return this; }
        public Date getCreated() { return Created; }
        public RatingReviewResponse setCreated(Date value) { this.Created = value; return this; }
        public String getReviewAnswer() { return ReviewAnswer; }
        public RatingReviewResponse setReviewAnswer(String value) { this.ReviewAnswer = value; return this; }
    }

}

Java AddRating DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /rating/ HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"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"}}