| GET,POST,PUT,DELETE,OPTIONS | /v1/Project/Materials/{ProjectID} | ||
|---|---|---|---|
| GET,POST,PUT,DELETE,OPTIONS | /v1/Project/Materials/{ProjectID}/{JobID} |
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class Project implements IConvertible
{
int? ProjectID;
String? ProjectUID;
String? ProjectName;
String? ImageURL;
String? ImageKey;
String? ClientName;
String? ClientPhone;
String? ClientEmail;
int? ProjectManagerID;
String? ProjectManagerName;
DateTime? StartDate;
DateTime? EndDate;
DateTime? ActualStartDate;
DateTime? ActualEndDate;
int? JobCount;
int? CrewMemberCount;
int? EquipmentCount;
int? MaterialCount;
int? ProjectStatusID;
String? ProjectStatusDescription;
double? Budget;
double? CostToDate;
String? ProjectLocation;
String? ProjectType;
String? ProjectSponsor;
String? CreatedBy;
DateTime? CreatedAt;
DateTime? UpdatedAt;
String? ProjectDescription;
String? Scope;
int? StatusId;
Project({this.ProjectID,this.ProjectUID,this.ProjectName,this.ImageURL,this.ImageKey,this.ClientName,this.ClientPhone,this.ClientEmail,this.ProjectManagerID,this.ProjectManagerName,this.StartDate,this.EndDate,this.ActualStartDate,this.ActualEndDate,this.JobCount,this.CrewMemberCount,this.EquipmentCount,this.MaterialCount,this.ProjectStatusID,this.ProjectStatusDescription,this.Budget,this.CostToDate,this.ProjectLocation,this.ProjectType,this.ProjectSponsor,this.CreatedBy,this.CreatedAt,this.UpdatedAt,this.ProjectDescription,this.Scope,this.StatusId});
Project.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectID = json['ProjectID'];
ProjectUID = json['ProjectUID'];
ProjectName = json['ProjectName'];
ImageURL = json['ImageURL'];
ImageKey = json['ImageKey'];
ClientName = json['ClientName'];
ClientPhone = json['ClientPhone'];
ClientEmail = json['ClientEmail'];
ProjectManagerID = json['ProjectManagerID'];
ProjectManagerName = json['ProjectManagerName'];
StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
ActualStartDate = JsonConverters.fromJson(json['ActualStartDate'],'DateTime',context!);
ActualEndDate = JsonConverters.fromJson(json['ActualEndDate'],'DateTime',context!);
JobCount = json['JobCount'];
CrewMemberCount = json['CrewMemberCount'];
EquipmentCount = json['EquipmentCount'];
MaterialCount = json['MaterialCount'];
ProjectStatusID = json['ProjectStatusID'];
ProjectStatusDescription = json['ProjectStatusDescription'];
Budget = JsonConverters.toDouble(json['Budget']);
CostToDate = JsonConverters.toDouble(json['CostToDate']);
ProjectLocation = json['ProjectLocation'];
ProjectType = json['ProjectType'];
ProjectSponsor = json['ProjectSponsor'];
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
ProjectDescription = json['ProjectDescription'];
Scope = json['Scope'];
StatusId = json['StatusId'];
return this;
}
Map<String, dynamic> toJson() => {
'ProjectID': ProjectID,
'ProjectUID': ProjectUID,
'ProjectName': ProjectName,
'ImageURL': ImageURL,
'ImageKey': ImageKey,
'ClientName': ClientName,
'ClientPhone': ClientPhone,
'ClientEmail': ClientEmail,
'ProjectManagerID': ProjectManagerID,
'ProjectManagerName': ProjectManagerName,
'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
'ActualStartDate': JsonConverters.toJson(ActualStartDate,'DateTime',context!),
'ActualEndDate': JsonConverters.toJson(ActualEndDate,'DateTime',context!),
'JobCount': JobCount,
'CrewMemberCount': CrewMemberCount,
'EquipmentCount': EquipmentCount,
'MaterialCount': MaterialCount,
'ProjectStatusID': ProjectStatusID,
'ProjectStatusDescription': ProjectStatusDescription,
'Budget': Budget,
'CostToDate': CostToDate,
'ProjectLocation': ProjectLocation,
'ProjectType': ProjectType,
'ProjectSponsor': ProjectSponsor,
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!),
'ProjectDescription': ProjectDescription,
'Scope': Scope,
'StatusId': StatusId
};
getTypeName() => "Project";
TypeContext? context = _ctx;
}
class Material implements IConvertible
{
int? MaterialID;
String? MaterialName;
int? MaterialTypeID;
int? MaterialStatusID;
int? Quantity;
String? Supplier;
DateTime? OrderDate;
DateTime? DeliveryDate;
DateTime? OnSiteDate;
String? MaterialLocation;
String? Manufacturer;
String? SerialNumber;
String? BarCode;
String? TrackingInfo;
String? MaterialDescription;
String? Notes;
String? ImageURL;
String? DetailsURL;
String? CreatedByUID;
bool? Active;
DateTime? RecordCreatedDate;
int? StatusId;
String? MaterialTypeName;
double? Cost;
List<Project>? Projects = [];
Material({this.MaterialID,this.MaterialName,this.MaterialTypeID,this.MaterialStatusID,this.Quantity,this.Supplier,this.OrderDate,this.DeliveryDate,this.OnSiteDate,this.MaterialLocation,this.Manufacturer,this.SerialNumber,this.BarCode,this.TrackingInfo,this.MaterialDescription,this.Notes,this.ImageURL,this.DetailsURL,this.CreatedByUID,this.Active,this.RecordCreatedDate,this.StatusId,this.MaterialTypeName,this.Cost,this.Projects});
Material.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
MaterialID = json['MaterialID'];
MaterialName = json['MaterialName'];
MaterialTypeID = json['MaterialTypeID'];
MaterialStatusID = json['MaterialStatusID'];
Quantity = json['Quantity'];
Supplier = json['Supplier'];
OrderDate = JsonConverters.fromJson(json['OrderDate'],'DateTime',context!);
DeliveryDate = JsonConverters.fromJson(json['DeliveryDate'],'DateTime',context!);
OnSiteDate = JsonConverters.fromJson(json['OnSiteDate'],'DateTime',context!);
MaterialLocation = json['MaterialLocation'];
Manufacturer = json['Manufacturer'];
SerialNumber = json['SerialNumber'];
BarCode = json['BarCode'];
TrackingInfo = json['TrackingInfo'];
MaterialDescription = json['MaterialDescription'];
Notes = json['Notes'];
ImageURL = json['ImageURL'];
DetailsURL = json['DetailsURL'];
CreatedByUID = json['CreatedByUID'];
Active = json['Active'];
RecordCreatedDate = JsonConverters.fromJson(json['RecordCreatedDate'],'DateTime',context!);
StatusId = json['StatusId'];
MaterialTypeName = json['MaterialTypeName'];
Cost = JsonConverters.toDouble(json['Cost']);
Projects = JsonConverters.fromJson(json['Projects'],'List<Project>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'MaterialID': MaterialID,
'MaterialName': MaterialName,
'MaterialTypeID': MaterialTypeID,
'MaterialStatusID': MaterialStatusID,
'Quantity': Quantity,
'Supplier': Supplier,
'OrderDate': JsonConverters.toJson(OrderDate,'DateTime',context!),
'DeliveryDate': JsonConverters.toJson(DeliveryDate,'DateTime',context!),
'OnSiteDate': JsonConverters.toJson(OnSiteDate,'DateTime',context!),
'MaterialLocation': MaterialLocation,
'Manufacturer': Manufacturer,
'SerialNumber': SerialNumber,
'BarCode': BarCode,
'TrackingInfo': TrackingInfo,
'MaterialDescription': MaterialDescription,
'Notes': Notes,
'ImageURL': ImageURL,
'DetailsURL': DetailsURL,
'CreatedByUID': CreatedByUID,
'Active': Active,
'RecordCreatedDate': JsonConverters.toJson(RecordCreatedDate,'DateTime',context!),
'StatusId': StatusId,
'MaterialTypeName': MaterialTypeName,
'Cost': Cost,
'Projects': JsonConverters.toJson(Projects,'List<Project>',context!)
};
getTypeName() => "Material";
TypeContext? context = _ctx;
}
class ProjectMaterial extends Material implements IConvertible
{
int? ProjectMaterialID;
int? ProjectID;
DateTime? ProjectEndDate;
double? MaterialCost;
int? JobID;
double? BilledMaterialCost;
int? MaterialQty;
ProjectMaterial({this.ProjectMaterialID,this.ProjectID,this.ProjectEndDate,this.MaterialCost,this.JobID,this.BilledMaterialCost,this.MaterialQty});
ProjectMaterial.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ProjectMaterialID = json['ProjectMaterialID'];
ProjectID = json['ProjectID'];
ProjectEndDate = JsonConverters.fromJson(json['ProjectEndDate'],'DateTime',context!);
MaterialCost = JsonConverters.toDouble(json['MaterialCost']);
JobID = json['JobID'];
BilledMaterialCost = JsonConverters.toDouble(json['BilledMaterialCost']);
MaterialQty = json['MaterialQty'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ProjectMaterialID': ProjectMaterialID,
'ProjectID': ProjectID,
'ProjectEndDate': JsonConverters.toJson(ProjectEndDate,'DateTime',context!),
'MaterialCost': MaterialCost,
'JobID': JobID,
'BilledMaterialCost': BilledMaterialCost,
'MaterialQty': MaterialQty
});
getTypeName() => "ProjectMaterial";
TypeContext? context = _ctx;
}
class ProjectMaterialListResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<ProjectMaterial>? ProjectMaterials = [];
ProjectMaterialListResponse({this.ResponseStatus,this.ProjectMaterials});
ProjectMaterialListResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
ProjectMaterials = JsonConverters.fromJson(json['ProjectMaterials'],'List<ProjectMaterial>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'ProjectMaterials': JsonConverters.toJson(ProjectMaterials,'List<ProjectMaterial>',context!)
};
getTypeName() => "ProjectMaterialListResponse";
TypeContext? context = _ctx;
}
class ProjectMaterialListRequest implements IConvertible
{
int? ProjectID;
int? JobID;
List<Material>? ProjectMaterials = [];
ProjectMaterialListRequest({this.ProjectID,this.JobID,this.ProjectMaterials});
ProjectMaterialListRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectID = json['ProjectID'];
JobID = json['JobID'];
ProjectMaterials = JsonConverters.fromJson(json['ProjectMaterials'],'List<Material>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ProjectID': ProjectID,
'JobID': JobID,
'ProjectMaterials': JsonConverters.toJson(ProjectMaterials,'List<Material>',context!)
};
getTypeName() => "ProjectMaterialListRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'Project': TypeInfo(TypeOf.Class, create:() => Project()),
'Material': TypeInfo(TypeOf.Class, create:() => Material()),
'List<Project>': TypeInfo(TypeOf.Class, create:() => <Project>[]),
'ProjectMaterial': TypeInfo(TypeOf.Class, create:() => ProjectMaterial()),
'ProjectMaterialListResponse': TypeInfo(TypeOf.Class, create:() => ProjectMaterialListResponse()),
'List<ProjectMaterial>': TypeInfo(TypeOf.Class, create:() => <ProjectMaterial>[]),
'ProjectMaterialListRequest': TypeInfo(TypeOf.Class, create:() => ProjectMaterialListRequest()),
'List<Material>': TypeInfo(TypeOf.Class, create:() => <Material>[]),
});
Dart ProjectMaterialListRequest 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.
POST /v1/Project/Materials/{ProjectID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ProjectID: 0,
JobID: 0,
ProjectMaterials:
[
{
MaterialID: 0,
MaterialName: String,
MaterialTypeID: 0,
MaterialStatusID: 0,
Quantity: 0,
Supplier: String,
OrderDate: 0001-01-01,
DeliveryDate: 0001-01-01,
OnSiteDate: 0001-01-01,
MaterialLocation: String,
Manufacturer: String,
SerialNumber: String,
BarCode: String,
TrackingInfo: String,
MaterialDescription: String,
Notes: String,
ImageURL: String,
DetailsURL: String,
CreatedByUID: 00000000000000000000000000000000,
Active: False,
RecordCreatedDate: 0001-01-01,
StatusId: 0,
MaterialTypeName: String,
Cost: 0,
Projects:
[
{
ProjectID: 0,
ProjectUID: 00000000000000000000000000000000,
ProjectName: String,
ImageURL: String,
ImageKey: String,
ClientName: String,
ClientPhone: String,
ClientEmail: String,
ProjectManagerID: 0,
ProjectManagerName: String,
StartDate: 0001-01-01,
EndDate: 0001-01-01,
ActualStartDate: 0001-01-01,
ActualEndDate: 0001-01-01,
JobCount: 0,
CrewMemberCount: 0,
EquipmentCount: 0,
MaterialCount: 0,
ProjectStatusID: 0,
ProjectStatusDescription: String,
Budget: 0,
CostToDate: 0,
ProjectLocation: String,
ProjectType: String,
ProjectSponsor: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
ProjectDescription: String,
Scope: String,
StatusId: 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
}
},
ProjectMaterials:
[
{
ProjectMaterialID: 0,
ProjectID: 0,
ProjectEndDate: 0001-01-01,
MaterialCost: 0,
JobID: 0,
BilledMaterialCost: 0,
MaterialQty: 0,
MaterialID: 0,
MaterialName: String,
MaterialTypeID: 0,
MaterialStatusID: 0,
Quantity: 0,
Supplier: String,
OrderDate: 0001-01-01,
DeliveryDate: 0001-01-01,
OnSiteDate: 0001-01-01,
MaterialLocation: String,
Manufacturer: String,
SerialNumber: String,
BarCode: String,
TrackingInfo: String,
MaterialDescription: String,
Notes: String,
ImageURL: String,
DetailsURL: String,
CreatedByUID: 00000000000000000000000000000000,
Active: False,
RecordCreatedDate: 0001-01-01,
StatusId: 0,
MaterialTypeName: String,
Cost: 0,
Projects:
[
{
ProjectID: 0,
ProjectUID: 00000000000000000000000000000000,
ProjectName: String,
ImageURL: String,
ImageKey: String,
ClientName: String,
ClientPhone: String,
ClientEmail: String,
ProjectManagerID: 0,
ProjectManagerName: String,
StartDate: 0001-01-01,
EndDate: 0001-01-01,
ActualStartDate: 0001-01-01,
ActualEndDate: 0001-01-01,
JobCount: 0,
CrewMemberCount: 0,
EquipmentCount: 0,
MaterialCount: 0,
ProjectStatusID: 0,
ProjectStatusDescription: String,
Budget: 0,
CostToDate: 0,
ProjectLocation: String,
ProjectType: String,
ProjectSponsor: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
ProjectDescription: String,
Scope: String,
StatusId: 0
}
]
}
]
}