POST | /rating/ | Create RatingScore | Create rating from booking |
---|
namespace BokaMera.API.ServiceModel.Dtos
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type RatingReviewResponse() =
///<summary>
///The title for the review
///</summary>
[<ApiMember(Description="The title for the review")>]
member val Title:String = null with get,set
///<summary>
///The description for the review
///</summary>
[<ApiMember(Description="The description for the review")>]
member val Description:String = null with get,set
///<summary>
///The rating score
///</summary>
[<ApiMember(Description="The rating score")>]
member val RatingScore:Int32 = new Int32() with get,set
///<summary>
///The review author
///</summary>
[<ApiMember(Description="The review author")>]
member val Author:String = null with get,set
///<summary>
///The created date
///</summary>
[<ApiMember(Description="The created date")>]
member val Created:DateTime = new DateTime() with get,set
///<summary>
///The review answer from the company
///</summary>
[<ApiMember(Description="The review answer from the company")>]
member val ReviewAnswer:String = null with get,set
[<AllowNullLiteral>]
type CompanyRatingResponse() =
///<summary>
///
///</summary>
[<ApiMember(Description="")>]
member val CompanyId:Guid = new Guid() with get,set
///<summary>
///Id of the booking
///</summary>
[<ApiMember(Description="Id of the booking")>]
member val BookingId:Int32 = new Int32() with get,set
///<summary>
///The status of the rating, 1 = Active
///</summary>
[<ApiMember(Description="The status of the rating, 1 = Active")>]
member val Status:Int32 = new Int32() with get,set
///<summary>
///The rating score
///</summary>
[<ApiMember(Description="The rating score")>]
member val RatingScore:Int32 = new Int32() with get,set
///<summary>
///The review if any exists to the rating
///</summary>
[<ApiMember(Description="The review if any exists to the rating")>]
member val Review:RatingReviewResponse = null with get,set
member val CreatedDate:DateTime = new DateTime() with get,set
member val UpdatedDate:DateTime = new DateTime() with get,set
[<AllowNullLiteral>]
type CreateReview() =
///<summary>
///The title for the review
///</summary>
[<ApiMember(Description="The title for the review")>]
member val Title:String = null with get,set
///<summary>
///The description for the review
///</summary>
[<ApiMember(Description="The description for the review")>]
member val Description:String = null with get,set
///<summary>
///The review author
///</summary>
[<ApiMember(Description="The review author")>]
member val Author:String = null with get,set
///<summary>
///The review author
///</summary>
[<ApiMember(Description="The review author")>]
member val ReviewAnswer:String = null with get,set
[<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
[<AllowNullLiteral>]
type AddRating() =
///<summary>
///
///</summary>
[<ApiMember(Description="", IsRequired=true)>]
member val CompanyId:Guid = new Guid() with get,set
///<summary>
///Id of the booking
///</summary>
[<ApiMember(Description="Id of the booking", IsRequired=true)>]
member val BookingId:Int32 = new Int32() with get,set
///<summary>
///The identifier for the booking, use to verify the booking.
///</summary>
[<ApiMember(Description="The identifier for the booking, use to verify the booking.", IsRequired=true)>]
member val Identifier:String = null with get,set
///<summary>
///The rating score between 1 and 5.
///</summary>
[<ApiMember(Description="The rating score between 1 and 5.", IsRequired=true)>]
member val RatingScore:Int32 = new Int32() with get,set
///<summary>
///The review for the rating
///</summary>
[<ApiMember(Description="The review for the rating")>]
member val Review:CreateReview = null with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<AddRating xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<BookingId>0</BookingId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Identifier>String</Identifier>
<RatingScore>0</RatingScore>
<Review>
<Author>String</Author>
<Description>String</Description>
<ReviewAnswer>String</ReviewAnswer>
<Title>String</Title>
</Review>
</AddRating>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CompanyRatingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <BookingId>0</BookingId> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <CreatedDate>0001-01-01T00:00:00</CreatedDate> <RatingScore>0</RatingScore> <Review> <Author>String</Author> <Created>0001-01-01T00:00:00</Created> <Description>String</Description> <RatingScore>0</RatingScore> <ReviewAnswer>String</ReviewAnswer> <Title>String</Title> </Review> <Status>0</Status> <UpdatedDate>0001-01-01T00:00:00</UpdatedDate> </CompanyRatingResponse>