| POST,OPTIONS | /v1/projects/{ProjectID}/punch |
|---|
import 'package:servicestack/servicestack.dart';
class PunchItem implements IConvertible
{
int? PunchItemID;
String? PunchItemUID;
int? ProjectID;
String? PunchNo;
String? Title;
String? Description;
String? Area;
String? Trade;
String? Status;
String? Priority;
String? AssignedSub;
String? AssignedTo;
int? AssignedSubContactID;
int? PhotoCount;
String? OriginType;
String? OriginRef;
DateTime? OpenedAt;
DateTime? VerifiedAt;
DateTime? ClosedAt;
String? CreatedBy;
DateTime? CreatedAt;
DateTime? UpdatedAt;
PunchItem({this.PunchItemID,this.PunchItemUID,this.ProjectID,this.PunchNo,this.Title,this.Description,this.Area,this.Trade,this.Status,this.Priority,this.AssignedSub,this.AssignedTo,this.AssignedSubContactID,this.PhotoCount,this.OriginType,this.OriginRef,this.OpenedAt,this.VerifiedAt,this.ClosedAt,this.CreatedBy,this.CreatedAt,this.UpdatedAt});
PunchItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PunchItemID = json['PunchItemID'];
PunchItemUID = json['PunchItemUID'];
ProjectID = json['ProjectID'];
PunchNo = json['PunchNo'];
Title = json['Title'];
Description = json['Description'];
Area = json['Area'];
Trade = json['Trade'];
Status = json['Status'];
Priority = json['Priority'];
AssignedSub = json['AssignedSub'];
AssignedTo = json['AssignedTo'];
AssignedSubContactID = json['AssignedSubContactID'];
PhotoCount = json['PhotoCount'];
OriginType = json['OriginType'];
OriginRef = json['OriginRef'];
OpenedAt = JsonConverters.fromJson(json['OpenedAt'],'DateTime',context!);
VerifiedAt = JsonConverters.fromJson(json['VerifiedAt'],'DateTime',context!);
ClosedAt = JsonConverters.fromJson(json['ClosedAt'],'DateTime',context!);
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'PunchItemID': PunchItemID,
'PunchItemUID': PunchItemUID,
'ProjectID': ProjectID,
'PunchNo': PunchNo,
'Title': Title,
'Description': Description,
'Area': Area,
'Trade': Trade,
'Status': Status,
'Priority': Priority,
'AssignedSub': AssignedSub,
'AssignedTo': AssignedTo,
'AssignedSubContactID': AssignedSubContactID,
'PhotoCount': PhotoCount,
'OriginType': OriginType,
'OriginRef': OriginRef,
'OpenedAt': JsonConverters.toJson(OpenedAt,'DateTime',context!),
'VerifiedAt': JsonConverters.toJson(VerifiedAt,'DateTime',context!),
'ClosedAt': JsonConverters.toJson(ClosedAt,'DateTime',context!),
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!)
};
getTypeName() => "PunchItem";
TypeContext? context = _ctx;
}
class PunchSummary implements IConvertible
{
int? ProjectID;
int? TotalItems;
int? OpenCount;
int? VerifyCount;
int? ClosedCount;
int? RejectedCount;
int? PercentComplete;
PunchSummary({this.ProjectID,this.TotalItems,this.OpenCount,this.VerifyCount,this.ClosedCount,this.RejectedCount,this.PercentComplete});
PunchSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectID = json['ProjectID'];
TotalItems = json['TotalItems'];
OpenCount = json['OpenCount'];
VerifyCount = json['VerifyCount'];
ClosedCount = json['ClosedCount'];
RejectedCount = json['RejectedCount'];
PercentComplete = json['PercentComplete'];
return this;
}
Map<String, dynamic> toJson() => {
'ProjectID': ProjectID,
'TotalItems': TotalItems,
'OpenCount': OpenCount,
'VerifyCount': VerifyCount,
'ClosedCount': ClosedCount,
'RejectedCount': RejectedCount,
'PercentComplete': PercentComplete
};
getTypeName() => "PunchSummary";
TypeContext? context = _ctx;
}
class PunchItemResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
PunchItem? Item;
PunchSummary? Summary;
PunchItemResponse({this.ResponseStatus,this.Item,this.Summary});
PunchItemResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Item = JsonConverters.fromJson(json['Item'],'PunchItem',context!);
Summary = JsonConverters.fromJson(json['Summary'],'PunchSummary',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Item': JsonConverters.toJson(Item,'PunchItem',context!),
'Summary': JsonConverters.toJson(Summary,'PunchSummary',context!)
};
getTypeName() => "PunchItemResponse";
TypeContext? context = _ctx;
}
class PunchCreateRequest implements IConvertible
{
int? ProjectID;
String? PunchNo;
String? Title;
String? Description;
String? Area;
String? Trade;
String? Priority;
String? AssignedSub;
String? AssignedTo;
int? AssignedSubContactID;
String? OriginType;
String? OriginRef;
PunchCreateRequest({this.ProjectID,this.PunchNo,this.Title,this.Description,this.Area,this.Trade,this.Priority,this.AssignedSub,this.AssignedTo,this.AssignedSubContactID,this.OriginType,this.OriginRef});
PunchCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectID = json['ProjectID'];
PunchNo = json['PunchNo'];
Title = json['Title'];
Description = json['Description'];
Area = json['Area'];
Trade = json['Trade'];
Priority = json['Priority'];
AssignedSub = json['AssignedSub'];
AssignedTo = json['AssignedTo'];
AssignedSubContactID = json['AssignedSubContactID'];
OriginType = json['OriginType'];
OriginRef = json['OriginRef'];
return this;
}
Map<String, dynamic> toJson() => {
'ProjectID': ProjectID,
'PunchNo': PunchNo,
'Title': Title,
'Description': Description,
'Area': Area,
'Trade': Trade,
'Priority': Priority,
'AssignedSub': AssignedSub,
'AssignedTo': AssignedTo,
'AssignedSubContactID': AssignedSubContactID,
'OriginType': OriginType,
'OriginRef': OriginRef
};
getTypeName() => "PunchCreateRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'PunchItem': TypeInfo(TypeOf.Class, create:() => PunchItem()),
'PunchSummary': TypeInfo(TypeOf.Class, create:() => PunchSummary()),
'PunchItemResponse': TypeInfo(TypeOf.Class, create:() => PunchItemResponse()),
'PunchCreateRequest': TypeInfo(TypeOf.Class, create:() => PunchCreateRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/projects/{ProjectID}/punch HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ProjectID":0,"PunchNo":"String","Title":"String","Description":"String","Area":"String","Trade":"String","Priority":"String","AssignedSub":"String","AssignedTo":"String","AssignedSubContactID":0,"OriginType":"String","OriginRef":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Item":{"PunchItemID":0,"PunchItemUID":"00000000000000000000000000000000","ProjectID":0,"PunchNo":"String","Title":"String","Description":"String","Area":"String","Trade":"String","Status":"String","Priority":"String","AssignedSub":"String","AssignedTo":"String","AssignedSubContactID":0,"PhotoCount":0,"OriginType":"String","OriginRef":"String","OpenedAt":"0001-01-01T00:00:00.0000000","VerifiedAt":"0001-01-01T00:00:00.0000000","ClosedAt":"0001-01-01T00:00:00.0000000","CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000"},"Summary":{"ProjectID":0,"TotalItems":0,"OpenCount":0,"VerifyCount":0,"ClosedCount":0,"RejectedCount":0,"PercentComplete":0}}