""" Options: Date: 2024-11-21 13:00:15 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: GenerateToken.* #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 TokenResponse: # @ApiMember(Description="The token indentifier") token_identifier: Optional[str] = None """ The token indentifier """ type: int = 0 # @ApiMember(Description="The unique token", IsRequired=true) unique_token: Optional[str] = None """ The unique token """ expiration_date: datetime.datetime = datetime.datetime(1, 1, 1) response_status: Optional[ResponseStatus] = None # @Route("/token", "POST") # @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 GenerateToken(IReturn[TokenResponse]): # @ApiMember(Description="The token identifier") token_identifier: Optional[str] = None """ The token identifier """ # @ApiMember(Description="The token type", IsRequired=true) type: int = 0 """ The token type """ # @ApiMember(Description="The token expiration datetime", IsRequired=true) expiration_date: datetime.datetime = datetime.datetime(1, 1, 1) """ The token expiration datetime """ # @ApiMember(Description="The unique token.If empty a unique token will be generated automatically", IsRequired=true) unique_token: Optional[str] = None """ The unique token.If empty a unique token will be generated automatically """