| GET,OPTIONS | /v1/field/applications |
|---|
import 'package:servicestack/servicestack.dart';
class ApplicationView implements IConvertible
{
int? ChemicalApplicationID;
DateTime? AppliedAt;
String? AreaTreated;
String? ProductName;
String? EpaRegistrationNumber;
double? AmountApplied;
String? AmountUnit;
String? Concentration;
double? TreatedQuantity;
String? TreatedUnit;
String? TargetPest;
String? ApplicatorName;
String? ApplicatorLicence;
double? WindSpeedMph;
String? WindDirection;
double? TemperatureF;
String? Notes;
DateTime? SubmittedAt;
int? AmendsApplicationID;
bool? IsAmended;
ApplicationView({this.ChemicalApplicationID,this.AppliedAt,this.AreaTreated,this.ProductName,this.EpaRegistrationNumber,this.AmountApplied,this.AmountUnit,this.Concentration,this.TreatedQuantity,this.TreatedUnit,this.TargetPest,this.ApplicatorName,this.ApplicatorLicence,this.WindSpeedMph,this.WindDirection,this.TemperatureF,this.Notes,this.SubmittedAt,this.AmendsApplicationID,this.IsAmended});
ApplicationView.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ChemicalApplicationID = json['ChemicalApplicationID'];
AppliedAt = JsonConverters.fromJson(json['AppliedAt'],'DateTime',context!);
AreaTreated = json['AreaTreated'];
ProductName = json['ProductName'];
EpaRegistrationNumber = json['EpaRegistrationNumber'];
AmountApplied = JsonConverters.toDouble(json['AmountApplied']);
AmountUnit = json['AmountUnit'];
Concentration = json['Concentration'];
TreatedQuantity = JsonConverters.toDouble(json['TreatedQuantity']);
TreatedUnit = json['TreatedUnit'];
TargetPest = json['TargetPest'];
ApplicatorName = json['ApplicatorName'];
ApplicatorLicence = json['ApplicatorLicence'];
WindSpeedMph = JsonConverters.toDouble(json['WindSpeedMph']);
WindDirection = json['WindDirection'];
TemperatureF = JsonConverters.toDouble(json['TemperatureF']);
Notes = json['Notes'];
SubmittedAt = JsonConverters.fromJson(json['SubmittedAt'],'DateTime',context!);
AmendsApplicationID = json['AmendsApplicationID'];
IsAmended = json['IsAmended'];
return this;
}
Map<String, dynamic> toJson() => {
'ChemicalApplicationID': ChemicalApplicationID,
'AppliedAt': JsonConverters.toJson(AppliedAt,'DateTime',context!),
'AreaTreated': AreaTreated,
'ProductName': ProductName,
'EpaRegistrationNumber': EpaRegistrationNumber,
'AmountApplied': AmountApplied,
'AmountUnit': AmountUnit,
'Concentration': Concentration,
'TreatedQuantity': TreatedQuantity,
'TreatedUnit': TreatedUnit,
'TargetPest': TargetPest,
'ApplicatorName': ApplicatorName,
'ApplicatorLicence': ApplicatorLicence,
'WindSpeedMph': WindSpeedMph,
'WindDirection': WindDirection,
'TemperatureF': TemperatureF,
'Notes': Notes,
'SubmittedAt': JsonConverters.toJson(SubmittedAt,'DateTime',context!),
'AmendsApplicationID': AmendsApplicationID,
'IsAmended': IsAmended
};
getTypeName() => "ApplicationView";
TypeContext? context = _ctx;
}
class ApplicationResponse implements IConvertible
{
List<ApplicationView>? Applications = [];
int? ChemicalApplicationID;
ResponseStatus? ResponseStatus;
ApplicationResponse({this.Applications,this.ChemicalApplicationID,this.ResponseStatus});
ApplicationResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Applications = JsonConverters.fromJson(json['Applications'],'List<ApplicationView>',context!);
ChemicalApplicationID = json['ChemicalApplicationID'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Applications': JsonConverters.toJson(Applications,'List<ApplicationView>',context!),
'ChemicalApplicationID': ChemicalApplicationID,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "ApplicationResponse";
TypeContext? context = _ctx;
}
class ApplicationListRequest implements IConvertible
{
int? ProjectID;
int? AgreementJobID;
String? FromDate;
String? ToDate;
ApplicationListRequest({this.ProjectID,this.AgreementJobID,this.FromDate,this.ToDate});
ApplicationListRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectID = json['ProjectID'];
AgreementJobID = json['AgreementJobID'];
FromDate = json['FromDate'];
ToDate = json['ToDate'];
return this;
}
Map<String, dynamic> toJson() => {
'ProjectID': ProjectID,
'AgreementJobID': AgreementJobID,
'FromDate': FromDate,
'ToDate': ToDate
};
getTypeName() => "ApplicationListRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'ApplicationView': TypeInfo(TypeOf.Class, create:() => ApplicationView()),
'ApplicationResponse': TypeInfo(TypeOf.Class, create:() => ApplicationResponse()),
'List<ApplicationView>': TypeInfo(TypeOf.Class, create:() => <ApplicationView>[]),
'ApplicationListRequest': TypeInfo(TypeOf.Class, create:() => ApplicationListRequest()),
});
Dart ApplicationListRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/field/applications HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Applications":[{"ChemicalApplicationID":0,"AppliedAt":"0001-01-01T00:00:00.0000000","AreaTreated":"String","ProductName":"String","EpaRegistrationNumber":"String","AmountApplied":0,"AmountUnit":"String","Concentration":"String","TreatedQuantity":0,"TreatedUnit":"String","TargetPest":"String","ApplicatorName":"String","ApplicatorLicence":"String","WindSpeedMph":0,"WindDirection":"String","TemperatureF":0,"Notes":"String","SubmittedAt":"0001-01-01T00:00:00.0000000","AmendsApplicationID":0,"IsAmended":false}],"ChemicalApplicationID":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}