BokaMera.API.Host

<back to all web services

UpdateRating

The following routes are available for this service:
PUT/rating/Update RatingScoreUpdate 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()),
});

Dart UpdateRating DTOs

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

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateRating 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>
</UpdateRating>
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>