""" Options: Date: 2024-12-03 18:02:07 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: CreateCustomer.* #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 AddCustomField: id: int = 0 value: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class AddUserAccessKey: id: Optional[str] = None company_id: Optional[str] = None access_key_type_id: int = 0 value: Optional[str] = None customer_id: Optional[str] = None description: Optional[str] = None @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 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 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 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class UpdateCustomerResponse(CustomerQueryResponse): facebook_user_name: Optional[str] = None user_id: Optional[str] = None company_id: Optional[str] = None created_date: Optional[datetime.datetime] = None deleted_access_keys: Optional[List[UserAccessKeys]] = None created_or_updated_access_keys: Optional[List[UserAccessKeys]] = None # @Route("/customers", "POST") # @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 CreateCustomer(IReturn[UpdateCustomerResponse]): # @ApiMember(Description="Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used.", ParameterType="query") company_id: Optional[str] = None """ Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used. """ # @ApiMember(IsRequired=true) firstname: Optional[str] = None # @ApiMember(IsRequired=true) lastname: Optional[str] = None # @ApiMember(IsRequired=true) phone: Optional[str] = None # @ApiMember() email: Optional[str] = None # @ApiMember(Description="If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated") custom_fields: Optional[List[AddCustomField]] = None """ If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated """ # @ApiMember(Description="List of Access Keys") access_keys: Optional[List[AddUserAccessKey]] = None """ List of Access Keys """ # @ApiMember(Description="Customer invoice adress") invoice_address: Optional[InvoiceAddress] = None """ Customer invoice adress """