""" Options: Date: 2024-11-23 09:07:00 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: DateScheduleQuery.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ import datetime import decimal from marshmallow.fields import * from servicestack import * from typing import * from dataclasses import dataclass, field from dataclasses_json import dataclass_json, LetterCase, Undefined, config from enum import Enum, IntEnum class BookingStatusEnum(IntEnum): BOOKED = 1 UNBOOKED = 2 RESERVED = 3 CANCELED = 4 AWAITING_PAYMENT = 5 AWAITING_PAYMENT_NO_TIME_LIMIT = 6 PAYED = 7 AWAITING_PAYMENT_REQUEST_FROM_ADMIN = 8 AWAITING_PAYMENT_FROM_PROVIDER = 9 INVOICED = 10 class IInterval: from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) to: datetime.datetime = datetime.datetime(1, 1, 1) @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BaseModel: pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldValue(BaseModel): # @Required() company_id: Optional[str] = None id: int = 0 # @Required() value: Optional[str] = None # @Required() active: bool = False sort_order: Optional[int] = None modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomField(BaseModel): # @Required() table: Optional[str] = None # @Required() column: Optional[str] = None # @Required() data_type: Optional[str] = None # @Required() description: Optional[str] = None # @Required() active: bool = False modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RegEx(BaseModel): # @Required() name: Optional[str] = None # @Required() description: Optional[str] = None # @Required() reg_ex_code: Optional[str] = None error_message: Optional[str] = None modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldServiceRelation(BaseModel): # @Required() company_id: Optional[str] = None id: int = 0 # @Required() custom_field_config_id: int = 0 # @Required() service_id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldConfig(BaseModel): # @Ignore() values: Optional[List[CustomFieldValue]] = None custom_field: Optional[CustomField] = None # @Ignore() reg_ex: Optional[RegEx] = None # @Ignore() services: Optional[List[Service]] = None custom_field_service_relation: Optional[List[CustomFieldServiceRelation]] = None # @Required() company_id: Optional[str] = None id: int = 0 group_id: Optional[int] = None # @Required() field_id: int = 0 # @Required() icon_id: int = 0 reg_ex_id: Optional[int] = None # @Required() name: Optional[str] = None # @Required() description: Optional[str] = None # @Required() datatype: Optional[str] = None # @Required() max_length: int = 0 # @Required() is_public: bool = False # @Required() is_hidden: bool = False # @Required() is_mandatory: bool = False default_value: Optional[str] = None reg_ex_error_message: Optional[str] = None mandatory_error_message: Optional[str] = None width: Optional[int] = None # @Required() multiple_line_text: bool = False modified_date: Optional[datetime.datetime] = None class ITimeException(IInterval): id: int = 0 reason_text: Optional[str] = None is_block: bool = False reason_text_public: Optional[str] = None is_recurring: bool = False resource_ids: Optional[List[int]] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookedCustomer: id: Optional[str] = None firstname: Optional[str] = None lastname: Optional[str] = None email: Optional[str] = None phone: Optional[str] = None facebook_user_name: Optional[str] = None image_url: Optional[str] = None corporate_identity_number: Optional[str] = None invoice_address1: Optional[str] = None invoice_address2: Optional[str] = None invoice_city: Optional[str] = None invoice_postal_code: Optional[str] = None invoice_country_code: Optional[str] = None class IBookedTime(IInterval): id: int = 0 service_id: int = 0 booked_spots: int = 0 total_spots: int = 0 pause_after_in_minutes: int = 0 status: Optional[BookingStatusEnum] = None status_id: int = 0 customer: Optional[BookedCustomer] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldDataResponse: id: int = 0 column: Optional[str] = None name: Optional[str] = None description: Optional[str] = None value: Optional[str] = None # @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'") data_type: Optional[str] = None """ Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Resource(BaseModel, ICustomFieldTable, IBaseModelCreated, IBaseModelUpdated): # @Ignore() priority: int = 0 # @Ignore() schedules: Optional[IList[ISchedule]] = None # @Ignore() exceptions: Optional[IList[ITimeException]] = None # @Ignore() bookings: Optional[IList[IBookedTime]] = None # @Ignore() custom_fields_config: Optional[IList[CustomFieldConfig]] = None # @Ignore() custom_fields_data: Optional[IList[CustomFieldDataResponse]] = None # @Required() company_id: Optional[str] = None id: int = 0 # @Required() name: Optional[str] = None # @Required() active: bool = False description: Optional[str] = None image_url: Optional[str] = None # @Required() updated_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() color: Optional[str] = None email: Optional[str] = None mobile_phone: Optional[str] = None email_notification: Optional[bool] = None sms_notification: Optional[bool] = None # @Required() send_s_m_s_reminder: bool = False # @Required() send_email_reminder: bool = False modified_date: Optional[datetime.datetime] = None access_group: Optional[str] = None text_field1: Optional[str] = None text_field2: Optional[str] = None text_field3: Optional[str] = None text_field4: Optional[str] = None text_field5: Optional[str] = None text_field6: Optional[str] = None text_field7: Optional[str] = None text_field8: Optional[str] = None text_field9: Optional[str] = None text_field10: Optional[str] = None text_field11: Optional[str] = None text_field12: Optional[str] = None text_field13: Optional[str] = None text_field14: Optional[str] = None text_field15: Optional[str] = None text_field16: Optional[str] = None text_field17: Optional[str] = None text_field18: Optional[str] = None text_field19: Optional[str] = None text_field20: Optional[str] = None class ScheduleType(str, Enum): NOT_DEFINED = 'NotDefined' RECURRING_SCHEDULE = 'RecurringSchedule' DATE_SCHEDULE = 'DateSchedule' class ISchedule: resources: Optional[IList[Resource]] = None type: Optional[ScheduleType] = None active: bool = False is_resource_specific: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DateScheduleDate(BaseModel, IInterval, IBaseModelCreated, IBaseModelUpdated): # @Required() company_id: Optional[str] = None id: int = 0 # @Required() date_schedule_id: int = 0 # @Required() updated_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created_date: datetime.datetime = datetime.datetime(1, 1, 1) modified_date: Optional[datetime.datetime] = None # @Required() from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) # @Required() to: datetime.datetime = datetime.datetime(1, 1, 1) @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DateScheduleResourceRelation(BaseModel): # @Required() company_id: Optional[str] = None # @Required() date_schedule_id: int = 0 # @Required() resource_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ServiceDateScheduleRelation(BaseModel): # @Required() company_id: Optional[str] = None # @Required() service_id: int = 0 # @Required() date_schedule_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DateSchedule(BaseModel, ISchedule, IBaseModelCreated, IBaseModelUpdated): # @Ignore() dates: Optional[IList[DateScheduleDate]] = None # @Ignore() type: Optional[ScheduleType] = None # @Ignore() resources: Optional[IList[Resource]] = None # @Ignore() services: Optional[IList[Service]] = None # @Ignore() is_resource_specific: bool = False date_schedule_date: Optional[List[DateScheduleDate]] = None date_schedule_resource_relation: Optional[List[DateScheduleResourceRelation]] = None service_date_schedule_relation: Optional[List[ServiceDateScheduleRelation]] = None # @Required() company_id: Optional[str] = None id: int = 0 # @Required() name: Optional[str] = None # @Required() description: Optional[str] = None # @Required() updated_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created_date: datetime.datetime = datetime.datetime(1, 1, 1) modified_date: Optional[datetime.datetime] = None # @Required() active: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ScheduleResources: id: int = 0 # @ApiMember(Description="Name of the resource") name: Optional[str] = None """ Name of the resource """ # @ApiMember(Description="The image url of the resource") image_url: Optional[str] = None """ The image url of the resource """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ScheduleServices: id: int = 0 # @ApiMember(Description="Name of the service") name: Optional[str] = None """ Name of the service """ # @ApiMember(Description="The image url of the service") image_url: Optional[str] = None """ The image url of the service """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DateScheduleDateResponse: id: int = 0 from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) to: datetime.datetime = datetime.datetime(1, 1, 1) response_status: Optional[ResponseStatus] = None class IBaseModelCreated: created_date: datetime.datetime = datetime.datetime(1, 1, 1) class IBaseModelUpdated: updated_date: datetime.datetime = datetime.datetime(1, 1, 1) class ICustomFieldTable: custom_fields_config: Optional[IList[CustomFieldConfig]] = None custom_fields_data: Optional[IList[CustomFieldDataResponse]] = None text_field1: Optional[str] = None text_field2: Optional[str] = None text_field3: Optional[str] = None text_field4: Optional[str] = None text_field5: Optional[str] = None text_field6: Optional[str] = None text_field7: Optional[str] = None text_field8: Optional[str] = None text_field9: Optional[str] = None text_field10: Optional[str] = None text_field11: Optional[str] = None text_field12: Optional[str] = None text_field13: Optional[str] = None text_field14: Optional[str] = None text_field15: Optional[str] = None text_field16: Optional[str] = None text_field17: Optional[str] = None text_field18: Optional[str] = None text_field19: Optional[str] = None text_field20: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DateScheduleQueryResponse: # @ApiMember(Description="The schedule id") id: int = 0 """ The schedule id """ # @ApiMember(Description="Name of the schedule") name: Optional[str] = None """ Name of the schedule """ # @ApiMember(Description="Description of the schedule") description: Optional[str] = None """ Description of the schedule """ # @ApiMember(Description="If the schedule is active or not") active: bool = False """ If the schedule is active or not """ # @ApiMember(Description="If the schedule is only connected to some specific resources. Note: You must have IncludeResources property to see this.", IsRequired=true) is_resource_specific: Optional[bool] = None """ If the schedule is only connected to some specific resources. Note: You must have IncludeResources property to see this. """ # @ApiMember(Description="Schedule dates") schedule_dates: Optional[List[DateScheduleDateResponse]] = None """ Schedule dates """ # @ApiMember(Description="The resources that is connected to the schedule") resources: Optional[List[ScheduleResources]] = None """ The resources that is connected to the schedule """ # @ApiMember(Description="The services that is connected to the schedule") services: Optional[List[ScheduleServices]] = None """ The services that is connected to the schedule """ # @ApiMember(Description="The timestamp when the schedule was updated", IsRequired=true) updated_date: datetime.datetime = datetime.datetime(1, 1, 1) """ The timestamp when the schedule was updated """ # @ApiMember(Description="The timestamp when the schedule was created", IsRequired=true) created_date: datetime.datetime = datetime.datetime(1, 1, 1) """ The timestamp when the schedule was created """ response_status: Optional[ResponseStatus] = None # @Route("/schedules/date", "GET") # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DateScheduleQuery(QueryDb2[DateSchedule, DateScheduleQueryResponse], IReturn[QueryResponse[DateScheduleQueryResponse]]): # @ApiMember(Description="Enter the company you want to see news for, if blank and you are an admin, your company id will be used", ParameterType="query") company_id: Optional[str] = None """ Enter the company you want to see news for, if blank and you are an admin, your company id will be used """ # @ApiMember(DataType="dateTime", Description="Enter the From Date you want to see news from, only allowed if admin", ParameterType="query") valid_from: Optional[datetime.datetime] = None """ Enter the From Date you want to see news from, only allowed if admin """ # @ApiMember(DataType="dateTime", Description="Enter the To Date you want to see news to, only allowed if admin", ParameterType="query") valid_to: Optional[datetime.datetime] = None """ Enter the To Date you want to see news to, only allowed if admin """ # @ApiMember(DataType="bool", Description="If you want to include the connected dates for the schedule", ParameterType="query") include_schedule_dates: bool = False """ If you want to include the connected dates for the schedule """ # @ApiMember(DataType="bool", Description="If you want to include the connected resources for the schedule", ParameterType="query") include_connected_resources: bool = False """ If you want to include the connected resources for the schedule """ # @ApiMember(DataType="bool", Description="If you want to include the connected services for the schedule", ParameterType="query") include_connected_services: bool = False """ If you want to include the connected services for the schedule """ # @ApiMember(DataType="boolean", Description="Use this parameter if you want to only show active news") active: Optional[bool] = None """ Use this parameter if you want to only show active news """