Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
GET | /bookings/{BookingId}/reports/{ReportId} | Get a report as a PDF file | Get a PDF report. |
---|
import 'package:servicestack/servicestack.dart';
enum SendReceiptMethod
{
Email,
PdfExport,
}
// @ValidateRequest(Validator="IsAuthenticated")
class ExportReport implements IConvertible
{
/**
* Id of the booking
*/
// @ApiMember(Description="Id of the booking", IsRequired=true, ParameterType="path")
int? BookingId;
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
// @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
String? CompanyId;
/**
* Id of the report
*/
// @ApiMember(Description="Id of the report", IsRequired=true, ParameterType="path")
int? ReportId;
SendReceiptMethod? SendReceiptMethod;
ExportReport({this.BookingId,this.CompanyId,this.ReportId,this.SendReceiptMethod});
ExportReport.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
BookingId = json['BookingId'];
CompanyId = json['CompanyId'];
ReportId = json['ReportId'];
SendReceiptMethod = JsonConverters.fromJson(json['SendReceiptMethod'],'SendReceiptMethod',context!);
return this;
}
Map<String, dynamic> toJson() => {
'BookingId': BookingId,
'CompanyId': CompanyId,
'ReportId': ReportId,
'SendReceiptMethod': JsonConverters.toJson(SendReceiptMethod,'SendReceiptMethod',context!)
};
getTypeName() => "ExportReport";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'SendReceiptMethod': TypeInfo(TypeOf.Enum, enumValues:SendReceiptMethod.values),
'ExportReport': TypeInfo(TypeOf.Class, create:() => ExportReport()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /bookings/{BookingId}/reports/{ReportId} HTTP/1.1 Host: api.bokamera.se Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {}