| POST,OPTIONS | /v1/inspections/{InspectionUID}/sign |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class InspectionPhoto implements IConvertible
{
String? AttachmentId;
String? FileName;
String? Url;
String? CreatedBy;
DateTime? CreatedDate;
bool? HasAnnotation;
String? AnnotatedAttachmentId;
String? AnnotatedUrl;
InspectionPhoto({this.AttachmentId,this.FileName,this.Url,this.CreatedBy,this.CreatedDate,this.HasAnnotation,this.AnnotatedAttachmentId,this.AnnotatedUrl});
InspectionPhoto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AttachmentId = json['AttachmentId'];
FileName = json['FileName'];
Url = json['Url'];
CreatedBy = json['CreatedBy'];
CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
HasAnnotation = json['HasAnnotation'];
AnnotatedAttachmentId = json['AnnotatedAttachmentId'];
AnnotatedUrl = json['AnnotatedUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'AttachmentId': AttachmentId,
'FileName': FileName,
'Url': Url,
'CreatedBy': CreatedBy,
'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
'HasAnnotation': HasAnnotation,
'AnnotatedAttachmentId': AnnotatedAttachmentId,
'AnnotatedUrl': AnnotatedUrl
};
getTypeName() => "InspectionPhoto";
TypeContext? context = _ctx;
}
class InspectionItem implements IConvertible
{
int? InspectionItemID;
int? InspectionID;
int? Seq;
String? Section;
String? Prompt;
String? ResponseType;
bool? IsRequired;
String? Unit;
String? Guidance;
String? Result;
String? Value;
String? Notes;
int? PhotoCount;
int? LinkedPunchItemID;
String? LinkedPunchNo;
String? LinkedPunchStatus;
int? LinkedNcrID;
String? LinkedNcrNo;
int? LinkedActionID;
String? AnsweredBy;
DateTime? AnsweredAt;
List<InspectionPhoto>? Photos = [];
InspectionItem({this.InspectionItemID,this.InspectionID,this.Seq,this.Section,this.Prompt,this.ResponseType,this.IsRequired,this.Unit,this.Guidance,this.Result,this.Value,this.Notes,this.PhotoCount,this.LinkedPunchItemID,this.LinkedPunchNo,this.LinkedPunchStatus,this.LinkedNcrID,this.LinkedNcrNo,this.LinkedActionID,this.AnsweredBy,this.AnsweredAt,this.Photos});
InspectionItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InspectionItemID = json['InspectionItemID'];
InspectionID = json['InspectionID'];
Seq = json['Seq'];
Section = json['Section'];
Prompt = json['Prompt'];
ResponseType = json['ResponseType'];
IsRequired = json['IsRequired'];
Unit = json['Unit'];
Guidance = json['Guidance'];
Result = json['Result'];
Value = json['Value'];
Notes = json['Notes'];
PhotoCount = json['PhotoCount'];
LinkedPunchItemID = json['LinkedPunchItemID'];
LinkedPunchNo = json['LinkedPunchNo'];
LinkedPunchStatus = json['LinkedPunchStatus'];
LinkedNcrID = json['LinkedNcrID'];
LinkedNcrNo = json['LinkedNcrNo'];
LinkedActionID = json['LinkedActionID'];
AnsweredBy = json['AnsweredBy'];
AnsweredAt = JsonConverters.fromJson(json['AnsweredAt'],'DateTime',context!);
Photos = JsonConverters.fromJson(json['Photos'],'List<InspectionPhoto>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'InspectionItemID': InspectionItemID,
'InspectionID': InspectionID,
'Seq': Seq,
'Section': Section,
'Prompt': Prompt,
'ResponseType': ResponseType,
'IsRequired': IsRequired,
'Unit': Unit,
'Guidance': Guidance,
'Result': Result,
'Value': Value,
'Notes': Notes,
'PhotoCount': PhotoCount,
'LinkedPunchItemID': LinkedPunchItemID,
'LinkedPunchNo': LinkedPunchNo,
'LinkedPunchStatus': LinkedPunchStatus,
'LinkedNcrID': LinkedNcrID,
'LinkedNcrNo': LinkedNcrNo,
'LinkedActionID': LinkedActionID,
'AnsweredBy': AnsweredBy,
'AnsweredAt': JsonConverters.toJson(AnsweredAt,'DateTime',context!),
'Photos': JsonConverters.toJson(Photos,'List<InspectionPhoto>',context!)
};
getTypeName() => "InspectionItem";
TypeContext? context = _ctx;
}
class InspectionRequest implements IConvertible
{
int? InspectionRequestID;
int? InspectionID;
String? Agency;
String? ContactName;
String? ContactPhone;
String? PermitNo;
DateTime? RequestedDate;
String? RequestedWindow;
String? Status;
String? ConfirmationNo;
String? Outcome;
String? CreatedBy;
DateTime? CreatedAt;
DateTime? UpdatedAt;
InspectionRequest({this.InspectionRequestID,this.InspectionID,this.Agency,this.ContactName,this.ContactPhone,this.PermitNo,this.RequestedDate,this.RequestedWindow,this.Status,this.ConfirmationNo,this.Outcome,this.CreatedBy,this.CreatedAt,this.UpdatedAt});
InspectionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InspectionRequestID = json['InspectionRequestID'];
InspectionID = json['InspectionID'];
Agency = json['Agency'];
ContactName = json['ContactName'];
ContactPhone = json['ContactPhone'];
PermitNo = json['PermitNo'];
RequestedDate = JsonConverters.fromJson(json['RequestedDate'],'DateTime',context!);
RequestedWindow = json['RequestedWindow'];
Status = json['Status'];
ConfirmationNo = json['ConfirmationNo'];
Outcome = json['Outcome'];
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'InspectionRequestID': InspectionRequestID,
'InspectionID': InspectionID,
'Agency': Agency,
'ContactName': ContactName,
'ContactPhone': ContactPhone,
'PermitNo': PermitNo,
'RequestedDate': JsonConverters.toJson(RequestedDate,'DateTime',context!),
'RequestedWindow': RequestedWindow,
'Status': Status,
'ConfirmationNo': ConfirmationNo,
'Outcome': Outcome,
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!)
};
getTypeName() => "InspectionRequest";
TypeContext? context = _ctx;
}
class SignatureRecord implements IConvertible
{
int? SignatureRecordID;
String? EntityType;
int? EntityID;
String? Role;
String? SignerName;
int? SignerContactID;
String? SignerUserId;
String? Method;
String? ImageAttachmentId;
String? ImageUrl;
String? ImageHash;
String? DocumentHash;
String? ConsentText;
String? IpAddress;
String? UserAgent;
DateTime? SignedAt;
SignatureRecord({this.SignatureRecordID,this.EntityType,this.EntityID,this.Role,this.SignerName,this.SignerContactID,this.SignerUserId,this.Method,this.ImageAttachmentId,this.ImageUrl,this.ImageHash,this.DocumentHash,this.ConsentText,this.IpAddress,this.UserAgent,this.SignedAt});
SignatureRecord.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
SignatureRecordID = json['SignatureRecordID'];
EntityType = json['EntityType'];
EntityID = json['EntityID'];
Role = json['Role'];
SignerName = json['SignerName'];
SignerContactID = json['SignerContactID'];
SignerUserId = json['SignerUserId'];
Method = json['Method'];
ImageAttachmentId = json['ImageAttachmentId'];
ImageUrl = json['ImageUrl'];
ImageHash = json['ImageHash'];
DocumentHash = json['DocumentHash'];
ConsentText = json['ConsentText'];
IpAddress = json['IpAddress'];
UserAgent = json['UserAgent'];
SignedAt = JsonConverters.fromJson(json['SignedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'SignatureRecordID': SignatureRecordID,
'EntityType': EntityType,
'EntityID': EntityID,
'Role': Role,
'SignerName': SignerName,
'SignerContactID': SignerContactID,
'SignerUserId': SignerUserId,
'Method': Method,
'ImageAttachmentId': ImageAttachmentId,
'ImageUrl': ImageUrl,
'ImageHash': ImageHash,
'DocumentHash': DocumentHash,
'ConsentText': ConsentText,
'IpAddress': IpAddress,
'UserAgent': UserAgent,
'SignedAt': JsonConverters.toJson(SignedAt,'DateTime',context!)
};
getTypeName() => "SignatureRecord";
TypeContext? context = _ctx;
}
class Inspection implements IConvertible
{
int? InspectionID;
String? InspectionUID;
int? ProjectID;
String? ProjectName;
int? JobID;
String? JobName;
String? InspectionNo;
String? Type;
String? Title;
String? Status;
String? TemplateUID;
int? TemplateVersionNo;
DateTime? ScheduledFor;
DateTime? StartedAt;
DateTime? CompletedAt;
DateTime? ClosedAt;
int? InspectorContactID;
String? InspectorName;
String? AgencyName;
String? PermitNo;
String? LocationText;
String? Notes;
String? WeatherJson;
int? ItemsTotal;
int? ItemsPassed;
int? ItemsFailed;
String? Outcome;
String? OutcomeNotes;
int? ReinspectionOfInspectionID;
int? QcHoldPointID;
String? ReportAttachmentId;
int? RequestCount;
int? SignatureCount;
String? CreatedBy;
DateTime? CreatedAt;
DateTime? UpdatedAt;
List<InspectionItem>? Items = [];
List<InspectionRequest>? Requests = [];
List<SignatureRecord>? Signatures = [];
List<String>? Actions = [];
Inspection({this.InspectionID,this.InspectionUID,this.ProjectID,this.ProjectName,this.JobID,this.JobName,this.InspectionNo,this.Type,this.Title,this.Status,this.TemplateUID,this.TemplateVersionNo,this.ScheduledFor,this.StartedAt,this.CompletedAt,this.ClosedAt,this.InspectorContactID,this.InspectorName,this.AgencyName,this.PermitNo,this.LocationText,this.Notes,this.WeatherJson,this.ItemsTotal,this.ItemsPassed,this.ItemsFailed,this.Outcome,this.OutcomeNotes,this.ReinspectionOfInspectionID,this.QcHoldPointID,this.ReportAttachmentId,this.RequestCount,this.SignatureCount,this.CreatedBy,this.CreatedAt,this.UpdatedAt,this.Items,this.Requests,this.Signatures,this.Actions});
Inspection.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InspectionID = json['InspectionID'];
InspectionUID = json['InspectionUID'];
ProjectID = json['ProjectID'];
ProjectName = json['ProjectName'];
JobID = json['JobID'];
JobName = json['JobName'];
InspectionNo = json['InspectionNo'];
Type = json['Type'];
Title = json['Title'];
Status = json['Status'];
TemplateUID = json['TemplateUID'];
TemplateVersionNo = json['TemplateVersionNo'];
ScheduledFor = JsonConverters.fromJson(json['ScheduledFor'],'DateTime',context!);
StartedAt = JsonConverters.fromJson(json['StartedAt'],'DateTime',context!);
CompletedAt = JsonConverters.fromJson(json['CompletedAt'],'DateTime',context!);
ClosedAt = JsonConverters.fromJson(json['ClosedAt'],'DateTime',context!);
InspectorContactID = json['InspectorContactID'];
InspectorName = json['InspectorName'];
AgencyName = json['AgencyName'];
PermitNo = json['PermitNo'];
LocationText = json['LocationText'];
Notes = json['Notes'];
WeatherJson = json['WeatherJson'];
ItemsTotal = json['ItemsTotal'];
ItemsPassed = json['ItemsPassed'];
ItemsFailed = json['ItemsFailed'];
Outcome = json['Outcome'];
OutcomeNotes = json['OutcomeNotes'];
ReinspectionOfInspectionID = json['ReinspectionOfInspectionID'];
QcHoldPointID = json['QcHoldPointID'];
ReportAttachmentId = json['ReportAttachmentId'];
RequestCount = json['RequestCount'];
SignatureCount = json['SignatureCount'];
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
Items = JsonConverters.fromJson(json['Items'],'List<InspectionItem>',context!);
Requests = JsonConverters.fromJson(json['Requests'],'List<InspectionRequest>',context!);
Signatures = JsonConverters.fromJson(json['Signatures'],'List<SignatureRecord>',context!);
Actions = JsonConverters.fromJson(json['Actions'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'InspectionID': InspectionID,
'InspectionUID': InspectionUID,
'ProjectID': ProjectID,
'ProjectName': ProjectName,
'JobID': JobID,
'JobName': JobName,
'InspectionNo': InspectionNo,
'Type': Type,
'Title': Title,
'Status': Status,
'TemplateUID': TemplateUID,
'TemplateVersionNo': TemplateVersionNo,
'ScheduledFor': JsonConverters.toJson(ScheduledFor,'DateTime',context!),
'StartedAt': JsonConverters.toJson(StartedAt,'DateTime',context!),
'CompletedAt': JsonConverters.toJson(CompletedAt,'DateTime',context!),
'ClosedAt': JsonConverters.toJson(ClosedAt,'DateTime',context!),
'InspectorContactID': InspectorContactID,
'InspectorName': InspectorName,
'AgencyName': AgencyName,
'PermitNo': PermitNo,
'LocationText': LocationText,
'Notes': Notes,
'WeatherJson': WeatherJson,
'ItemsTotal': ItemsTotal,
'ItemsPassed': ItemsPassed,
'ItemsFailed': ItemsFailed,
'Outcome': Outcome,
'OutcomeNotes': OutcomeNotes,
'ReinspectionOfInspectionID': ReinspectionOfInspectionID,
'QcHoldPointID': QcHoldPointID,
'ReportAttachmentId': ReportAttachmentId,
'RequestCount': RequestCount,
'SignatureCount': SignatureCount,
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!),
'Items': JsonConverters.toJson(Items,'List<InspectionItem>',context!),
'Requests': JsonConverters.toJson(Requests,'List<InspectionRequest>',context!),
'Signatures': JsonConverters.toJson(Signatures,'List<SignatureRecord>',context!),
'Actions': JsonConverters.toJson(Actions,'List<String>',context!)
};
getTypeName() => "Inspection";
TypeContext? context = _ctx;
}
class InspectionResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
Inspection? Inspection;
InspectionResponse({this.ResponseStatus,this.Inspection});
InspectionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Inspection = JsonConverters.fromJson(json['Inspection'],'Inspection',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Inspection': JsonConverters.toJson(Inspection,'Inspection',context!)
};
getTypeName() => "InspectionResponse";
TypeContext? context = _ctx;
}
class InspectionSignRequest implements IConvertible
{
String? InspectionUID;
String? Role;
String? SignerName;
int? SignerContactID;
String? Method;
String? ImageDataUrl;
bool? ConsentAccepted;
InspectionSignRequest({this.InspectionUID,this.Role,this.SignerName,this.SignerContactID,this.Method,this.ImageDataUrl,this.ConsentAccepted});
InspectionSignRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InspectionUID = json['InspectionUID'];
Role = json['Role'];
SignerName = json['SignerName'];
SignerContactID = json['SignerContactID'];
Method = json['Method'];
ImageDataUrl = json['ImageDataUrl'];
ConsentAccepted = json['ConsentAccepted'];
return this;
}
Map<String, dynamic> toJson() => {
'InspectionUID': InspectionUID,
'Role': Role,
'SignerName': SignerName,
'SignerContactID': SignerContactID,
'Method': Method,
'ImageDataUrl': ImageDataUrl,
'ConsentAccepted': ConsentAccepted
};
getTypeName() => "InspectionSignRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'InspectionPhoto': TypeInfo(TypeOf.Class, create:() => InspectionPhoto()),
'InspectionItem': TypeInfo(TypeOf.Class, create:() => InspectionItem()),
'List<InspectionPhoto>': TypeInfo(TypeOf.Class, create:() => <InspectionPhoto>[]),
'InspectionRequest': TypeInfo(TypeOf.Class, create:() => InspectionRequest()),
'SignatureRecord': TypeInfo(TypeOf.Class, create:() => SignatureRecord()),
'Inspection': TypeInfo(TypeOf.Class, create:() => Inspection()),
'List<InspectionItem>': TypeInfo(TypeOf.Class, create:() => <InspectionItem>[]),
'List<InspectionRequest>': TypeInfo(TypeOf.Class, create:() => <InspectionRequest>[]),
'List<SignatureRecord>': TypeInfo(TypeOf.Class, create:() => <SignatureRecord>[]),
'InspectionResponse': TypeInfo(TypeOf.Class, create:() => InspectionResponse()),
'InspectionSignRequest': TypeInfo(TypeOf.Class, create:() => InspectionSignRequest()),
});
Dart InspectionSignRequest DTOs
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/inspections/{InspectionUID}/sign HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"InspectionUID":"00000000000000000000000000000000","Role":"String","SignerName":"String","SignerContactID":0,"Method":"String","ImageDataUrl":"String","ConsentAccepted":false}
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"}},"Inspection":{"InspectionID":0,"InspectionUID":"00000000000000000000000000000000","ProjectID":0,"ProjectName":"String","JobID":0,"JobName":"String","InspectionNo":"String","Type":"String","Title":"String","Status":"String","TemplateUID":"00000000000000000000000000000000","TemplateVersionNo":0,"ScheduledFor":"0001-01-01T00:00:00.0000000","StartedAt":"0001-01-01T00:00:00.0000000","CompletedAt":"0001-01-01T00:00:00.0000000","ClosedAt":"0001-01-01T00:00:00.0000000","InspectorContactID":0,"InspectorName":"String","AgencyName":"String","PermitNo":"String","LocationText":"String","Notes":"String","WeatherJson":"String","ItemsTotal":0,"ItemsPassed":0,"ItemsFailed":0,"Outcome":"String","OutcomeNotes":"String","ReinspectionOfInspectionID":0,"QcHoldPointID":0,"ReportAttachmentId":"00000000000000000000000000000000","RequestCount":0,"SignatureCount":0,"CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000","Items":[{"InspectionItemID":0,"InspectionID":0,"Seq":0,"Section":"String","Prompt":"String","ResponseType":"String","IsRequired":false,"Unit":"String","Guidance":"String","Result":"String","Value":"String","Notes":"String","PhotoCount":0,"LinkedPunchItemID":0,"LinkedPunchNo":"String","LinkedPunchStatus":"String","LinkedNcrID":0,"LinkedNcrNo":"String","LinkedActionID":0,"AnsweredBy":"String","AnsweredAt":"0001-01-01T00:00:00.0000000","Photos":[{"AttachmentId":"00000000000000000000000000000000","FileName":"String","Url":"String","CreatedBy":"String","CreatedDate":"0001-01-01T00:00:00.0000000","HasAnnotation":false,"AnnotatedAttachmentId":"00000000000000000000000000000000","AnnotatedUrl":"String"}]}],"Requests":[{"InspectionRequestID":0,"InspectionID":0,"Agency":"String","ContactName":"String","ContactPhone":"String","PermitNo":"String","RequestedDate":"0001-01-01T00:00:00.0000000","RequestedWindow":"String","Status":"String","ConfirmationNo":"String","Outcome":"String","CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000"}],"Signatures":[{"SignatureRecordID":0,"EntityType":"String","EntityID":0,"Role":"String","SignerName":"String","SignerContactID":0,"SignerUserId":"String","Method":"String","ImageAttachmentId":"00000000000000000000000000000000","ImageUrl":"String","ImageHash":"String","DocumentHash":"String","ConsentText":"String","IpAddress":"String","UserAgent":"String","SignedAt":"0001-01-01T00:00:00.0000000"}],"Actions":["String"]}}