/* Options: Date: 2025-05-05 01:32:44 Version: 8.71 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://team.evovoice.io //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: ListMessages.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart,dart:typed_data */ import 'package:servicestack/servicestack.dart'; import 'dart:typed_data'; enum SortOrders { Ascend, Descend, } abstract class ListRequest implements IGet { /** * The page of data to retrieve */ // @ApiMember(Description="The page of data to retrieve") int? page; /** * If you want all objects to be returned. This should be used with care */ // @ApiMember(Description="If you want all objects to be returned. This should be used with care") bool? all; /** * The number per page to retrieve */ // @ApiMember(Description="The number per page to retrieve") int? countPerPage; /** * Specific IDs */ // @ApiMember(Description="Specific IDs") List? specificIds; /** * Specify a sort field */ // @ApiMember(Description="Specify a sort field") String? sortField; /** * Specify a sort order */ // @ApiMember(Description="Specify a sort order") SortOrders? sortOrder; /** * Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array */ // @ApiMember(Description="Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array") bool? simplifiedPaging; ListRequest({this.page,this.all,this.countPerPage,this.specificIds,this.sortField,this.sortOrder,this.simplifiedPaging}); ListRequest.fromJson(Map json) { fromMap(json); } fromMap(Map json) { page = json['page']; all = json['all']; countPerPage = json['countPerPage']; specificIds = JsonConverters.fromJson(json['specificIds'],'List',context!); sortField = json['sortField']; sortOrder = JsonConverters.fromJson(json['sortOrder'],'SortOrders',context!); simplifiedPaging = json['simplifiedPaging']; return this; } Map toJson() => { 'page': page, 'all': all, 'countPerPage': countPerPage, 'specificIds': JsonConverters.toJson(specificIds,'List',context!), 'sortField': sortField, 'sortOrder': JsonConverters.toJson(sortOrder,'SortOrders',context!), 'simplifiedPaging': simplifiedPaging }; getTypeName() => "ListRequest<$T>"; TypeContext? context = _ctx; } class ListResponse implements IConvertible { /** * The items */ // @ApiMember(Description="The items") List? items; /** * The total number of items */ // @ApiMember(Description="The total number of items") int? totalCount; /** * The total number of pages */ // @ApiMember(Description="The total number of pages") int? totalPages; /** * Are there more pages of items? Used with simplified paging */ // @ApiMember(Description="Are there more pages of items? Used with simplified paging") bool? hasMorePages; ListResponse({this.items,this.totalCount,this.totalPages,this.hasMorePages}); ListResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { items = JsonConverters.fromJson(json['items'],'List<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!); totalCount = json['totalCount']; totalPages = json['totalPages']; hasMorePages = json['hasMorePages']; return this; } Map toJson() => { 'items': JsonConverters.toJson(items,'List',context!), 'totalCount': totalCount, 'totalPages': totalPages, 'hasMorePages': hasMorePages }; getTypeName() => "ListResponse<$T>"; TypeContext? context = _ctx; } enum MessageDirections { Incoming, Outgoing, } class MessageInfo implements IConvertible { String? id; String? accountId; String? customerId; String? endpointId; String? endpointDisplayName; String? date; MessageDirections? direction; String? otherAddress; String? sender; String? text; bool? isUnread; MessageInfo({this.id,this.accountId,this.customerId,this.endpointId,this.endpointDisplayName,this.date,this.direction,this.otherAddress,this.sender,this.text,this.isUnread}); MessageInfo.fromJson(Map json) { fromMap(json); } fromMap(Map json) { id = json['id']; accountId = json['accountId']; customerId = json['customerId']; endpointId = json['endpointId']; endpointDisplayName = json['endpointDisplayName']; date = json['date']; direction = JsonConverters.fromJson(json['direction'],'MessageDirections',context!); otherAddress = json['otherAddress']; sender = json['sender']; text = json['text']; isUnread = json['isUnread']; return this; } Map toJson() => { 'id': id, 'accountId': accountId, 'customerId': customerId, 'endpointId': endpointId, 'endpointDisplayName': endpointDisplayName, 'date': date, 'direction': JsonConverters.toJson(direction,'MessageDirections',context!), 'otherAddress': otherAddress, 'sender': sender, 'text': text, 'isUnread': isUnread }; getTypeName() => "MessageInfo"; TypeContext? context = _ctx; } // @Route("/messages", "GET") class ListMessages extends ListRequest implements IReturn>, IConvertible, IGet { /** * The IDs of the account whose messages you want to retrieve */ // @ApiMember(Description="The IDs of the account whose messages you want to retrieve") List? accountIds; /** * The IDs of the customers whose messages you want to retrieve */ // @ApiMember(Description="The IDs of the customers whose messages you want to retrieve") List? customerIds; /** * The IDs of the endpoints whose messages you want to retrieve */ // @ApiMember(Description="The IDs of the endpoints whose messages you want to retrieve") List? endpointIds; /** * The ID of the conversations whose messages you want to retrieve */ // @ApiMember(Description="The ID of the conversations whose messages you want to retrieve") List? conversationIds; /** * The date after which messages should be retrieved */ // @ApiMember(Description="The date after which messages should be retrieved") String? afterDate; ListMessages({this.accountIds,this.customerIds,this.endpointIds,this.conversationIds,this.afterDate}); ListMessages.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); accountIds = JsonConverters.fromJson(json['accountIds'],'List',context!); customerIds = JsonConverters.fromJson(json['customerIds'],'List',context!); endpointIds = JsonConverters.fromJson(json['endpointIds'],'List',context!); conversationIds = JsonConverters.fromJson(json['conversationIds'],'List',context!); afterDate = json['afterDate']; return this; } Map toJson() => super.toJson()..addAll({ 'accountIds': JsonConverters.toJson(accountIds,'List',context!), 'customerIds': JsonConverters.toJson(customerIds,'List',context!), 'endpointIds': JsonConverters.toJson(endpointIds,'List',context!), 'conversationIds': JsonConverters.toJson(conversationIds,'List',context!), 'afterDate': afterDate }); createResponse() => ListResponse(); getResponseTypeName() => "ListResponse"; getTypeName() => "ListMessages"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: { 'SortOrders': TypeInfo(TypeOf.Enum, enumValues:SortOrders.values), 'ListRequest': TypeInfo(TypeOf.GenericDef,create:() => ListRequest()), 'ListResponse': TypeInfo(TypeOf.GenericDef,create:() => ListResponse()), 'MessageDirections': TypeInfo(TypeOf.Enum, enumValues:MessageDirections.values), 'MessageInfo': TypeInfo(TypeOf.Class, create:() => MessageInfo()), 'ListResponse': TypeInfo(TypeOf.Class, create:() => ListResponse()), 'ListMessages': TypeInfo(TypeOf.Class, create:() => ListMessages()), });