import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class JsonDto implements IConvertible
{
JsonDto();
JsonDto.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "JsonDto";
TypeContext? context = _ctx;
}
class JsonRequestDto extends JsonDto implements IConvertible
{
String? ClientCode;
String? ClientRegistrationCode;
String? Token;
JsonRequestDto({this.ClientCode,this.ClientRegistrationCode,this.Token});
JsonRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ClientCode = json['ClientCode'];
ClientRegistrationCode = json['ClientRegistrationCode'];
Token = json['Token'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ClientCode': ClientCode,
'ClientRegistrationCode': ClientRegistrationCode,
'Token': Token
});
getTypeName() => "JsonRequestDto";
TypeContext? context = _ctx;
}
class JsonServerInformationRequest extends JsonRequestDto implements IConvertible
{
String? ClientHostName;
String? UserName;
bool? IsPro;
String? ClientId;
JsonServerInformationRequest({this.ClientHostName,this.UserName,this.IsPro,this.ClientId});
JsonServerInformationRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ClientHostName = json['ClientHostName'];
UserName = json['UserName'];
IsPro = json['IsPro'];
ClientId = json['ClientId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ClientHostName': ClientHostName,
'UserName': UserName,
'IsPro': IsPro,
'ClientId': ClientId
});
getTypeName() => "JsonServerInformationRequest";
TypeContext? context = _ctx;
}
class JsonServerInformationResponse extends JsonDto implements IConvertible
{
String? ClientIpAddress;
String? ClientGuid;
String? ClientName;
String? ClientId;
String? UserHomeFolder;
String? UserEmail;
String? ServerVersion;
bool? AllowUpdate;
String? FtpUsername;
String? FtpPassword;
String? AdminUsername;
String? AdminPassword;
int? FtpPort;
List<String>? SupportedDocumentFormats;
String? HpnVersion;
JsonServerInformationResponse({this.ClientIpAddress,this.ClientGuid,this.ClientName,this.ClientId,this.UserHomeFolder,this.UserEmail,this.ServerVersion,this.AllowUpdate,this.FtpUsername,this.FtpPassword,this.AdminUsername,this.AdminPassword,this.FtpPort,this.SupportedDocumentFormats,this.HpnVersion});
JsonServerInformationResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ClientIpAddress = json['ClientIpAddress'];
ClientGuid = json['ClientGuid'];
ClientName = json['ClientName'];
ClientId = json['ClientId'];
UserHomeFolder = json['UserHomeFolder'];
UserEmail = json['UserEmail'];
ServerVersion = json['ServerVersion'];
AllowUpdate = json['AllowUpdate'];
FtpUsername = json['FtpUsername'];
FtpPassword = json['FtpPassword'];
AdminUsername = json['AdminUsername'];
AdminPassword = json['AdminPassword'];
FtpPort = json['FtpPort'];
SupportedDocumentFormats = JsonConverters.fromJson(json['SupportedDocumentFormats'],'List<String>',context!);
HpnVersion = json['HpnVersion'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ClientIpAddress': ClientIpAddress,
'ClientGuid': ClientGuid,
'ClientName': ClientName,
'ClientId': ClientId,
'UserHomeFolder': UserHomeFolder,
'UserEmail': UserEmail,
'ServerVersion': ServerVersion,
'AllowUpdate': AllowUpdate,
'FtpUsername': FtpUsername,
'FtpPassword': FtpPassword,
'AdminUsername': AdminUsername,
'AdminPassword': AdminPassword,
'FtpPort': FtpPort,
'SupportedDocumentFormats': JsonConverters.toJson(SupportedDocumentFormats,'List<String>',context!),
'HpnVersion': HpnVersion
});
getTypeName() => "JsonServerInformationResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'buildmax.org', types: <String, TypeInfo> {
'JsonDto': TypeInfo(TypeOf.Class, create:() => JsonDto()),
'JsonRequestDto': TypeInfo(TypeOf.Class, create:() => JsonRequestDto()),
'JsonServerInformationRequest': TypeInfo(TypeOf.Class, create:() => JsonServerInformationRequest()),
'JsonServerInformationResponse': TypeInfo(TypeOf.Class, create:() => JsonServerInformationResponse()),
});
Dart JsonServerInformationRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/JsonServerInformationRequest HTTP/1.1
Host: buildmax.org
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<JsonServerInformationRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ScannerVision.WebService.Json.Dto">
<ClientCode>String</ClientCode>
<ClientRegistrationCode>String</ClientRegistrationCode>
<Token>String</Token>
<ClientHostName>String</ClientHostName>
<ClientId>String</ClientId>
<IsPro>false</IsPro>
<UserName>String</UserName>
</JsonServerInformationRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<JsonServerInformationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ScannerVision.WebService.Json.Dto">
<AdminPassword>String</AdminPassword>
<AdminUsername>String</AdminUsername>
<AllowUpdate>false</AllowUpdate>
<ClientGuid>String</ClientGuid>
<ClientId>String</ClientId>
<ClientIpAddress>String</ClientIpAddress>
<ClientName>String</ClientName>
<FtpPassword>String</FtpPassword>
<FtpPort>0</FtpPort>
<FtpUsername>String</FtpUsername>
<HpnVersion>String</HpnVersion>
<ServerVersion>String</ServerVersion>
<SupportedDocumentFormats xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</SupportedDocumentFormats>
<UserEmail>String</UserEmail>
<UserHomeFolder>String</UserHomeFolder>
</JsonServerInformationResponse>