/* Options: Date: 2024-11-21 16:56:50 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: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; class TokenResponse implements IConvertible { /** * The token indentifier */ // @ApiMember(Description="The token indentifier") String? TokenIdentifier; int? Type; /** * The unique token */ // @ApiMember(Description="The unique token", IsRequired=true) String? UniqueToken; DateTime? ExpirationDate; ResponseStatus? ResponseStatus; TokenResponse({this.TokenIdentifier,this.Type,this.UniqueToken,this.ExpirationDate,this.ResponseStatus}); TokenResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { TokenIdentifier = json['TokenIdentifier']; Type = json['Type']; UniqueToken = json['UniqueToken']; ExpirationDate = JsonConverters.fromJson(json['ExpirationDate'],'DateTime',context!); ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!); return this; } Map toJson() => { 'TokenIdentifier': TokenIdentifier, 'Type': Type, 'UniqueToken': UniqueToken, 'ExpirationDate': JsonConverters.toJson(ExpirationDate,'DateTime',context!), 'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!) }; getTypeName() => "TokenResponse"; TypeContext? context = _ctx; } // @Route("/token", "POST") // @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) // @ValidateRequest(Validator="IsAuthenticated") class GenerateToken implements IReturn, IConvertible, IPost { /** * The token identifier */ // @ApiMember(Description="The token identifier") String? TokenIdentifier; /** * The token type */ // @ApiMember(Description="The token type", IsRequired=true) int? Type; /** * The token expiration datetime */ // @ApiMember(Description="The token expiration datetime", IsRequired=true) DateTime? ExpirationDate; /** * The unique token.If empty a unique token will be generated automatically */ // @ApiMember(Description="The unique token.If empty a unique token will be generated automatically", IsRequired=true) String? UniqueToken; GenerateToken({this.TokenIdentifier,this.Type,this.ExpirationDate,this.UniqueToken}); GenerateToken.fromJson(Map json) { fromMap(json); } fromMap(Map json) { TokenIdentifier = json['TokenIdentifier']; Type = json['Type']; ExpirationDate = JsonConverters.fromJson(json['ExpirationDate'],'DateTime',context!); UniqueToken = json['UniqueToken']; return this; } Map toJson() => { 'TokenIdentifier': TokenIdentifier, 'Type': Type, 'ExpirationDate': JsonConverters.toJson(ExpirationDate,'DateTime',context!), 'UniqueToken': UniqueToken }; createResponse() => TokenResponse(); getResponseTypeName() => "TokenResponse"; getTypeName() => "GenerateToken"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: { 'TokenResponse': TypeInfo(TypeOf.Class, create:() => TokenResponse()), 'GenerateToken': TypeInfo(TypeOf.Class, create:() => GenerateToken()), });