| Requires any of the roles: | Agent, Administrator |
| PUT,OPTIONS | /v1/project/job/{JobID}/schedule |
|---|
import 'package:servicestack/servicestack.dart';
class TimelineCrew implements IConvertible
{
int? ProjectJobCrewMemberID;
int? ContactID;
String? ContactName;
double? BudgetedHours;
TimelineCrew({this.ProjectJobCrewMemberID,this.ContactID,this.ContactName,this.BudgetedHours});
TimelineCrew.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectJobCrewMemberID = json['ProjectJobCrewMemberID'];
ContactID = json['ContactID'];
ContactName = json['ContactName'];
BudgetedHours = JsonConverters.toDouble(json['BudgetedHours']);
return this;
}
Map<String, dynamic> toJson() => {
'ProjectJobCrewMemberID': ProjectJobCrewMemberID,
'ContactID': ContactID,
'ContactName': ContactName,
'BudgetedHours': BudgetedHours
};
getTypeName() => "TimelineCrew";
TypeContext? context = _ctx;
}
class TimelineEquipment implements IConvertible
{
int? ProjectJobEquipmentID;
int? EquipmentID;
String? EquipmentName;
TimelineEquipment({this.ProjectJobEquipmentID,this.EquipmentID,this.EquipmentName});
TimelineEquipment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectJobEquipmentID = json['ProjectJobEquipmentID'];
EquipmentID = json['EquipmentID'];
EquipmentName = json['EquipmentName'];
return this;
}
Map<String, dynamic> toJson() => {
'ProjectJobEquipmentID': ProjectJobEquipmentID,
'EquipmentID': EquipmentID,
'EquipmentName': EquipmentName
};
getTypeName() => "TimelineEquipment";
TypeContext? context = _ctx;
}
class TimelineJob implements IConvertible
{
int? JobID;
String? JobName;
DateTime? ExpectedStartDate;
DateTime? ExpectedCompletionDate;
DateTime? ActualStartDate;
DateTime? ActualEndDate;
double? PercentComplete;
int? StatusID;
String? JobCategory;
bool? IsAgreementVisit;
DateTime? OccurrenceDate;
List<TimelineCrew>? Crew = [];
List<TimelineEquipment>? Equipment = [];
TimelineJob({this.JobID,this.JobName,this.ExpectedStartDate,this.ExpectedCompletionDate,this.ActualStartDate,this.ActualEndDate,this.PercentComplete,this.StatusID,this.JobCategory,this.IsAgreementVisit,this.OccurrenceDate,this.Crew,this.Equipment});
TimelineJob.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
JobID = json['JobID'];
JobName = json['JobName'];
ExpectedStartDate = JsonConverters.fromJson(json['ExpectedStartDate'],'DateTime',context!);
ExpectedCompletionDate = JsonConverters.fromJson(json['ExpectedCompletionDate'],'DateTime',context!);
ActualStartDate = JsonConverters.fromJson(json['ActualStartDate'],'DateTime',context!);
ActualEndDate = JsonConverters.fromJson(json['ActualEndDate'],'DateTime',context!);
PercentComplete = JsonConverters.toDouble(json['PercentComplete']);
StatusID = json['StatusID'];
JobCategory = json['JobCategory'];
IsAgreementVisit = json['IsAgreementVisit'];
OccurrenceDate = JsonConverters.fromJson(json['OccurrenceDate'],'DateTime',context!);
Crew = JsonConverters.fromJson(json['Crew'],'List<TimelineCrew>',context!);
Equipment = JsonConverters.fromJson(json['Equipment'],'List<TimelineEquipment>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'JobID': JobID,
'JobName': JobName,
'ExpectedStartDate': JsonConverters.toJson(ExpectedStartDate,'DateTime',context!),
'ExpectedCompletionDate': JsonConverters.toJson(ExpectedCompletionDate,'DateTime',context!),
'ActualStartDate': JsonConverters.toJson(ActualStartDate,'DateTime',context!),
'ActualEndDate': JsonConverters.toJson(ActualEndDate,'DateTime',context!),
'PercentComplete': PercentComplete,
'StatusID': StatusID,
'JobCategory': JobCategory,
'IsAgreementVisit': IsAgreementVisit,
'OccurrenceDate': JsonConverters.toJson(OccurrenceDate,'DateTime',context!),
'Crew': JsonConverters.toJson(Crew,'List<TimelineCrew>',context!),
'Equipment': JsonConverters.toJson(Equipment,'List<TimelineEquipment>',context!)
};
getTypeName() => "TimelineJob";
TypeContext? context = _ctx;
}
class JobScheduleUpdateResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
TimelineJob? Job;
JobScheduleUpdateResponse({this.ResponseStatus,this.Job});
JobScheduleUpdateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Job = JsonConverters.fromJson(json['Job'],'TimelineJob',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Job': JsonConverters.toJson(Job,'TimelineJob',context!)
};
getTypeName() => "JobScheduleUpdateResponse";
TypeContext? context = _ctx;
}
class JobScheduleUpdateRequest implements IConvertible
{
int? JobID;
DateTime? ExpectedStartDate;
DateTime? ExpectedCompletionDate;
double? PercentComplete;
JobScheduleUpdateRequest({this.JobID,this.ExpectedStartDate,this.ExpectedCompletionDate,this.PercentComplete});
JobScheduleUpdateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
JobID = json['JobID'];
ExpectedStartDate = JsonConverters.fromJson(json['ExpectedStartDate'],'DateTime',context!);
ExpectedCompletionDate = JsonConverters.fromJson(json['ExpectedCompletionDate'],'DateTime',context!);
PercentComplete = JsonConverters.toDouble(json['PercentComplete']);
return this;
}
Map<String, dynamic> toJson() => {
'JobID': JobID,
'ExpectedStartDate': JsonConverters.toJson(ExpectedStartDate,'DateTime',context!),
'ExpectedCompletionDate': JsonConverters.toJson(ExpectedCompletionDate,'DateTime',context!),
'PercentComplete': PercentComplete
};
getTypeName() => "JobScheduleUpdateRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'TimelineCrew': TypeInfo(TypeOf.Class, create:() => TimelineCrew()),
'TimelineEquipment': TypeInfo(TypeOf.Class, create:() => TimelineEquipment()),
'TimelineJob': TypeInfo(TypeOf.Class, create:() => TimelineJob()),
'List<TimelineCrew>': TypeInfo(TypeOf.Class, create:() => <TimelineCrew>[]),
'List<TimelineEquipment>': TypeInfo(TypeOf.Class, create:() => <TimelineEquipment>[]),
'JobScheduleUpdateResponse': TypeInfo(TypeOf.Class, create:() => JobScheduleUpdateResponse()),
'JobScheduleUpdateRequest': TypeInfo(TypeOf.Class, create:() => JobScheduleUpdateRequest()),
});
Dart JobScheduleUpdateRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /v1/project/job/{JobID}/schedule HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
JobID: 0,
ExpectedStartDate: 0001-01-01,
ExpectedCompletionDate: 0001-01-01,
PercentComplete: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Job:
{
JobID: 0,
JobName: String,
ExpectedStartDate: 0001-01-01,
ExpectedCompletionDate: 0001-01-01,
ActualStartDate: 0001-01-01,
ActualEndDate: 0001-01-01,
PercentComplete: 0,
StatusID: 0,
JobCategory: String,
IsAgreementVisit: False,
OccurrenceDate: 0001-01-01,
Crew:
[
{
ProjectJobCrewMemberID: 0,
ContactID: 0,
ContactName: String,
BudgetedHours: 0
}
],
Equipment:
[
{
ProjectJobEquipmentID: 0,
EquipmentID: 0,
EquipmentName: String
}
]
}
}