""" Options: Date: 2024-11-21 11:37:03 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: CustomFieldQuery.* #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 ICompany: company_id: Optional[str] = None @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 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldServices: 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 CustomFieldLookupResponse: id: Optional[int] = None active: Optional[bool] = None sort_order: Optional[int] = None value: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldQueryResponse: # @ApiMember(Description="Custom field id") id: int = 0 """ Custom field id """ # @ApiMember(Description="Reference to company that owns the custom field configuration") company_id: Optional[str] = None """ Reference to company that owns the custom field configuration """ # @ApiMember(Description="Group id") group_id: Optional[int] = None """ Group id """ # @ApiMember(Description="Field id") field_id: int = 0 """ Field id """ # @ApiMember(Description="Configuration name. Example: 'Number of persons'.") name: Optional[str] = None """ Configuration name. Example: 'Number of persons'. """ # @ApiMember(Description="Field width. Example: 20") width: int = 0 """ Field width. Example: 20 """ # @ApiMember(Description="Column in database where to store the information. Example: 'TextField1'") column: Optional[str] = None """ Column in database where to store the information. Example: 'TextField1' """ # @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'") description: Optional[str] = None """ Custom field description. Example: 'For how many persons is this booking?' """ # @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' """ # @ApiMember(Description="Default value of the field. Example: '3'") default_value: Optional[str] = None """ Default value of the field. Example: '3' """ # @ApiMember(Description="Determines if the field is required to have a value or not") is_mandatory: bool = False """ Determines if the field is required to have a value or not """ # @ApiMember(Description="Error message shown to the user if the field data is required but not entered") mandatory_error_message: Optional[str] = None """ Error message shown to the user if the field data is required but not entered """ # @ApiMember(Description="Max lenght of the field") max_length: int = 0 """ Max lenght of the field """ # @ApiMember(Description="If the field should have multiple lines") multiple_line_text: bool = False """ If the field should have multiple lines """ # @ApiMember(Description="Regular expression used for validation of the field") reg_ex: Optional[str] = None """ Regular expression used for validation of the field """ # @ApiMember(Description="Regular expression id for validation of the field") reg_ex_id: Optional[int] = None """ Regular expression id for validation of the field """ # @ApiMember(Description="Error message shown if the regular expression validation failed") reg_ex_error_message: Optional[str] = None """ Error message shown if the regular expression validation failed """ # @ApiMember(Description="If the field is visible to the customer") is_public: bool = False """ If the field is visible to the customer """ # @ApiMember(Description="If the field should be hidden in lists") is_hidden: bool = False """ If the field should be hidden in lists """ # @ApiMember(Description="Table to which the field belongs") table: Optional[str] = None """ Table to which the field belongs """ # @ApiMember(Description="The values to select from if Datatype is DropDown for this custom field") values: Optional[List[CustomFieldLookupResponse]] = None """ The values to select from if Datatype is DropDown for this custom field """ # @ApiMember(Description="The services that is connected to the custom field") services: Optional[List[CustomFieldServices]] = None """ The services that is connected to the custom field """ # @Route("/customfields", "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 CustomFieldQuery(QueryDb2[CustomFieldConfig, CustomFieldQueryResponse], IReturn[QueryResponse[CustomFieldQueryResponse]], ICompany): # @ApiMember(Description="One or multiple id's of custom fields to find", ParameterType="query") ids: Optional[List[int]] = None """ One or multiple id's of custom fields to find """ # @ApiMember(Description="Company id to find custom fields for", ParameterType="query") company_id: Optional[str] = None """ Company id to find custom fields for """ # @ApiMember(Description="Table to which the custom field belongs to", ParameterType="query") table: Optional[str] = None """ Table to which the custom field belongs to """ # @ApiMember(Description="Active or removed fields, empty parameter includes both", ParameterType="query") active: Optional[bool] = None """ Active or removed fields, empty parameter includes both """ # @ApiMember(Description="If you want to include the custom fields values to select from when using dropdown as datatype", ParameterType="query") include_custom_field_values: bool = False """ If you want to include the custom fields values to select from when using dropdown as datatype """ # @ApiMember(DataType="bool", Description="If you want to include the connected services for the custom field", ParameterType="query") include_connected_services: bool = False """ If you want to include the connected services for the custom field """