""" Options: Date: 2024-11-21 11:32:34 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: CustomerQuery.* #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 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BaseModel: pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class UserAccessKeys(BaseModel): # @Required() company_id: Optional[str] = None # @Required() access_key_type_id: int = 0 # @Required() value: Optional[str] = None # @Required() customer_id: Optional[str] = None description: Optional[str] = None # @Required() id: Optional[str] = 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 Customer(BaseModel, IUser, ICustomFieldTable): identity_id: int = 0 id: Optional[str] = None # @Ignore() customer_id: Optional[str] = None # @Ignore() access_keys: Optional[IList[UserAccessKeys]] = None email: Optional[str] = None # @Ignore() external_references: Optional[IList[ExternalReference]] = None # @Ignore() company: Optional[Company] = None # @Ignore() custom_fields_config: Optional[IList[CustomFieldConfig]] = None # @Ignore() custom_fields_data: Optional[IList[CustomFieldDataResponse]] = None # @Ignore() comments: Optional[IList[CustomerComment]] = None # @Ignore() rebate_codes: Optional[IList[RebateCode]] = None firstname: Optional[str] = None # @Ignore() image_url: Optional[str] = None # @Required() active: bool = False facebook_username: Optional[str] = None # @Required() updated: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created: datetime.datetime = datetime.datetime(1, 1, 1) ip_address: Optional[str] = None modified_date: Optional[datetime.datetime] = 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 user_id: Optional[str] = None lastname: Optional[str] = None phone: 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 # @Required() company_id: Optional[str] = None subscribed_to_newsletter: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class InvoiceAddress: 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 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldValueResponse: value: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldConfigData: # @ApiMember(Description="Custom field id") id: int = 0 """ Custom field id """ # @ApiMember(Description="Configuration name. Example: 'Number of persons'.") name: Optional[str] = None """ Configuration name. Example: 'Number of persons'. """ # @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="Field width. Example: 20 for 20px") width: Optional[int] = None """ Field width. Example: 20 for 20px """ # @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="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="The values to select from if Datatype is DropDown for this custom field") values: Optional[List[CustomFieldValueResponse]] = None """ The values to select from if Datatype is DropDown for this custom field """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Customer: city: Optional[str] = None country_code: Optional[str] = None identity_number: Optional[str] = None email: Optional[str] = None first_name: Optional[str] = None last_name: Optional[str] = None phone: Optional[str] = None postal_code: Optional[str] = None street: Optional[str] = None reference: Optional[str] = None type: Optional[CustomerType] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomerCommentsResponse: id: int = 0 customer_id: Optional[str] = None comments: Optional[str] = None updated: datetime.datetime = datetime.datetime(1, 1, 1) created: datetime.datetime = datetime.datetime(1, 1, 1) image_url: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomerQueryResponse: id: Optional[str] = None firstname: Optional[str] = None lastname: Optional[str] = None email: Optional[str] = None phone: Optional[str] = None image_url: Optional[str] = None custom_fields: Optional[List[CustomFieldConfigData]] = None custom_field_values: Optional[List[CustomFieldDataResponse]] = None comments: Optional[List[CustomerCommentsResponse]] = None access_keys: Optional[List[UserAccessKeys]] = None updated: datetime.datetime = datetime.datetime(1, 1, 1) created: datetime.datetime = datetime.datetime(1, 1, 1) response_status: Optional[Object] = None subscribed_to_newsletter: bool = False invoice_address: Optional[InvoiceAddress] = None # @Route("/customers", "GET") # @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomerQuery(QueryDb2[Customer, CustomerQueryResponse], IReturn[QueryResponse[CustomerQueryResponse]]): # @ApiMember(Description="Enter the company and id you want to see the information for a customer, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown ", IsRequired=true, ParameterType="query") company_id: Optional[str] = None """ Enter the company and id you want to see the information for a customer, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown """ # @ApiMember(Description="Enter the customer id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info.", ParameterType="query") customer_id: Optional[str] = None """ Enter the customer id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info. """ # @ApiMember(Description="Enter the user id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info. User Id is the userprofile", ParameterType="query") user_id: Optional[str] = None """ Enter the user id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info. User Id is the userprofile """ # @ApiMember(Description="Will search by any customer name,phone or email that contains the searchstring provided.", ParameterType="query") search: Optional[str] = None """ Will search by any customer name,phone or email that contains the searchstring provided. """ # @ApiMember(Description="If you want to filter on visible customers.", ParameterType="query") visible: Optional[bool] = None """ If you want to filter on visible customers. """ # @ApiMember(DataType="boolean", Description="If you want to include the connected custom fields", ParameterType="query") include_custom_field_values: bool = False """ If you want to include the connected custom fields """ # @ApiMember(DataType="boolean", Description="If you want to include the connected custom fields", ParameterType="query") include_custom_fields: bool = False """ If you want to include the connected custom fields """ # @ApiMember(DataType="boolean", Description="If you want to include the comments on the customer", ParameterType="query") include_comments: bool = False """ If you want to include the comments on the customer """ # @ApiMember(Description="If you want to include the accesskeys") include_access_keys: bool = False """ If you want to include the accesskeys """ # @ApiMember(Description="If you want to include invoice address") include_invoice_address: bool = False """ If you want to include invoice address """