import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
import 'dart:collection';
abstract class SoftDeleteAuditBase<Table,TResponse> implements IUpdateDb<Table>
{
SoftDeleteAuditBase();
SoftDeleteAuditBase.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "SoftDeleteAuditBase<$Table,$TResponse>";
TypeContext? context = _ctx;
}
abstract class SoftDeleteAuditTenantBase<Table,TResponse> extends SoftDeleteAuditBase<Table,TResponse>
{
SoftDeleteAuditTenantBase();
SoftDeleteAuditTenantBase.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "SoftDeleteAuditTenantBase<$Table,$TResponse>";
TypeContext? context = _ctx;
}
enum LivingStatus
{
Alive,
Dead,
}
abstract class RockstarBase
{
String? firstName;
String? lastName;
int? age;
DateTime? dateOfBirth;
DateTime? dateDied;
LivingStatus? livingStatus;
RockstarBase({this.firstName,this.lastName,this.age,this.dateOfBirth,this.dateDied,this.livingStatus});
RockstarBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstName = json['firstName'];
lastName = json['lastName'];
age = json['age'];
dateOfBirth = JsonConverters.fromJson(json['dateOfBirth'],'DateTime',context!);
dateDied = JsonConverters.fromJson(json['dateDied'],'DateTime',context!);
livingStatus = JsonConverters.fromJson(json['livingStatus'],'LivingStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'firstName': firstName,
'lastName': lastName,
'age': age,
'dateOfBirth': JsonConverters.toJson(dateOfBirth,'DateTime',context!),
'dateDied': JsonConverters.toJson(dateDied,'DateTime',context!),
'livingStatus': JsonConverters.toJson(livingStatus,'LivingStatus',context!)
};
getTypeName() => "RockstarBase";
TypeContext? context = _ctx;
}
class RockstarAuto extends RockstarBase implements IConvertible
{
int? id;
RockstarAuto({this.id});
RockstarAuto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id
});
getTypeName() => "RockstarAuto";
TypeContext? context = _ctx;
}
class RockstarWithIdAndResultResponse implements IConvertible
{
int? id;
RockstarAuto? result;
ResponseStatus? responseStatus;
RockstarWithIdAndResultResponse({this.id,this.result,this.responseStatus});
RockstarWithIdAndResultResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
result = JsonConverters.fromJson(json['result'],'RockstarAuto',context!);
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'result': JsonConverters.toJson(result,'RockstarAuto',context!),
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "RockstarWithIdAndResultResponse";
TypeContext? context = _ctx;
}
// @DataContract
abstract class AuditBase
{
// @DataMember(Order=1)
DateTime? createdDate;
// @DataMember(Order=2)
// @required()
String? createdBy;
// @DataMember(Order=3)
DateTime? modifiedDate;
// @DataMember(Order=4)
// @required()
String? modifiedBy;
// @DataMember(Order=5)
DateTime? deletedDate;
// @DataMember(Order=6)
String? deletedBy;
AuditBase({this.createdDate,this.createdBy,this.modifiedDate,this.modifiedBy,this.deletedDate,this.deletedBy});
AuditBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
createdBy = json['createdBy'];
modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
modifiedBy = json['modifiedBy'];
deletedDate = JsonConverters.fromJson(json['deletedDate'],'DateTime',context!);
deletedBy = json['deletedBy'];
return this;
}
Map<String, dynamic> toJson() => {
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'createdBy': createdBy,
'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!),
'modifiedBy': modifiedBy,
'deletedDate': JsonConverters.toJson(deletedDate,'DateTime',context!),
'deletedBy': deletedBy
};
getTypeName() => "AuditBase";
TypeContext? context = _ctx;
}
class RockstarAuditTenant extends AuditBase implements IConvertible
{
int? tenantId;
int? id;
String? firstName;
String? lastName;
int? age;
DateTime? dateOfBirth;
DateTime? dateDied;
LivingStatus? livingStatus;
RockstarAuditTenant({this.tenantId,this.id,this.firstName,this.lastName,this.age,this.dateOfBirth,this.dateDied,this.livingStatus});
RockstarAuditTenant.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
tenantId = json['tenantId'];
id = json['id'];
firstName = json['firstName'];
lastName = json['lastName'];
age = json['age'];
dateOfBirth = JsonConverters.fromJson(json['dateOfBirth'],'DateTime',context!);
dateDied = JsonConverters.fromJson(json['dateDied'],'DateTime',context!);
livingStatus = JsonConverters.fromJson(json['livingStatus'],'LivingStatus',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'tenantId': tenantId,
'id': id,
'firstName': firstName,
'lastName': lastName,
'age': age,
'dateOfBirth': JsonConverters.toJson(dateOfBirth,'DateTime',context!),
'dateDied': JsonConverters.toJson(dateDied,'DateTime',context!),
'livingStatus': JsonConverters.toJson(livingStatus,'LivingStatus',context!)
});
getTypeName() => "RockstarAuditTenant";
TypeContext? context = _ctx;
}
class SoftDeleteAuditTenant extends SoftDeleteAuditTenantBase<RockstarAuditTenant,RockstarWithIdAndResultResponse> implements IConvertible
{
int? id;
SoftDeleteAuditTenant({this.id});
SoftDeleteAuditTenant.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id
});
getTypeName() => "SoftDeleteAuditTenant";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'test.servicestack.net', types: <String, TypeInfo> {
'SoftDeleteAuditBase<Table,TResponse>': TypeInfo(TypeOf.AbstractClass),
'SoftDeleteAuditTenantBase<Table,TResponse>': TypeInfo(TypeOf.AbstractClass),
'LivingStatus': TypeInfo(TypeOf.Enum, enumValues:LivingStatus.values),
'RockstarBase': TypeInfo(TypeOf.AbstractClass),
'RockstarAuto': TypeInfo(TypeOf.Class, create:() => RockstarAuto()),
'RockstarWithIdAndResultResponse': TypeInfo(TypeOf.Class, create:() => RockstarWithIdAndResultResponse()),
'RockstarAuditTenant': TypeInfo(TypeOf.Class, create:() => RockstarAuditTenant()),
'SoftDeleteAuditTenant': TypeInfo(TypeOf.Class, create:() => SoftDeleteAuditTenant()),
});
Dart SoftDeleteAuditTenant 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/SoftDeleteAuditTenant HTTP/1.1
Host: test.servicestack.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SoftDeleteAuditTenant xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceModel">
<Id>0</Id>
</SoftDeleteAuditTenant>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <RockstarWithIdAndResultResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Test.ServiceModel"> <Id>0</Id> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1: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> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1: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> </d2p1:Meta> </ResponseStatus> <Result> <Age>0</Age> <DateDied>0001-01-01T00:00:00</DateDied> <DateOfBirth>0001-01-01T00:00:00</DateOfBirth> <FirstName>String</FirstName> <LastName>String</LastName> <LivingStatus>Alive</LivingStatus> <Id>0</Id> </Result> </RockstarWithIdAndResultResponse>