import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
// @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 AppUser implements IConvertible
{
String? id;
String? firstName;
String? lastName;
String? displayName;
String? profileUrl;
AppUser({this.id,this.firstName,this.lastName,this.displayName,this.profileUrl});
AppUser.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
firstName = json['firstName'];
lastName = json['lastName'];
displayName = json['displayName'];
profileUrl = json['profileUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'firstName': firstName,
'lastName': lastName,
'displayName': displayName,
'profileUrl': profileUrl
};
getTypeName() => "AppUser";
TypeContext? context = _ctx;
}
enum JobApplicationStatus
{
Applied,
PhoneScreening,
PhoneScreeningCompleted,
Interview,
InterviewCompleted,
Offer,
Disqualified,
}
class JobApplicationEvent extends AuditBase implements IConvertible
{
int? id;
// @References(typeof(JobApplication))
int? jobApplicationId;
// @References(typeof(AppUser))
String? appUserId;
AppUser? appUser;
String? description;
JobApplicationStatus? status;
DateTime? eventDate;
JobApplicationEvent({this.id,this.jobApplicationId,this.appUserId,this.appUser,this.description,this.status,this.eventDate});
JobApplicationEvent.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
jobApplicationId = json['jobApplicationId'];
appUserId = json['appUserId'];
appUser = JsonConverters.fromJson(json['appUser'],'AppUser',context!);
description = json['description'];
status = JsonConverters.fromJson(json['status'],'JobApplicationStatus',context!);
eventDate = JsonConverters.fromJson(json['eventDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id,
'jobApplicationId': jobApplicationId,
'appUserId': appUserId,
'appUser': JsonConverters.toJson(appUser,'AppUser',context!),
'description': description,
'status': JsonConverters.toJson(status,'JobApplicationStatus',context!),
'eventDate': JsonConverters.toJson(eventDate,'DateTime',context!)
});
getTypeName() => "JobApplicationEvent";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAuthenticated")
class CreateJobApplicationEvent implements ICreateDb<JobApplicationEvent>, IConvertible
{
CreateJobApplicationEvent();
CreateJobApplicationEvent.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "CreateJobApplicationEvent";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'blazor_gallery.servicestack.net', types: <String, TypeInfo> {
'AppUser': TypeInfo(TypeOf.Class, create:() => AppUser()),
'JobApplicationStatus': TypeInfo(TypeOf.Enum, enumValues:JobApplicationStatus.values),
'JobApplicationEvent': TypeInfo(TypeOf.Class, create:() => JobApplicationEvent()),
'CreateJobApplicationEvent': TypeInfo(TypeOf.Class, create:() => CreateJobApplicationEvent()),
});
Dart CreateJobApplicationEvent 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/CreateJobApplicationEvent HTTP/1.1
Host: blazor-gallery.servicestack.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateJobApplicationEvent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel" />
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <JobApplicationEvent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel"> <CreatedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</CreatedDate> <CreatedBy xmlns="http://schemas.servicestack.net/types">String</CreatedBy> <ModifiedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</ModifiedDate> <ModifiedBy xmlns="http://schemas.servicestack.net/types">String</ModifiedBy> <DeletedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</DeletedDate> <DeletedBy xmlns="http://schemas.servicestack.net/types">String</DeletedBy> <AppUser> <DisplayName>String</DisplayName> <FirstName>String</FirstName> <Id>String</Id> <LastName>String</LastName> <ProfileUrl>String</ProfileUrl> </AppUser> <AppUserId>String</AppUserId> <Description>String</Description> <EventDate>0001-01-01T00:00:00</EventDate> <Id>0</Id> <JobApplicationId>0</JobApplicationId> <Status>Applied</Status> </JobApplicationEvent>