import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
// @DataContract
class AnalyticsLogInfo implements IConvertible
{
// @DataMember(Order=1)
int? id;
// @DataMember(Order=2)
DateTime? dateTime;
// @DataMember(Order=3)
String? browser;
// @DataMember(Order=4)
String? device;
// @DataMember(Order=5)
String? bot;
// @DataMember(Order=6)
String? op;
// @DataMember(Order=7)
String? userId;
// @DataMember(Order=8)
String? userName;
// @DataMember(Order=9)
String? apiKey;
// @DataMember(Order=10)
String? ip;
AnalyticsLogInfo({this.id,this.dateTime,this.browser,this.device,this.bot,this.op,this.userId,this.userName,this.apiKey,this.ip});
AnalyticsLogInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
dateTime = JsonConverters.fromJson(json['dateTime'],'DateTime',context!);
browser = json['browser'];
device = json['device'];
bot = json['bot'];
op = json['op'];
userId = json['userId'];
userName = json['userName'];
apiKey = json['apiKey'];
ip = json['ip'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'dateTime': JsonConverters.toJson(dateTime,'DateTime',context!),
'browser': browser,
'device': device,
'bot': bot,
'op': op,
'userId': userId,
'userName': userName,
'apiKey': apiKey,
'ip': ip
};
getTypeName() => "AnalyticsLogInfo";
TypeContext? context = _ctx;
}
// @DataContract
class GetAnalyticsInfoResponse implements IConvertible
{
// @DataMember(Order=1)
List<String>? months;
// @DataMember(Order=2)
AnalyticsLogInfo? result;
// @DataMember(Order=3)
ResponseStatus? responseStatus;
GetAnalyticsInfoResponse({this.months,this.result,this.responseStatus});
GetAnalyticsInfoResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
months = JsonConverters.fromJson(json['months'],'List<String>',context!);
result = JsonConverters.fromJson(json['result'],'AnalyticsLogInfo',context!);
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'months': JsonConverters.toJson(months,'List<String>',context!),
'result': JsonConverters.toJson(result,'AnalyticsLogInfo',context!),
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "GetAnalyticsInfoResponse";
TypeContext? context = _ctx;
}
// @DataContract
class GetAnalyticsInfo implements IGet, IConvertible
{
// @DataMember(Order=1)
DateTime? month;
// @DataMember(Order=2)
String? type;
// @DataMember(Order=3)
String? op;
// @DataMember(Order=4)
String? apiKey;
// @DataMember(Order=5)
String? userId;
// @DataMember(Order=6)
String? ip;
GetAnalyticsInfo({this.month,this.type,this.op,this.apiKey,this.userId,this.ip});
GetAnalyticsInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
month = JsonConverters.fromJson(json['month'],'DateTime',context!);
type = json['type'];
op = json['op'];
apiKey = json['apiKey'];
userId = json['userId'];
ip = json['ip'];
return this;
}
Map<String, dynamic> toJson() => {
'month': JsonConverters.toJson(month,'DateTime',context!),
'type': type,
'op': op,
'apiKey': apiKey,
'userId': userId,
'ip': ip
};
getTypeName() => "GetAnalyticsInfo";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
'AnalyticsLogInfo': TypeInfo(TypeOf.Class, create:() => AnalyticsLogInfo()),
'GetAnalyticsInfoResponse': TypeInfo(TypeOf.Class, create:() => GetAnalyticsInfoResponse()),
'GetAnalyticsInfo': TypeInfo(TypeOf.Class, create:() => GetAnalyticsInfo()),
});
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/GetAnalyticsInfo HTTP/1.1
Host: blazordiffusion.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetAnalyticsInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Month>0001-01-01T00:00:00</Month>
<Type>String</Type>
<Op>String</Op>
<ApiKey>String</ApiKey>
<UserId>String</UserId>
<Ip>String</Ip>
</GetAnalyticsInfo>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetAnalyticsInfoResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <Months xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </Months> <Result> <Id>0</Id> <DateTime>0001-01-01T00:00:00</DateTime> <Browser>String</Browser> <Device>String</Device> <Bot>String</Bot> <Op>String</Op> <UserId>String</UserId> <UserName>String</UserName> <ApiKey>String</ApiKey> <Ip>String</Ip> </Result> <ResponseStatus> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </Meta> </ResponseError> </Errors> <Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </Meta> </ResponseStatus> </GetAnalyticsInfoResponse>