| GET,OPTIONS | /v1/projects/{ProjectID}/material-shortfalls |
|---|
import 'package:servicestack/servicestack.dart';
class MaterialShortfall implements IConvertible
{
int? MaterialID;
String? Name;
String? MaterialType;
double? OnHand;
double? QtyNeeded;
double? ShortQty;
String? Unit;
double? UnitPrice;
double? EstUSD;
String? Vendor;
DateTime? JobStartDate;
MaterialShortfall({this.MaterialID,this.Name,this.MaterialType,this.OnHand,this.QtyNeeded,this.ShortQty,this.Unit,this.UnitPrice,this.EstUSD,this.Vendor,this.JobStartDate});
MaterialShortfall.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
MaterialID = json['MaterialID'];
Name = json['Name'];
MaterialType = json['MaterialType'];
OnHand = JsonConverters.toDouble(json['OnHand']);
QtyNeeded = JsonConverters.toDouble(json['QtyNeeded']);
ShortQty = JsonConverters.toDouble(json['ShortQty']);
Unit = json['Unit'];
UnitPrice = JsonConverters.toDouble(json['UnitPrice']);
EstUSD = JsonConverters.toDouble(json['EstUSD']);
Vendor = json['Vendor'];
JobStartDate = JsonConverters.fromJson(json['JobStartDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'MaterialID': MaterialID,
'Name': Name,
'MaterialType': MaterialType,
'OnHand': OnHand,
'QtyNeeded': QtyNeeded,
'ShortQty': ShortQty,
'Unit': Unit,
'UnitPrice': UnitPrice,
'EstUSD': EstUSD,
'Vendor': Vendor,
'JobStartDate': JsonConverters.toJson(JobStartDate,'DateTime',context!)
};
getTypeName() => "MaterialShortfall";
TypeContext? context = _ctx;
}
class MaterialShortfallsResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
int? ProjectID;
List<MaterialShortfall>? Shortfalls = [];
MaterialShortfallsResponse({this.ResponseStatus,this.ProjectID,this.Shortfalls});
MaterialShortfallsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
ProjectID = json['ProjectID'];
Shortfalls = JsonConverters.fromJson(json['Shortfalls'],'List<MaterialShortfall>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'ProjectID': ProjectID,
'Shortfalls': JsonConverters.toJson(Shortfalls,'List<MaterialShortfall>',context!)
};
getTypeName() => "MaterialShortfallsResponse";
TypeContext? context = _ctx;
}
class MaterialShortfallsRequest implements IConvertible
{
int? ProjectID;
MaterialShortfallsRequest({this.ProjectID});
MaterialShortfallsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectID = json['ProjectID'];
return this;
}
Map<String, dynamic> toJson() => {
'ProjectID': ProjectID
};
getTypeName() => "MaterialShortfallsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'MaterialShortfall': TypeInfo(TypeOf.Class, create:() => MaterialShortfall()),
'MaterialShortfallsResponse': TypeInfo(TypeOf.Class, create:() => MaterialShortfallsResponse()),
'List<MaterialShortfall>': TypeInfo(TypeOf.Class, create:() => <MaterialShortfall>[]),
'MaterialShortfallsRequest': TypeInfo(TypeOf.Class, create:() => MaterialShortfallsRequest()),
});
Dart MaterialShortfallsRequest 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.
GET /v1/projects/{ProjectID}/material-shortfalls HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<MaterialShortfallsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ProjectID>0</ProjectID>
<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>
<Shortfalls>
<MaterialShortfall>
<EstUSD>0</EstUSD>
<JobStartDate>0001-01-01T00:00:00</JobStartDate>
<MaterialID>0</MaterialID>
<MaterialType>String</MaterialType>
<Name>String</Name>
<OnHand>0</OnHand>
<QtyNeeded>0</QtyNeeded>
<ShortQty>0</ShortQty>
<Unit>String</Unit>
<UnitPrice>0</UnitPrice>
<Vendor>String</Vendor>
</MaterialShortfall>
</Shortfalls>
</MaterialShortfallsResponse>