""" Options: Date: 2024-11-23 22:13:20 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: UpdateCustomField.* #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 CustomFieldGroupValue: sort_order: Optional[int] = None value: Optional[str] = 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/{Id}", "PUT") # @ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400) # @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401) # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class UpdateCustomField(IReturn[CustomFieldQueryResponse], ICompany): # @ApiMember(Description="Custom field id", IsRequired=true, ParameterType="path") id: int = 0 """ Custom field id """ # @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="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'.", IsRequired=true) name: Optional[str] = None """ Configuration name. Example: 'Number of persons'. """ # @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'", IsRequired=true) description: Optional[str] = None """ Custom field description. Example: 'For how many persons is this booking?' """ # @ApiMember(Description="Custom field icon id. Example: '1 House,2 Calendar,3 Building,4 Cart,5 Find,6 Blue flag,7 Green flag,8 Information,9 Lightning,10 Page edit,11 Pencil,12 Link,13 Star,14 User,15 Tick,16 Wrench,17 Clock'", IsRequired=true) icon_id: int = 0 """ Custom field icon id. Example: '1 House,2 Calendar,3 Building,4 Cart,5 Find,6 Blue flag,7 Green flag,8 Information,9 Lightning,10 Page edit,11 Pencil,12 Link,13 Star,14 User,15 Tick,16 Wrench,17 Clock' """ # @ApiMember(Description="Field width. Example: 20") width: int = 0 """ Field width. Example: 20 """ # @ApiMember(Description="Data field of custom field. Valid values are: TextBox, DropDown Example: 'TextBox'") datatype: Optional[str] = None """ Data field of custom field. Valid values are: TextBox, DropDown 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. Default is false") is_mandatory: Optional[bool] = None """ Determines if the field is required to have a value or not. Default is false """ # @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. Default is 500", IsRequired=true) max_length: int = 0 """ Max lenght of the field. Default is 500 """ # @ApiMember(Description="If the field should have multiple lines. Defualt is false") multiple_line_text: Optional[bool] = None """ If the field should have multiple lines. Defualt is false """ # @ApiMember(Description="Regular expression used for validation of the field") reg_ex_id: Optional[int] = None """ Regular expression used 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. Default is true") is_public: Optional[bool] = None """ If the field is visible to the customer. Default is true """ # @ApiMember(Description="If the field should be hidden in lists. Default is false") is_hidden: Optional[bool] = None """ If the field should be hidden in lists. Default is false """ # @ApiMember(Description="The values to select from if Datatype is DropDown for this custom field") values: Optional[List[CustomFieldGroupValue]] = 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. If null it will be connected to all services.") services: Optional[List[CustomFieldServices]] = None """ The services that is connected to the custom field. If null it will be connected to all services. """