/* Options: Date: 2024-06-17 04:02:11 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://testapi.bokamera.se //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: CreateResource.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; abstract class ICompany { String? CompanyId; } enum BookingStatusEnum { Booked, Unbooked, Reserved, Canceled, AwaitingPayment, AwaitingPaymentNoTimeLimit, Payed, AwaitingPaymentRequestFromAdmin, AwaitingPaymentFromProvider, Invoiced, } class AddCustomField implements IConvertible { int? Id; String? Value; AddCustomField({this.Id,this.Value}); AddCustomField.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Value = json['Value']; return this; } Map toJson() => { 'Id': Id, 'Value': Value }; getTypeName() => "AddCustomField"; TypeContext? context = _ctx; } abstract class IInterval { DateTime? From; DateTime? To; } class BookedCustomer implements IConvertible { String? Id; String? Firstname; String? Lastname; String? Email; String? Phone; String? FacebookUserName; String? ImageUrl; String? CorporateIdentityNumber; String? InvoiceAddress1; String? InvoiceAddress2; String? InvoiceCity; String? InvoicePostalCode; String? InvoiceCountryCode; BookedCustomer({this.Id,this.Firstname,this.Lastname,this.Email,this.Phone,this.FacebookUserName,this.ImageUrl,this.CorporateIdentityNumber,this.InvoiceAddress1,this.InvoiceAddress2,this.InvoiceCity,this.InvoicePostalCode,this.InvoiceCountryCode}); BookedCustomer.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Firstname = json['Firstname']; Lastname = json['Lastname']; Email = json['Email']; Phone = json['Phone']; FacebookUserName = json['FacebookUserName']; ImageUrl = json['ImageUrl']; CorporateIdentityNumber = json['CorporateIdentityNumber']; InvoiceAddress1 = json['InvoiceAddress1']; InvoiceAddress2 = json['InvoiceAddress2']; InvoiceCity = json['InvoiceCity']; InvoicePostalCode = json['InvoicePostalCode']; InvoiceCountryCode = json['InvoiceCountryCode']; return this; } Map toJson() => { 'Id': Id, 'Firstname': Firstname, 'Lastname': Lastname, 'Email': Email, 'Phone': Phone, 'FacebookUserName': FacebookUserName, 'ImageUrl': ImageUrl, 'CorporateIdentityNumber': CorporateIdentityNumber, 'InvoiceAddress1': InvoiceAddress1, 'InvoiceAddress2': InvoiceAddress2, 'InvoiceCity': InvoiceCity, 'InvoicePostalCode': InvoicePostalCode, 'InvoiceCountryCode': InvoiceCountryCode }; getTypeName() => "BookedCustomer"; TypeContext? context = _ctx; } class TimeException implements ITimeException, IConvertible { /** * Time exception id */ // @ApiMember(Description="Time exception id") int? Id; /** * Indicates whether or not the time exception is recurring */ // @ApiMember(Description="Indicates whether or not the time exception is recurring") bool? IsRecurring; /** * Indicates whether the time exception is blocking the time or not */ // @ApiMember(Description="Indicates whether the time exception is blocking the time or not") bool? IsBlock; /** * The reason of the time exception, example: Vacation, doctors appointment, ... */ // @ApiMember(Description="The reason of the time exception, example: Vacation, doctors appointment, ...") String? ReasonText; /** * The public reason of the time exception, example: Vacation, doctors appointment, ... */ // @ApiMember(Description="The public reason of the time exception, example: Vacation, doctors appointment, ...") String? ReasonTextPublic; /** * Time exception start */ // @ApiMember(Description="Time exception start") DateTime? From; /** * Time exception end */ // @ApiMember(Description="Time exception end") DateTime? To; /** * Resources that owns this exception */ // @ApiMember(Description="Resources that owns this exception") List? ResourceIds; TimeException({this.Id,this.IsRecurring,this.IsBlock,this.ReasonText,this.ReasonTextPublic,this.From,this.To,this.ResourceIds}); TimeException.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; IsRecurring = json['IsRecurring']; IsBlock = json['IsBlock']; ReasonText = json['ReasonText']; ReasonTextPublic = json['ReasonTextPublic']; From = JsonConverters.fromJson(json['From'],'DateTime',context!); To = JsonConverters.fromJson(json['To'],'DateTime',context!); ResourceIds = JsonConverters.fromJson(json['ResourceIds'],'List',context!); return this; } Map toJson() => { 'Id': Id, 'IsRecurring': IsRecurring, 'IsBlock': IsBlock, 'ReasonText': ReasonText, 'ReasonTextPublic': ReasonTextPublic, 'From': JsonConverters.toJson(From,'DateTime',context!), 'To': JsonConverters.toJson(To,'DateTime',context!), 'ResourceIds': JsonConverters.toJson(ResourceIds,'List',context!) }; getTypeName() => "TimeException"; TypeContext? context = _ctx; } class BookedTime implements IBookedTime, IConvertible { /** * Booking id */ // @ApiMember(Description="Booking id") int? Id; /** * The booked service */ // @ApiMember(Description="The booked service") int? ServiceId; /** * Booking start */ // @ApiMember(Description="Booking start") DateTime? From; /** * Booking end */ // @ApiMember(Description="Booking end") DateTime? To; /** * Number of booked spots */ // @ApiMember(Description="Number of booked spots") int? BookedSpots; /** * Number of total spots for the service */ // @ApiMember(Description="Number of total spots for the service") int? TotalSpots; /** * The pause after the booking */ // @ApiMember(Description="The pause after the booking") int? PauseAfterInMinutes; /** * The booking status */ // @ApiMember(Description="The booking status") int? StatusId; BookingStatusEnum? Status; /** * The customer the booking belongs to */ // @ApiMember(Description="The customer the booking belongs to") BookedCustomer? Customer; BookedTime({this.Id,this.ServiceId,this.From,this.To,this.BookedSpots,this.TotalSpots,this.PauseAfterInMinutes,this.StatusId,this.Status,this.Customer}); BookedTime.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; ServiceId = json['ServiceId']; From = JsonConverters.fromJson(json['From'],'DateTime',context!); To = JsonConverters.fromJson(json['To'],'DateTime',context!); BookedSpots = json['BookedSpots']; TotalSpots = json['TotalSpots']; PauseAfterInMinutes = json['PauseAfterInMinutes']; StatusId = json['StatusId']; Status = JsonConverters.fromJson(json['Status'],'BookingStatusEnum',context!); Customer = JsonConverters.fromJson(json['Customer'],'BookedCustomer',context!); return this; } Map toJson() => { 'Id': Id, 'ServiceId': ServiceId, 'From': JsonConverters.toJson(From,'DateTime',context!), 'To': JsonConverters.toJson(To,'DateTime',context!), 'BookedSpots': BookedSpots, 'TotalSpots': TotalSpots, 'PauseAfterInMinutes': PauseAfterInMinutes, 'StatusId': StatusId, 'Status': JsonConverters.toJson(Status,'BookingStatusEnum',context!), 'Customer': JsonConverters.toJson(Customer,'BookedCustomer',context!) }; getTypeName() => "BookedTime"; TypeContext? context = _ctx; } abstract class ITimeException extends IInterval { int? Id; String? ReasonText; bool? IsBlock; String? ReasonTextPublic; bool? IsRecurring; List? ResourceIds; } abstract class IBookedTime extends IInterval { int? Id; int? ServiceId; int? BookedSpots; int? TotalSpots; int? PauseAfterInMinutes; BookingStatusEnum? Status; int? StatusId; BookedCustomer? Customer; } class ResourceQueryResponse implements IConvertible { /** * The resource id */ // @ApiMember(Description="The resource id") int? Id; /** * The resource name */ // @ApiMember(Description="The resource name") String? Name; /** * The resource description */ // @ApiMember(Description="The resource description") String? Description; /** * If resource is active or not */ // @ApiMember(Description="If resource is active or not") bool? Active; /** * The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue. */ // @ApiMember(Description="The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.") String? Color; /** * The email of the resource */ // @ApiMember(Description="The email of the resource") String? Email; /** * The image url of the resource */ // @ApiMember(Description="The image url of the resource") Uri? ImageUrl; /** * The mobile phone number of the resource */ // @ApiMember(Description="The mobile phone number of the resource") String? MobilePhone; /** * Used by example code locks to know what access group the resource is assigned to */ // @ApiMember(Description="Used by example code locks to know what access group the resource is assigned to") String? AccessGroup; /** * If the resource should receive email notification when booked */ // @ApiMember(Description="If the resource should receive email notification when booked") bool? EmailNotification; /** * If the resource should receive SMS notification when booked */ // @ApiMember(Description="If the resource should receive SMS notification when booked") bool? SMSNotification; /** * If the resource should receive email reminders on bookings */ // @ApiMember(Description="If the resource should receive email reminders on bookings") bool? SendEmailReminder; /** * If the resource should receive SMS reminders on bookings */ // @ApiMember(Description="If the resource should receive SMS reminders on bookings") bool? SendSMSReminder; /** * The resource time exceptions */ // @ApiMember(Description="The resource time exceptions") List? Exceptions; /** * The resource bookings */ // @ApiMember(Description="The resource bookings") List? Bookings; /** * Then date when the resource was created */ // @ApiMember(Description="Then date when the resource was created") DateTime? Created; /** * Then date when the resource was updated */ // @ApiMember(Description="Then date when the resource was updated") DateTime? Updated; ResponseStatus? ResponseStatus; ResourceQueryResponse({this.Id,this.Name,this.Description,this.Active,this.Color,this.Email,this.ImageUrl,this.MobilePhone,this.AccessGroup,this.EmailNotification,this.SMSNotification,this.SendEmailReminder,this.SendSMSReminder,this.Exceptions,this.Bookings,this.Created,this.Updated,this.ResponseStatus}); ResourceQueryResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Name = json['Name']; Description = json['Description']; Active = json['Active']; Color = json['Color']; Email = json['Email']; ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!); MobilePhone = json['MobilePhone']; AccessGroup = json['AccessGroup']; EmailNotification = json['EmailNotification']; SMSNotification = json['SMSNotification']; SendEmailReminder = json['SendEmailReminder']; SendSMSReminder = json['SendSMSReminder']; Exceptions = JsonConverters.fromJson(json['Exceptions'],'List',context!); Bookings = JsonConverters.fromJson(json['Bookings'],'List',context!); Created = JsonConverters.fromJson(json['Created'],'DateTime',context!); Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!); ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!); return this; } Map toJson() => { 'Id': Id, 'Name': Name, 'Description': Description, 'Active': Active, 'Color': Color, 'Email': Email, 'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!), 'MobilePhone': MobilePhone, 'AccessGroup': AccessGroup, 'EmailNotification': EmailNotification, 'SMSNotification': SMSNotification, 'SendEmailReminder': SendEmailReminder, 'SendSMSReminder': SendSMSReminder, 'Exceptions': JsonConverters.toJson(Exceptions,'List',context!), 'Bookings': JsonConverters.toJson(Bookings,'List',context!), 'Created': JsonConverters.toJson(Created,'DateTime',context!), 'Updated': JsonConverters.toJson(Updated,'DateTime',context!), 'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!) }; getTypeName() => "ResourceQueryResponse"; TypeContext? context = _ctx; } // @Route("/resource", "POST") // @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 CreateResource implements IReturn, ICompany, IConvertible, IPost { /** * 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) String? CompanyId; /** * The resource name */ // @ApiMember(Description="The resource name") String? Name; /** * The resource description */ // @ApiMember(Description="The resource description") String? Description; /** * If resource is active or not. Default is active. */ // @ApiMember(Description="If resource is active or not. Default is active.") bool? Active; /** * The resource color in scheduler */ // @ApiMember(Description="The resource color in scheduler") String? Color; /** * The email of the resource */ // @ApiMember(Description="The email of the resource") String? Email; /** * The image url of the resource */ // @ApiMember(Description="The image url of the resource") Uri? ImageUrl; /** * Used by example code locks to know what access group the resource is assigned to */ // @ApiMember(Description="Used by example code locks to know what access group the resource is assigned to") String? AccessGroup; /** * The mobile phone number of the resource */ // @ApiMember(Description="The mobile phone number of the resource") String? MobilePhone; /** * If the resource should receive email notification when booked */ // @ApiMember(Description="If the resource should receive email notification when booked") bool? EmailNotification; /** * If the resource should receive SMS notification when booked */ // @ApiMember(Description="If the resource should receive SMS notification when booked") bool? SMSNotification; /** * If the resource should receive email reminders on bookings */ // @ApiMember(Description="If the resource should receive email reminders on bookings") bool? SendEmailReminder; /** * If the resource should receive SMS reminders on bookings */ // @ApiMember(Description="If the resource should receive SMS reminders on bookings") bool? SendSMSReminder; /** * If Custom Fields are added to the resource, here you will send the id and the value for each custom field to be saved */ // @ApiMember(Description="If Custom Fields are added to the resource, here you will send the id and the value for each custom field to be saved") List? CustomFields; CreateResource({this.CompanyId,this.Name,this.Description,this.Active,this.Color,this.Email,this.ImageUrl,this.AccessGroup,this.MobilePhone,this.EmailNotification,this.SMSNotification,this.SendEmailReminder,this.SendSMSReminder,this.CustomFields}); CreateResource.fromJson(Map json) { fromMap(json); } fromMap(Map json) { CompanyId = json['CompanyId']; Name = json['Name']; Description = json['Description']; Active = json['Active']; Color = json['Color']; Email = json['Email']; ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!); AccessGroup = json['AccessGroup']; MobilePhone = json['MobilePhone']; EmailNotification = json['EmailNotification']; SMSNotification = json['SMSNotification']; SendEmailReminder = json['SendEmailReminder']; SendSMSReminder = json['SendSMSReminder']; CustomFields = JsonConverters.fromJson(json['CustomFields'],'List',context!); return this; } Map toJson() => { 'CompanyId': CompanyId, 'Name': Name, 'Description': Description, 'Active': Active, 'Color': Color, 'Email': Email, 'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!), 'AccessGroup': AccessGroup, 'MobilePhone': MobilePhone, 'EmailNotification': EmailNotification, 'SMSNotification': SMSNotification, 'SendEmailReminder': SendEmailReminder, 'SendSMSReminder': SendSMSReminder, 'CustomFields': JsonConverters.toJson(CustomFields,'List',context!) }; createResponse() => ResourceQueryResponse(); getResponseTypeName() => "ResourceQueryResponse"; getTypeName() => "CreateResource"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: { 'ICompany': TypeInfo(TypeOf.Interface), 'BookingStatusEnum': TypeInfo(TypeOf.Enum, enumValues:BookingStatusEnum.values), 'AddCustomField': TypeInfo(TypeOf.Class, create:() => AddCustomField()), 'IInterval': TypeInfo(TypeOf.Interface), 'BookedCustomer': TypeInfo(TypeOf.Class, create:() => BookedCustomer()), 'TimeException': TypeInfo(TypeOf.Class, create:() => TimeException()), 'BookedTime': TypeInfo(TypeOf.Class, create:() => BookedTime()), 'ITimeException': TypeInfo(TypeOf.Interface), 'IBookedTime': TypeInfo(TypeOf.Interface), 'ResourceQueryResponse': TypeInfo(TypeOf.Class, create:() => ResourceQueryResponse()), 'Uri': TypeInfo(TypeOf.Class, create:() => Uri()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'List': TypeInfo(TypeOf.Class, create:() => []), 'CreateResource': TypeInfo(TypeOf.Class, create:() => CreateResource()), 'List': TypeInfo(TypeOf.Class, create:() => []), });