| POST,OPTIONS | /v1/fieldlog/submit |
|---|
import 'package:servicestack/servicestack.dart';
class FieldLogSubmitResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
int? FieldLogId;
String? FieldLogUID;
String? Status;
FieldLogSubmitResponse({this.ResponseStatus,this.FieldLogId,this.FieldLogUID,this.Status});
FieldLogSubmitResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
FieldLogId = json['FieldLogId'];
FieldLogUID = json['FieldLogUID'];
Status = json['Status'];
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'FieldLogId': FieldLogId,
'FieldLogUID': FieldLogUID,
'Status': Status
};
getTypeName() => "FieldLogSubmitResponse";
TypeContext? context = _ctx;
}
class FieldLogCrew implements IConvertible
{
int? ContactId;
String? StatusCode;
double? Hours;
String? CostCode;
String? SplitCostCode;
double? SplitHours;
FieldLogCrew({this.ContactId,this.StatusCode,this.Hours,this.CostCode,this.SplitCostCode,this.SplitHours});
FieldLogCrew.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ContactId = json['ContactId'];
StatusCode = json['StatusCode'];
Hours = JsonConverters.toDouble(json['Hours']);
CostCode = json['CostCode'];
SplitCostCode = json['SplitCostCode'];
SplitHours = JsonConverters.toDouble(json['SplitHours']);
return this;
}
Map<String, dynamic> toJson() => {
'ContactId': ContactId,
'StatusCode': StatusCode,
'Hours': Hours,
'CostCode': CostCode,
'SplitCostCode': SplitCostCode,
'SplitHours': SplitHours
};
getTypeName() => "FieldLogCrew";
TypeContext? context = _ctx;
}
class FieldLogEquipment implements IConvertible
{
int? EquipmentId;
String? EquipmentKey;
String? StatusCode;
double? EngineHours;
double? FuelGallons;
String? IdleReason;
String? DownNote;
FieldLogEquipment({this.EquipmentId,this.EquipmentKey,this.StatusCode,this.EngineHours,this.FuelGallons,this.IdleReason,this.DownNote});
FieldLogEquipment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
EquipmentId = json['EquipmentId'];
EquipmentKey = json['EquipmentKey'];
StatusCode = json['StatusCode'];
EngineHours = JsonConverters.toDouble(json['EngineHours']);
FuelGallons = JsonConverters.toDouble(json['FuelGallons']);
IdleReason = json['IdleReason'];
DownNote = json['DownNote'];
return this;
}
Map<String, dynamic> toJson() => {
'EquipmentId': EquipmentId,
'EquipmentKey': EquipmentKey,
'StatusCode': StatusCode,
'EngineHours': EngineHours,
'FuelGallons': FuelGallons,
'IdleReason': IdleReason,
'DownNote': DownNote
};
getTypeName() => "FieldLogEquipment";
TypeContext? context = _ctx;
}
class FieldLogSub implements IConvertible
{
int? ContactId;
String? Name;
String? Trade;
int? HeadCount;
double? HoursPer;
String? SourceCode;
String? Reporter;
String? Note;
bool? Verified;
String? StateCode;
FieldLogSub({this.ContactId,this.Name,this.Trade,this.HeadCount,this.HoursPer,this.SourceCode,this.Reporter,this.Note,this.Verified,this.StateCode});
FieldLogSub.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ContactId = json['ContactId'];
Name = json['Name'];
Trade = json['Trade'];
HeadCount = json['HeadCount'];
HoursPer = JsonConverters.toDouble(json['HoursPer']);
SourceCode = json['SourceCode'];
Reporter = json['Reporter'];
Note = json['Note'];
Verified = json['Verified'];
StateCode = json['StateCode'];
return this;
}
Map<String, dynamic> toJson() => {
'ContactId': ContactId,
'Name': Name,
'Trade': Trade,
'HeadCount': HeadCount,
'HoursPer': HoursPer,
'SourceCode': SourceCode,
'Reporter': Reporter,
'Note': Note,
'Verified': Verified,
'StateCode': StateCode
};
getTypeName() => "FieldLogSub";
TypeContext? context = _ctx;
}
class FieldLogQuantity implements IConvertible
{
String? PayItemCode;
String? Name;
String? Unit;
double? TodayQty;
FieldLogQuantity({this.PayItemCode,this.Name,this.Unit,this.TodayQty});
FieldLogQuantity.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PayItemCode = json['PayItemCode'];
Name = json['Name'];
Unit = json['Unit'];
TodayQty = JsonConverters.toDouble(json['TodayQty']);
return this;
}
Map<String, dynamic> toJson() => {
'PayItemCode': PayItemCode,
'Name': Name,
'Unit': Unit,
'TodayQty': TodayQty
};
getTypeName() => "FieldLogQuantity";
TypeContext? context = _ctx;
}
class FieldLogDelivery implements IConvertible
{
String? Po;
String? Material;
String? StatusCode;
String? QtyReceived;
FieldLogDelivery({this.Po,this.Material,this.StatusCode,this.QtyReceived});
FieldLogDelivery.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Po = json['Po'];
Material = json['Material'];
StatusCode = json['StatusCode'];
QtyReceived = json['QtyReceived'];
return this;
}
Map<String, dynamic> toJson() => {
'Po': Po,
'Material': Material,
'StatusCode': StatusCode,
'QtyReceived': QtyReceived
};
getTypeName() => "FieldLogDelivery";
TypeContext? context = _ctx;
}
class FieldLogConsumed implements IConvertible
{
String? Name;
String? Qty;
String? Use;
FieldLogConsumed({this.Name,this.Qty,this.Use});
FieldLogConsumed.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
Qty = json['Qty'];
Use = json['Use'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'Qty': Qty,
'Use': Use
};
getTypeName() => "FieldLogConsumed";
TypeContext? context = _ctx;
}
class FieldLogSubmitRequest implements IConvertible
{
int? ProjectId;
int? JobId;
String? LogDate;
String? Notes;
String? Weather;
int? TempF;
double? WeatherDelayHours;
String? ToolboxTalk;
bool? IncidentOccurred;
String? IncidentType;
String? IncidentNote;
int? IncidentPhotoCount;
List<FieldLogCrew>? Crew = [];
List<FieldLogEquipment>? Equipment = [];
List<FieldLogSub>? Subs = [];
List<FieldLogQuantity>? Quantities = [];
List<FieldLogDelivery>? Deliveries = [];
List<FieldLogConsumed>? Consumed = [];
FieldLogSubmitRequest({this.ProjectId,this.JobId,this.LogDate,this.Notes,this.Weather,this.TempF,this.WeatherDelayHours,this.ToolboxTalk,this.IncidentOccurred,this.IncidentType,this.IncidentNote,this.IncidentPhotoCount,this.Crew,this.Equipment,this.Subs,this.Quantities,this.Deliveries,this.Consumed});
FieldLogSubmitRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectId = json['ProjectId'];
JobId = json['JobId'];
LogDate = json['LogDate'];
Notes = json['Notes'];
Weather = json['Weather'];
TempF = json['TempF'];
WeatherDelayHours = JsonConverters.toDouble(json['WeatherDelayHours']);
ToolboxTalk = json['ToolboxTalk'];
IncidentOccurred = json['IncidentOccurred'];
IncidentType = json['IncidentType'];
IncidentNote = json['IncidentNote'];
IncidentPhotoCount = json['IncidentPhotoCount'];
Crew = JsonConverters.fromJson(json['Crew'],'List<FieldLogCrew>',context!);
Equipment = JsonConverters.fromJson(json['Equipment'],'List<FieldLogEquipment>',context!);
Subs = JsonConverters.fromJson(json['Subs'],'List<FieldLogSub>',context!);
Quantities = JsonConverters.fromJson(json['Quantities'],'List<FieldLogQuantity>',context!);
Deliveries = JsonConverters.fromJson(json['Deliveries'],'List<FieldLogDelivery>',context!);
Consumed = JsonConverters.fromJson(json['Consumed'],'List<FieldLogConsumed>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ProjectId': ProjectId,
'JobId': JobId,
'LogDate': LogDate,
'Notes': Notes,
'Weather': Weather,
'TempF': TempF,
'WeatherDelayHours': WeatherDelayHours,
'ToolboxTalk': ToolboxTalk,
'IncidentOccurred': IncidentOccurred,
'IncidentType': IncidentType,
'IncidentNote': IncidentNote,
'IncidentPhotoCount': IncidentPhotoCount,
'Crew': JsonConverters.toJson(Crew,'List<FieldLogCrew>',context!),
'Equipment': JsonConverters.toJson(Equipment,'List<FieldLogEquipment>',context!),
'Subs': JsonConverters.toJson(Subs,'List<FieldLogSub>',context!),
'Quantities': JsonConverters.toJson(Quantities,'List<FieldLogQuantity>',context!),
'Deliveries': JsonConverters.toJson(Deliveries,'List<FieldLogDelivery>',context!),
'Consumed': JsonConverters.toJson(Consumed,'List<FieldLogConsumed>',context!)
};
getTypeName() => "FieldLogSubmitRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'FieldLogSubmitResponse': TypeInfo(TypeOf.Class, create:() => FieldLogSubmitResponse()),
'FieldLogCrew': TypeInfo(TypeOf.Class, create:() => FieldLogCrew()),
'FieldLogEquipment': TypeInfo(TypeOf.Class, create:() => FieldLogEquipment()),
'FieldLogSub': TypeInfo(TypeOf.Class, create:() => FieldLogSub()),
'FieldLogQuantity': TypeInfo(TypeOf.Class, create:() => FieldLogQuantity()),
'FieldLogDelivery': TypeInfo(TypeOf.Class, create:() => FieldLogDelivery()),
'FieldLogConsumed': TypeInfo(TypeOf.Class, create:() => FieldLogConsumed()),
'FieldLogSubmitRequest': TypeInfo(TypeOf.Class, create:() => FieldLogSubmitRequest()),
'List<FieldLogCrew>': TypeInfo(TypeOf.Class, create:() => <FieldLogCrew>[]),
'List<FieldLogEquipment>': TypeInfo(TypeOf.Class, create:() => <FieldLogEquipment>[]),
'List<FieldLogSub>': TypeInfo(TypeOf.Class, create:() => <FieldLogSub>[]),
'List<FieldLogQuantity>': TypeInfo(TypeOf.Class, create:() => <FieldLogQuantity>[]),
'List<FieldLogDelivery>': TypeInfo(TypeOf.Class, create:() => <FieldLogDelivery>[]),
'List<FieldLogConsumed>': TypeInfo(TypeOf.Class, create:() => <FieldLogConsumed>[]),
});
Dart FieldLogSubmitRequest 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.
POST /v1/fieldlog/submit HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<FieldLogSubmitRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Consumed>
<FieldLogConsumed>
<Name>String</Name>
<Qty>String</Qty>
<Use>String</Use>
</FieldLogConsumed>
</Consumed>
<Crew>
<FieldLogCrew>
<ContactId>0</ContactId>
<CostCode>String</CostCode>
<Hours>0</Hours>
<SplitCostCode>String</SplitCostCode>
<SplitHours>0</SplitHours>
<StatusCode>String</StatusCode>
</FieldLogCrew>
</Crew>
<Deliveries>
<FieldLogDelivery>
<Material>String</Material>
<Po>String</Po>
<QtyReceived>String</QtyReceived>
<StatusCode>String</StatusCode>
</FieldLogDelivery>
</Deliveries>
<Equipment>
<FieldLogEquipment>
<DownNote>String</DownNote>
<EngineHours>0</EngineHours>
<EquipmentId>0</EquipmentId>
<EquipmentKey>String</EquipmentKey>
<FuelGallons>0</FuelGallons>
<IdleReason>String</IdleReason>
<StatusCode>String</StatusCode>
</FieldLogEquipment>
</Equipment>
<IncidentNote>String</IncidentNote>
<IncidentOccurred>false</IncidentOccurred>
<IncidentPhotoCount>0</IncidentPhotoCount>
<IncidentType>String</IncidentType>
<JobId>0</JobId>
<LogDate>String</LogDate>
<Notes>String</Notes>
<ProjectId>0</ProjectId>
<Quantities>
<FieldLogQuantity>
<Name>String</Name>
<PayItemCode>String</PayItemCode>
<TodayQty>0</TodayQty>
<Unit>String</Unit>
</FieldLogQuantity>
</Quantities>
<Subs>
<FieldLogSub>
<ContactId>0</ContactId>
<HeadCount>0</HeadCount>
<HoursPer>0</HoursPer>
<Name>String</Name>
<Note>String</Note>
<Reporter>String</Reporter>
<SourceCode>String</SourceCode>
<StateCode>String</StateCode>
<Trade>String</Trade>
<Verified>false</Verified>
</FieldLogSub>
</Subs>
<TempF>0</TempF>
<ToolboxTalk>String</ToolboxTalk>
<Weather>String</Weather>
<WeatherDelayHours>0</WeatherDelayHours>
</FieldLogSubmitRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<FieldLogSubmitResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<FieldLogId>0</FieldLogId>
<FieldLogUID>00000000-0000-0000-0000-000000000000</FieldLogUID>
<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>
<Status>String</Status>
</FieldLogSubmitResponse>