/* Options: Date: 2024-11-21 11:59:41 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.bokamera.se //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: StatisticQuery.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; abstract class ICompany { String? CompanyId; } class BookedByDay implements IConvertible { DateTime? Date; int? Value; BookedByDay({this.Date,this.Value}); BookedByDay.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Date = JsonConverters.fromJson(json['Date'],'DateTime',context!); Value = json['Value']; return this; } Map toJson() => { 'Date': JsonConverters.toJson(Date,'DateTime',context!), 'Value': Value }; getTypeName() => "BookedByDay"; TypeContext? context = _ctx; } class StatisticQueryResponse implements IConvertible { int? NumberOfOccuringBookings; int? NumberOfCanceledBookings; int? NumberOfCreatedBookings; int? NumberOfCreatedCustomers; List? OccuringBookingsByDay; List? CanceledBookingsByDay; List? CreatedBookingsByDay; List? CreatedCustomersByDay; ResponseStatus? ResponseStatus; StatisticQueryResponse({this.NumberOfOccuringBookings,this.NumberOfCanceledBookings,this.NumberOfCreatedBookings,this.NumberOfCreatedCustomers,this.OccuringBookingsByDay,this.CanceledBookingsByDay,this.CreatedBookingsByDay,this.CreatedCustomersByDay,this.ResponseStatus}); StatisticQueryResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { NumberOfOccuringBookings = json['NumberOfOccuringBookings']; NumberOfCanceledBookings = json['NumberOfCanceledBookings']; NumberOfCreatedBookings = json['NumberOfCreatedBookings']; NumberOfCreatedCustomers = json['NumberOfCreatedCustomers']; OccuringBookingsByDay = JsonConverters.fromJson(json['OccuringBookingsByDay'],'List',context!); CanceledBookingsByDay = JsonConverters.fromJson(json['CanceledBookingsByDay'],'List',context!); CreatedBookingsByDay = JsonConverters.fromJson(json['CreatedBookingsByDay'],'List',context!); CreatedCustomersByDay = JsonConverters.fromJson(json['CreatedCustomersByDay'],'List',context!); ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!); return this; } Map toJson() => { 'NumberOfOccuringBookings': NumberOfOccuringBookings, 'NumberOfCanceledBookings': NumberOfCanceledBookings, 'NumberOfCreatedBookings': NumberOfCreatedBookings, 'NumberOfCreatedCustomers': NumberOfCreatedCustomers, 'OccuringBookingsByDay': JsonConverters.toJson(OccuringBookingsByDay,'List',context!), 'CanceledBookingsByDay': JsonConverters.toJson(CanceledBookingsByDay,'List',context!), 'CreatedBookingsByDay': JsonConverters.toJson(CreatedBookingsByDay,'List',context!), 'CreatedCustomersByDay': JsonConverters.toJson(CreatedCustomersByDay,'List',context!), 'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!) }; getTypeName() => "StatisticQueryResponse"; TypeContext? context = _ctx; } // @Route("/statistics", "GET") // @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) // @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403) // @ValidateRequest(Validator="IsAuthenticated") class StatisticQuery implements IReturn, ICompany, IConvertible, IGet { /** * Enter the company id, if blank company id and you are an admin, your company id will be used. */ // @ApiMember(Description="Enter the company id, if blank company id and you are an admin, your company id will be used.", IsRequired=true, ParameterType="query") String? CompanyId; /** * Start of interval to get bookings and customers */ // @ApiMember(Description="Start of interval to get bookings and customers", IsRequired=true, ParameterType="query") // @Required() DateTime? From; /** * End of interval to get bookings and customers */ // @ApiMember(Description="End of interval to get bookings and customers", IsRequired=true, ParameterType="query") DateTime? To; /** * Set true if you want to include booked events by day */ // @ApiMember(Description="Set true if you want to include booked events by day", ParameterType="query") bool? IncludeOccuringBookingsByDay; /** * Set true if you want to include canceled booked events by day */ // @ApiMember(Description="Set true if you want to include canceled booked events by day", ParameterType="query") bool? IncludeBookingsCanceledByDay; /** * Set true if you want to include booking created by day */ // @ApiMember(Description="Set true if you want to include booking created by day", ParameterType="query") bool? IncludeCreatedBookingsByDay; /** * Set true if you want to include customers created by day */ // @ApiMember(Description="Set true if you want to include customers created by day", ParameterType="query") bool? IncludeCreatedCustomersByDay; StatisticQuery({this.CompanyId,this.From,this.To,this.IncludeOccuringBookingsByDay,this.IncludeBookingsCanceledByDay,this.IncludeCreatedBookingsByDay,this.IncludeCreatedCustomersByDay}); StatisticQuery.fromJson(Map json) { fromMap(json); } fromMap(Map json) { CompanyId = json['CompanyId']; From = JsonConverters.fromJson(json['From'],'DateTime',context!); To = JsonConverters.fromJson(json['To'],'DateTime',context!); IncludeOccuringBookingsByDay = json['IncludeOccuringBookingsByDay']; IncludeBookingsCanceledByDay = json['IncludeBookingsCanceledByDay']; IncludeCreatedBookingsByDay = json['IncludeCreatedBookingsByDay']; IncludeCreatedCustomersByDay = json['IncludeCreatedCustomersByDay']; return this; } Map toJson() => { 'CompanyId': CompanyId, 'From': JsonConverters.toJson(From,'DateTime',context!), 'To': JsonConverters.toJson(To,'DateTime',context!), 'IncludeOccuringBookingsByDay': IncludeOccuringBookingsByDay, 'IncludeBookingsCanceledByDay': IncludeBookingsCanceledByDay, 'IncludeCreatedBookingsByDay': IncludeCreatedBookingsByDay, 'IncludeCreatedCustomersByDay': IncludeCreatedCustomersByDay }; createResponse() => StatisticQueryResponse(); getResponseTypeName() => "StatisticQueryResponse"; getTypeName() => "StatisticQuery"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: { 'ICompany': TypeInfo(TypeOf.Interface), 'BookedByDay': TypeInfo(TypeOf.Class, create:() => BookedByDay()), 'StatisticQueryResponse': TypeInfo(TypeOf.Class, create:() => StatisticQueryResponse()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'StatisticQuery': TypeInfo(TypeOf.Class, create:() => StatisticQuery()), });