/* Options: Date: 2024-12-22 22:03:33 Version: 8.51 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazor-gallery.servicestack.net //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: CreateProfile.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart,dart:typed_data */ import 'package:servicestack/servicestack.dart'; import 'dart:typed_data'; enum PlayerRole { Leader, Player, NonPlayer, } enum PlayerRegion { Africa, Americas, Asia, Australasia, Europe, } class Profile extends AuditBase implements IConvertible { int? id; PlayerRole? role; PlayerRegion? region; String? username; int? highScore; int? gamesPlayed; int? energy; String? profileUrl; String? coverUrl; Map? meta; Profile({this.id,this.role,this.region,this.username,this.highScore,this.gamesPlayed,this.energy,this.profileUrl,this.coverUrl,this.meta}); Profile.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); id = json['id']; role = JsonConverters.fromJson(json['role'],'PlayerRole',context!); region = JsonConverters.fromJson(json['region'],'PlayerRegion',context!); username = json['username']; highScore = json['highScore']; gamesPlayed = json['gamesPlayed']; energy = json['energy']; profileUrl = json['profileUrl']; coverUrl = json['coverUrl']; meta = JsonConverters.toStringMap(json['meta']); return this; } Map toJson() => super.toJson()..addAll({ 'id': id, 'role': JsonConverters.toJson(role,'PlayerRole',context!), 'region': JsonConverters.toJson(region,'PlayerRegion',context!), 'username': username, 'highScore': highScore, 'gamesPlayed': gamesPlayed, 'energy': energy, 'profileUrl': profileUrl, 'coverUrl': coverUrl, 'meta': meta }); getTypeName() => "Profile"; TypeContext? context = _ctx; } class CreateProfile implements IReturn, ICreateDb, IConvertible, IPost { PlayerRole? role; PlayerRegion? region; // @Validate(Validator="NotEmpty") String? username; int? highScore; int? gamesPlayed; // @Validate(Validator="InclusiveBetween(0,100)") int? energy; String? profileUrl; String? coverUrl; CreateProfile({this.role,this.region,this.username,this.highScore,this.gamesPlayed,this.energy,this.profileUrl,this.coverUrl}); CreateProfile.fromJson(Map json) { fromMap(json); } fromMap(Map json) { role = JsonConverters.fromJson(json['role'],'PlayerRole',context!); region = JsonConverters.fromJson(json['region'],'PlayerRegion',context!); username = json['username']; highScore = json['highScore']; gamesPlayed = json['gamesPlayed']; energy = json['energy']; profileUrl = json['profileUrl']; coverUrl = json['coverUrl']; return this; } Map toJson() => { 'role': JsonConverters.toJson(role,'PlayerRole',context!), 'region': JsonConverters.toJson(region,'PlayerRegion',context!), 'username': username, 'highScore': highScore, 'gamesPlayed': gamesPlayed, 'energy': energy, 'profileUrl': profileUrl, 'coverUrl': coverUrl }; createResponse() => IdResponse(); getResponseTypeName() => "IdResponse"; getTypeName() => "CreateProfile"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'blazor_gallery.servicestack.net', types: { 'PlayerRole': TypeInfo(TypeOf.Enum, enumValues:PlayerRole.values), 'PlayerRegion': TypeInfo(TypeOf.Enum, enumValues:PlayerRegion.values), 'Profile': TypeInfo(TypeOf.Class, create:() => Profile()), 'CreateProfile': TypeInfo(TypeOf.Class, create:() => CreateProfile()), });