Requires the role: | manager |
POST | /bookings |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class CreateBookingRequest extends PostOperationTenanted<CreateBookingResponse>
{
public String carId = null;
public Date startUtc = null;
public Date endUtc = null;
public String getCarId() { return carId; }
public CreateBookingRequest setCarId(String value) { this.carId = value; return this; }
public Date getStartUtc() { return startUtc; }
public CreateBookingRequest setStartUtc(Date value) { this.startUtc = value; return this; }
public Date getEndUtc() { return endUtc; }
public CreateBookingRequest setEndUtc(Date value) { this.endUtc = value; return this; }
}
public static class PostOperationTenanted<TResponse> extends PostOperationUnTenanted<TResponse> implements ITenantedRequest
{
public String organisationId = null;
public String getOrganisationId() { return organisationId; }
public PostOperationTenanted<TResponse> setOrganisationId(String value) { this.organisationId = value; return this; }
}
public static class PostOperationUnTenanted<TResponse> implements IPost
{
}
public static class CreateBookingResponse
{
public ResponseStatus responseStatus = null;
public Booking booking = null;
public ResponseStatus getResponseStatus() { return responseStatus; }
public CreateBookingResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
public Booking getBooking() { return booking; }
public CreateBookingResponse setBooking(Booking value) { this.booking = value; return this; }
}
public static class Booking implements IIdentifiableResource
{
public Date startUtc = null;
public Date endUtc = null;
public String borrowerId = null;
public String carId = null;
public String id = null;
public Date getStartUtc() { return startUtc; }
public Booking setStartUtc(Date value) { this.startUtc = value; return this; }
public Date getEndUtc() { return endUtc; }
public Booking setEndUtc(Date value) { this.endUtc = value; return this; }
public String getBorrowerId() { return borrowerId; }
public Booking setBorrowerId(String value) { this.borrowerId = value; return this; }
public String getCarId() { return carId; }
public Booking setCarId(String value) { this.carId = value; return this; }
public String getId() { return id; }
public Booking setId(String value) { this.id = value; return this; }
}
}
Java CreateBookingRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /bookings HTTP/1.1
Host: staging-api.billiecart.com.au
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
carId: String,
endUtc: ,
organisationId: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, booking: { borrowerId: String, carId: String, id: String } }