GET | /bookings | ||
---|---|---|---|
GET | /bookings/{Id} |
// @DataContract
export class QueryBase
{
// @DataMember(Order=1)
public skip?: number;
// @DataMember(Order=2)
public take?: number;
// @DataMember(Order=3)
public orderBy: string;
// @DataMember(Order=4)
public orderByDesc: string;
// @DataMember(Order=5)
public include: string;
// @DataMember(Order=6)
public fields: string;
// @DataMember(Order=7)
public meta: { [index: string]: string; };
public constructor(init?: Partial<QueryBase>) { (Object as any).assign(this, init); }
}
export class QueryDb<T> extends QueryBase
{
// @DataMember(Order=1)
public skip?: number;
// @DataMember(Order=2)
public take?: number;
// @DataMember(Order=3)
public orderBy: string;
// @DataMember(Order=4)
public orderByDesc: string;
// @DataMember(Order=5)
public include: string;
// @DataMember(Order=6)
public fields: string;
// @DataMember(Order=7)
public meta: { [index: string]: string; };
public constructor(init?: Partial<QueryDb<T>>) { super(init); (Object as any).assign(this, init); }
}
// @DataContract
export class AuditBase
{
// @DataMember(Order=1)
public createdDate: string;
// @DataMember(Order=2)
// @Required()
public createdBy: string;
// @DataMember(Order=3)
public modifiedDate: string;
// @DataMember(Order=4)
// @Required()
public modifiedBy: string;
// @DataMember(Order=5)
public deletedDate?: string;
// @DataMember(Order=6)
public deletedBy: string;
public constructor(init?: Partial<AuditBase>) { (Object as any).assign(this, init); }
}
export enum RoomType
{
Single = 'Single',
Double = 'Double',
Queen = 'Queen',
Twin = 'Twin',
Suite = 'Suite',
}
/** @description Booking Details */
export class Booking extends AuditBase
{
public id: number;
public name: string;
public roomType: RoomType;
public roomNumber: number;
public bookingStartDate: string;
public bookingEndDate?: string;
public cost: number;
public notes?: string;
public cancelled?: boolean;
// @DataMember(Order=1)
public createdDate: string;
// @DataMember(Order=2)
// @Required()
public createdBy: string;
// @DataMember(Order=3)
public modifiedDate: string;
// @DataMember(Order=4)
// @Required()
public modifiedBy: string;
// @DataMember(Order=5)
public deletedDate?: string;
// @DataMember(Order=6)
public deletedBy: string;
public constructor(init?: Partial<Booking>) { super(init); (Object as any).assign(this, init); }
}
/** @description Find Bookings */
export class QueryBookings extends QueryDb<Booking>
{
public id?: number;
// @DataMember(Order=1)
public skip?: number;
// @DataMember(Order=2)
public take?: number;
// @DataMember(Order=3)
public orderBy: string;
// @DataMember(Order=4)
public orderByDesc: string;
// @DataMember(Order=5)
public include: string;
// @DataMember(Order=6)
public fields: string;
// @DataMember(Order=7)
public meta: { [index: string]: string; };
public constructor(init?: Partial<QueryBookings>) { super(init); (Object as any).assign(this, init); }
}
export class Todo
{
public id: number;
public text: string;
public isFinished: boolean;
public constructor(init?: Partial<Todo>) { (Object as any).assign(this, init); }
}
// @DataContract
export class QueryResponse<Todo>
{
// @DataMember(Order=1)
public offset: number;
// @DataMember(Order=2)
public total: number;
// @DataMember(Order=3)
public results: Todo[];
// @DataMember(Order=4)
public meta: { [index: string]: string; };
// @DataMember(Order=5)
public responseStatus: ResponseStatus;
public constructor(init?: Partial<QueryResponse<Todo>>) { (Object as any).assign(this, init); }
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /bookings HTTP/1.1 Host: vue-vite-api.jamstacks.net Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"offset":0,"total":0,"results":[{"id":0,"name":"String","roomType":"Single","roomNumber":0,"bookingStartDate":"\/Date(-62135596800000-0000)\/","bookingEndDate":"\/Date(-62135596800000-0000)\/","cost":0,"notes":"String","cancelled":false,"createdDate":"\/Date(-62135596800000-0000)\/","createdBy":"String","modifiedDate":"\/Date(-62135596800000-0000)\/","modifiedBy":"String","deletedDate":"\/Date(-62135596800000-0000)\/","deletedBy":"String"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}