/* Options: Date: 2026-03-13 22:09:56 Version: 8.60 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://milliet.io //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: url_shortener.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; enum operationType { NoOperation, ShortenUrl, GetOriginalUrl, RedirectUrl, } class url_shortenerResponse implements IConvertible { String? tiny_url; String? original_url; DateTime? created_date; DateTime? expiry_date; int? collision; url_shortenerResponse({this.tiny_url,this.original_url,this.created_date,this.expiry_date,this.collision}); url_shortenerResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { tiny_url = json['tiny_url']; original_url = json['original_url']; created_date = JsonConverters.fromJson(json['created_date'],'DateTime',context!); expiry_date = JsonConverters.fromJson(json['expiry_date'],'DateTime',context!); collision = json['collision']; return this; } Map toJson() => { 'tiny_url': tiny_url, 'original_url': original_url, 'created_date': JsonConverters.toJson(created_date,'DateTime',context!), 'expiry_date': JsonConverters.toJson(expiry_date,'DateTime',context!), 'collision': collision }; getTypeName() => "url_shortenerResponse"; TypeContext? context = _ctx; } // @Route("/url_shortener", "GET,POST") class url_shortener implements IReturn, IConvertible, IPost { /** * operation type */ // @ApiMember(DataType="string", Description="operation type", IsRequired=true, Name="operation", ParameterType="body") operationType? operation; /** * url */ // @ApiMember(DataType="string", Description="url", IsRequired=true, Name="url", ParameterType="body") String? url; /** * days to expire */ // @ApiMember(DataType="string", Description="days to expire", Name="days", ParameterType="body") double? days; url_shortener({this.operation,this.url,this.days}); url_shortener.fromJson(Map json) { fromMap(json); } fromMap(Map json) { operation = JsonConverters.fromJson(json['operation'],'operationType',context!); url = json['url']; days = JsonConverters.toDouble(json['days']); return this; } Map toJson() => { 'operation': JsonConverters.toJson(operation,'operationType',context!), 'url': url, 'days': days }; createResponse() => url_shortenerResponse(); getResponseTypeName() => "url_shortenerResponse"; getTypeName() => "url_shortener"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'milliet.io', types: { 'operationType': TypeInfo(TypeOf.Enum, enumValues:operationType.values), 'url_shortenerResponse': TypeInfo(TypeOf.Class, create:() => url_shortenerResponse()), 'url_shortener': TypeInfo(TypeOf.Class, create:() => url_shortener()), });