| GET,OPTIONS | /v1/pm/job/{JobID} |
|---|
import 'package:servicestack/servicestack.dart';
class PmJobCrew implements IConvertible
{
int? ContactID;
String? Name;
double? Rate;
double? BudgetedHours;
bool? IsOpen;
PmJobCrew({this.ContactID,this.Name,this.Rate,this.BudgetedHours,this.IsOpen});
PmJobCrew.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ContactID = json['ContactID'];
Name = json['Name'];
Rate = JsonConverters.toDouble(json['Rate']);
BudgetedHours = JsonConverters.toDouble(json['BudgetedHours']);
IsOpen = json['IsOpen'];
return this;
}
Map<String, dynamic> toJson() => {
'ContactID': ContactID,
'Name': Name,
'Rate': Rate,
'BudgetedHours': BudgetedHours,
'IsOpen': IsOpen
};
getTypeName() => "PmJobCrew";
TypeContext? context = _ctx;
}
class PmJobResource implements IConvertible
{
int? Id;
String? Name;
double? Amount;
int? Qty;
String? Unit;
PmJobResource({this.Id,this.Name,this.Amount,this.Qty,this.Unit});
PmJobResource.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Amount = JsonConverters.toDouble(json['Amount']);
Qty = json['Qty'];
Unit = json['Unit'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Amount': Amount,
'Qty': Qty,
'Unit': Unit
};
getTypeName() => "PmJobResource";
TypeContext? context = _ctx;
}
class PmJob implements IConvertible
{
int? JobID;
String? Name;
String? Description;
String? Status;
String? StartDate;
String? EndDate;
int? CrewCount;
double? BudgetedHours;
int? EquipmentCount;
int? MaterialCount;
double? CrewCost;
double? EquipCost;
double? MatCost;
double? Cost;
bool? NoCrew;
bool? EquipConflict;
bool? MaterialGap;
int? ReadyPct;
String? Priority;
List<String>? Tags = [];
List<PmJobCrew>? Crew = [];
List<PmJobResource>? Equipment = [];
List<PmJobResource>? Materials = [];
PmJob({this.JobID,this.Name,this.Description,this.Status,this.StartDate,this.EndDate,this.CrewCount,this.BudgetedHours,this.EquipmentCount,this.MaterialCount,this.CrewCost,this.EquipCost,this.MatCost,this.Cost,this.NoCrew,this.EquipConflict,this.MaterialGap,this.ReadyPct,this.Priority,this.Tags,this.Crew,this.Equipment,this.Materials});
PmJob.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
JobID = json['JobID'];
Name = json['Name'];
Description = json['Description'];
Status = json['Status'];
StartDate = json['StartDate'];
EndDate = json['EndDate'];
CrewCount = json['CrewCount'];
BudgetedHours = JsonConverters.toDouble(json['BudgetedHours']);
EquipmentCount = json['EquipmentCount'];
MaterialCount = json['MaterialCount'];
CrewCost = JsonConverters.toDouble(json['CrewCost']);
EquipCost = JsonConverters.toDouble(json['EquipCost']);
MatCost = JsonConverters.toDouble(json['MatCost']);
Cost = JsonConverters.toDouble(json['Cost']);
NoCrew = json['NoCrew'];
EquipConflict = json['EquipConflict'];
MaterialGap = json['MaterialGap'];
ReadyPct = json['ReadyPct'];
Priority = json['Priority'];
Tags = JsonConverters.fromJson(json['Tags'],'List<String>',context!);
Crew = JsonConverters.fromJson(json['Crew'],'List<PmJobCrew>',context!);
Equipment = JsonConverters.fromJson(json['Equipment'],'List<PmJobResource>',context!);
Materials = JsonConverters.fromJson(json['Materials'],'List<PmJobResource>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'JobID': JobID,
'Name': Name,
'Description': Description,
'Status': Status,
'StartDate': StartDate,
'EndDate': EndDate,
'CrewCount': CrewCount,
'BudgetedHours': BudgetedHours,
'EquipmentCount': EquipmentCount,
'MaterialCount': MaterialCount,
'CrewCost': CrewCost,
'EquipCost': EquipCost,
'MatCost': MatCost,
'Cost': Cost,
'NoCrew': NoCrew,
'EquipConflict': EquipConflict,
'MaterialGap': MaterialGap,
'ReadyPct': ReadyPct,
'Priority': Priority,
'Tags': JsonConverters.toJson(Tags,'List<String>',context!),
'Crew': JsonConverters.toJson(Crew,'List<PmJobCrew>',context!),
'Equipment': JsonConverters.toJson(Equipment,'List<PmJobResource>',context!),
'Materials': JsonConverters.toJson(Materials,'List<PmJobResource>',context!)
};
getTypeName() => "PmJob";
TypeContext? context = _ctx;
}
class PmJobResponse implements IConvertible
{
PmJob? Job;
ResponseStatus? ResponseStatus;
PmJobResponse({this.Job,this.ResponseStatus});
PmJobResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Job = JsonConverters.fromJson(json['Job'],'PmJob',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Job': JsonConverters.toJson(Job,'PmJob',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "PmJobResponse";
TypeContext? context = _ctx;
}
class PmJobRequest implements IConvertible
{
int? JobID;
PmJobRequest({this.JobID});
PmJobRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
JobID = json['JobID'];
return this;
}
Map<String, dynamic> toJson() => {
'JobID': JobID
};
getTypeName() => "PmJobRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'PmJobCrew': TypeInfo(TypeOf.Class, create:() => PmJobCrew()),
'PmJobResource': TypeInfo(TypeOf.Class, create:() => PmJobResource()),
'PmJob': TypeInfo(TypeOf.Class, create:() => PmJob()),
'List<PmJobCrew>': TypeInfo(TypeOf.Class, create:() => <PmJobCrew>[]),
'List<PmJobResource>': TypeInfo(TypeOf.Class, create:() => <PmJobResource>[]),
'PmJobResponse': TypeInfo(TypeOf.Class, create:() => PmJobResponse()),
'PmJobRequest': TypeInfo(TypeOf.Class, create:() => PmJobRequest()),
});
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.
GET /v1/pm/job/{JobID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Job:
{
JobID: 0,
Name: String,
Description: String,
Status: String,
StartDate: String,
EndDate: String,
CrewCount: 0,
BudgetedHours: 0,
EquipmentCount: 0,
MaterialCount: 0,
CrewCost: 0,
EquipCost: 0,
MatCost: 0,
Cost: 0,
NoCrew: False,
EquipConflict: False,
MaterialGap: False,
ReadyPct: 0,
Priority: String,
Tags:
[
String
],
Crew:
[
{
ContactID: 0,
Name: String,
Rate: 0,
BudgetedHours: 0,
IsOpen: False
}
],
Equipment:
[
{
Id: 0,
Name: String,
Amount: 0,
Qty: 0,
Unit: String
}
],
Materials:
[
{
Id: 0,
Name: String,
Amount: 0,
Qty: 0,
Unit: String
}
]
},
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}