/* Options: Date: 2024-11-21 12:18:52 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: NewsItemQuery.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; abstract class IInterval { DateTime? From; DateTime? To; } class BaseModel implements IConvertible { BaseModel(); BaseModel.fromJson(Map json) : super(); fromMap(Map json) { return this; } Map toJson() => {}; getTypeName() => "BaseModel"; TypeContext? context = _ctx; } class NewsItem extends BaseModel implements IInterval, IConvertible { // @Ignore() bool? Active; // @Required() String? CompanyId; int? Id; // @Required() String? Heading; // @Required() String? Body; String? ImageUrl; // @Required() DateTime? Updated; // @Required() DateTime? Created; DateTime? ModifiedDate; // @Required() DateTime? From; // @Required() DateTime? To; NewsItem({this.Active,this.CompanyId,this.Id,this.Heading,this.Body,this.ImageUrl,this.Updated,this.Created,this.ModifiedDate,this.From,this.To}); NewsItem.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); Active = json['Active']; CompanyId = json['CompanyId']; Id = json['Id']; Heading = json['Heading']; Body = json['Body']; ImageUrl = json['ImageUrl']; Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!); Created = JsonConverters.fromJson(json['Created'],'DateTime',context!); ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!); From = JsonConverters.fromJson(json['From'],'DateTime',context!); To = JsonConverters.fromJson(json['To'],'DateTime',context!); return this; } Map toJson() => super.toJson()..addAll({ 'Active': Active, 'CompanyId': CompanyId, 'Id': Id, 'Heading': Heading, 'Body': Body, 'ImageUrl': ImageUrl, 'Updated': JsonConverters.toJson(Updated,'DateTime',context!), 'Created': JsonConverters.toJson(Created,'DateTime',context!), 'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!), 'From': JsonConverters.toJson(From,'DateTime',context!), 'To': JsonConverters.toJson(To,'DateTime',context!) }); getTypeName() => "NewsItem"; TypeContext? context = _ctx; } class NewsItemQueryResponse implements IConvertible { /** * The news item id */ // @ApiMember(Description="The news item id") int? Id; /** * Heading of the news item */ // @ApiMember(Description="Heading of the news item") String? Heading; /** * Body of the news item */ // @ApiMember(Description="Body of the news item") String? Body; /** * Url to a image associated with the news */ // @ApiMember(Description="Url to a image associated with the news") Uri? ImageUrl; /** * The timestamp from which the newsitem should be visible from */ // @ApiMember(Description="The timestamp from which the newsitem should be visible from", IsRequired=true) DateTime? From; /** * The timestamp to which the newsitem should be visible to */ // @ApiMember(Description="The timestamp to which the newsitem should be visible to", IsRequired=true) DateTime? To; /** * The timestamp when news was created */ // @ApiMember(Description="The timestamp when news was created", IsRequired=true) DateTime? Created; ResponseStatus? ResponseStatus; NewsItemQueryResponse({this.Id,this.Heading,this.Body,this.ImageUrl,this.From,this.To,this.Created,this.ResponseStatus}); NewsItemQueryResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Heading = json['Heading']; Body = json['Body']; ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!); From = JsonConverters.fromJson(json['From'],'DateTime',context!); To = JsonConverters.fromJson(json['To'],'DateTime',context!); Created = JsonConverters.fromJson(json['Created'],'DateTime',context!); ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!); return this; } Map toJson() => { 'Id': Id, 'Heading': Heading, 'Body': Body, 'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!), 'From': JsonConverters.toJson(From,'DateTime',context!), 'To': JsonConverters.toJson(To,'DateTime',context!), 'Created': JsonConverters.toJson(Created,'DateTime',context!), 'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!) }; getTypeName() => "NewsItemQueryResponse"; TypeContext? context = _ctx; } // @Route("/news", "GET") class NewsItemQuery extends QueryDb2 implements IReturn>, IConvertible, IGet { /** * Enter the company you want to see news for, if blank and you are an admin, your company id will be used */ // @ApiMember(Description="Enter the company you want to see news for, if blank and you are an admin, your company id will be used", ParameterType="query") String? CompanyId; /** * Enter the From Date you want to see news from, only allowed if admin */ // @ApiMember(DataType="dateTime", Description="Enter the From Date you want to see news from, only allowed if admin", ParameterType="query") DateTime? From; /** * Enter the To Date you want to see news to, only allowed if admin */ // @ApiMember(DataType="dateTime", Description="Enter the To Date you want to see news to, only allowed if admin", ParameterType="query") DateTime? To; /** * Use this parameter if you want to only show active news */ // @ApiMember(DataType="boolean", Description="Use this parameter if you want to only show active news") bool? Active; /** * The homeage sitepath. */ // @ApiMember(Description="The homeage sitepath.") String? SitePath; /** * If you want to remove Html tags from newsbody and show as plain text. */ // @ApiMember(Description="If you want to remove Html tags from newsbody and show as plain text.") bool? PlainText; NewsItemQuery({this.CompanyId,this.From,this.To,this.Active,this.SitePath,this.PlainText}); NewsItemQuery.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); CompanyId = json['CompanyId']; From = JsonConverters.fromJson(json['From'],'DateTime',context!); To = JsonConverters.fromJson(json['To'],'DateTime',context!); Active = json['Active']; SitePath = json['SitePath']; PlainText = json['PlainText']; return this; } Map toJson() => super.toJson()..addAll({ 'CompanyId': CompanyId, 'From': JsonConverters.toJson(From,'DateTime',context!), 'To': JsonConverters.toJson(To,'DateTime',context!), 'Active': Active, 'SitePath': SitePath, 'PlainText': PlainText }); createResponse() => QueryResponse(); getResponseTypeName() => "QueryResponse"; getTypeName() => "NewsItemQuery"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: { 'IInterval': TypeInfo(TypeOf.Interface), 'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()), 'NewsItem': TypeInfo(TypeOf.Class, create:() => NewsItem()), 'NewsItemQueryResponse': TypeInfo(TypeOf.Class, create:() => NewsItemQueryResponse()), 'Uri': TypeInfo(TypeOf.Class, create:() => Uri()), 'QueryResponse': TypeInfo(TypeOf.Class, create:() => QueryResponse()), 'NewsItemQuery': TypeInfo(TypeOf.Class, create:() => NewsItemQuery()), 'List': TypeInfo(TypeOf.Class, create:() => []), });