""" Options: Date: 2024-07-03 12:40:01 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: ResourceTimeExceptionQuery.* #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 class BokaMeraDayOfWeek(IntEnum): MONDAY = 1 TUESDAY = 2 WEDNESDAY = 3 THURSDAY = 4 FRIDAY = 5 SATURDAY = 6 SUNDAY = 7 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ResourceTimeExceptionDayOfWeekRelation(BaseModel): # @Ignore() day_of_week: Optional[BokaMeraDayOfWeek] = None # @Required() day_of_week_id: int = 0 # @Required() company_id: Optional[str] = None # @Required() resource_time_exception_id: int = 0 modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ResourceTimeExceptionResourceRelation(BaseModel): # @Ignore() resource: Optional[Resource] = None # @Required() company_id: Optional[str] = None # @Required() resource_time_exception_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 CalendarExport(BaseModel): # @Required() company_id: Optional[str] = None # @Required() booking_id: int = 0 # @Required() exception_id: int = 0 calendar_sync: Optional[bool] = None calendar_id: Optional[str] = None is_exception_deleted: Optional[bool] = None modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ResourceTimeException(BaseModel, IInterval, IBaseModelCreated, IBaseModelUpdated): day_of_weeks: Optional[List[ResourceTimeExceptionDayOfWeekRelation]] = None resources: Optional[List[ResourceTimeExceptionResourceRelation]] = None # @Ignore() calendar_export: Optional[CalendarExport] = None # @Required() company_id: Optional[str] = None id: int = 0 # @Required() reason_text: Optional[str] = None # @Required() from_time: datetime.timedelta = datetime.timedelta() # @Required() to_time: datetime.timedelta = datetime.timedelta() # @Required() updated_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created_date: datetime.datetime = datetime.datetime(1, 1, 1) color: Optional[str] = None reason_text_public: Optional[str] = None # @Required() block_time: bool = False # @Required() private: bool = False 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 TimeExceptionReosurceDetails: # @ApiMember(Description="Ids of the resources that owns this exception") id: int = 0 """ Ids of the resources that owns this exception """ # @ApiMember(Description="Name of the resource") name: Optional[str] = None """ Name of the resource """ # @ApiMember(Description="Description of the resource") description: Optional[str] = None """ Description of the resource """ # @ApiMember(Description="Color of the resource") color: Optional[str] = None """ Color of the resource """ # @ApiMember(Description="Image of the resource") image_url: Optional[str] = None """ Image of the resource """ response_status: Optional[ResponseStatus] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ExceptionCalendarExportStatus: calendar_id: Optional[str] = None exception_id: int = 0 synced: Optional[bool] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DayOfWeekDto: day_of_week_id: int = 0 dot_net_day_of_week_id: int = 0 day_of_week: Optional[str] = None 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 class IBaseModelUpdated: updated_date: datetime.datetime = datetime.datetime(1, 1, 1) class IBaseModelCreated: created_date: datetime.datetime = datetime.datetime(1, 1, 1) @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ResourceTimeExceptionQueryResponse: # @ApiMember(Description="Time exception id") id: int = 0 """ Time exception id """ # @ApiMember(Description="Time company id") company_id: Optional[str] = None """ Time company id """ # @ApiMember(Description="If it's locked for editing for the logged in administrator") locked: bool = False """ If it's locked for editing for the logged in administrator """ # @ApiMember(Description="Resources that owns this exception") resource_ids: Optional[List[int]] = None """ Resources that owns this exception """ # @ApiMember(Description="Resources that owns this exception") resources: Optional[List[TimeExceptionReosurceDetails]] = None """ Resources that owns this exception """ # @ApiMember(Description="Indicates wheter or not the time exception is recurring") is_recurring: bool = False """ Indicates wheter or not the time exception is recurring """ # @ApiMember(Description="Time exception starting timestamp") from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) """ Time exception starting timestamp """ # @ApiMember(Description="Time exception ending timestamp") to: datetime.datetime = datetime.datetime(1, 1, 1) """ Time exception ending timestamp """ # @ApiMember(Description="If recurring then this value indicates the time of day when the time exception begins") from_time: datetime.timedelta = datetime.timedelta() """ If recurring then this value indicates the time of day when the time exception begins """ # @ApiMember(Description="If recurring then this value indicates the time of day when the time exception ends") to_time: datetime.timedelta = datetime.timedelta() """ If recurring then this value indicates the time of day when the time exception ends """ # @ApiMember(Description="The reason of the time exception, example: Vacation, doctors appointment, ...") reason_text: Optional[str] = None """ The reason of the time exception, example: Vacation, doctors appointment, ... """ # @ApiMember(Description="The reason of the time exception that could be public to customers, example: Vacation, Closed, Sick leave, ...") reason_text_public: Optional[str] = None """ The reason of the time exception that could be public to customers, example: Vacation, Closed, Sick leave, ... """ # @ApiMember(Description="What hexadecimal color code the exception should have in the scheduler") color: Optional[str] = None """ What hexadecimal color code the exception should have in the scheduler """ # @ApiMember(Description="If the time exception should block the time in the scheduler so it's not avaialable to book") block_time: bool = False """ If the time exception should block the time in the scheduler so it's not avaialable to book """ # @ApiMember(Description="If the ReasonText should only be visible to conncted resources. If false, all resources will be able to see it") private: bool = False """ If the ReasonText should only be visible to conncted resources. If false, all resources will be able to see it """ # @ApiMember(Description="The status for export to calendars like Gcal") calendar_export_status: Optional[ExceptionCalendarExportStatus] = None """ The status for export to calendars like Gcal """ # @ApiMember(Description="If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs") days_of_week: Optional[List[DayOfWeekDto]] = None """ If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs """ # @ApiMember(Description="The datetime the exception was created") created: datetime.datetime = datetime.datetime(1, 1, 1) """ The datetime the exception was created """ response_status: Optional[ResponseStatus] = None # @Route("/timeexceptions", "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") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ResourceTimeExceptionQuery(QueryDb2[ResourceTimeException, ResourceTimeExceptionQueryResponse], IReturn[QueryResponse[ResourceTimeExceptionQueryResponse]]): # @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.") company_id: Optional[str] = None """ The company id, if empty will use the company id for the user you are logged in with. """ # @ApiMember(Description="Enter the resource id's separated by comma that you want to see time exceptions for, if no value is given all time exceptions will be returned", ParameterType="query") resource_ids: Optional[List[int]] = None """ Enter the resource id's separated by comma that you want to see time exceptions for, if no value is given all time exceptions will be returned """ # @ApiMember(DataType="dateTime", Description="Start of interval to query for time exceptions. UTC+0 and parameter as defined by date-time - RFC3339") time_exception_start: Optional[datetime.datetime] = None """ Start of interval to query for time exceptions. UTC+0 and parameter as defined by date-time - RFC3339 """ # @ApiMember(DataType="dateTime", Description="End of interval to query for time exceptions. UTC+0 and parameter as defined by date-time - RFC3339") time_exception_end: Optional[datetime.datetime] = None """ End of interval to query for time exceptions. UTC+0 and parameter as defined by date-time - RFC3339 """ # @ApiMember(Description="Include only recurring time exceptions or not, if no value is given, all time exceptions will be returned", ParameterType="query") is_recurring: Optional[bool] = None """ Include only recurring time exceptions or not, if no value is given, all time exceptions will be returned """ # @ApiMember(Description="Include only time exceptions that are blocking, if no value is given, all time exceptions will be returned", ParameterType="query") is_blocking: Optional[bool] = None """ Include only time exceptions that are blocking, if no value is given, all time exceptions will be returned """ # @ApiMember(DataType="boolean", Description="If you want to include the resource details", ParameterType="query") include_resource_details: bool = False """ If you want to include the resource details """ # @ApiMember(DataType="boolean", Description="If you want to include google calendar sync status", ParameterType="query") include_calendar_export_status: bool = False """ If you want to include google calendar sync status """ # @ApiMember(DataType="int", Description="The max limit of records you want to retrieve, default is 200", ParameterType="query") max_limit: Optional[int] = None """ The max limit of records you want to retrieve, default is 200 """