Trendsic Platform Service

<back to all web services

ApplicationCreateRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/field/application
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 ApplicationCreateRequest implements IConvertible
{
    int? WorkerScheduleItemID;
    int? AgreementJobID;
    int? JobID;
    int? ProjectID;
    String? AppliedAt;
    String? AreaTreated;
    int? MaterialID;
    double? AmountApplied;
    String? AmountUnit;
    String? Concentration;
    double? TreatedQuantity;
    String? TreatedUnit;
    String? TargetPest;
    double? WindSpeedMph;
    String? WindDirection;
    double? TemperatureF;
    String? WeatherSource;
    String? Notes;
    int? AmendsApplicationID;

    ApplicationCreateRequest({this.WorkerScheduleItemID,this.AgreementJobID,this.JobID,this.ProjectID,this.AppliedAt,this.AreaTreated,this.MaterialID,this.AmountApplied,this.AmountUnit,this.Concentration,this.TreatedQuantity,this.TreatedUnit,this.TargetPest,this.WindSpeedMph,this.WindDirection,this.TemperatureF,this.WeatherSource,this.Notes,this.AmendsApplicationID});
    ApplicationCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        WorkerScheduleItemID = json['WorkerScheduleItemID'];
        AgreementJobID = json['AgreementJobID'];
        JobID = json['JobID'];
        ProjectID = json['ProjectID'];
        AppliedAt = json['AppliedAt'];
        AreaTreated = json['AreaTreated'];
        MaterialID = json['MaterialID'];
        AmountApplied = JsonConverters.toDouble(json['AmountApplied']);
        AmountUnit = json['AmountUnit'];
        Concentration = json['Concentration'];
        TreatedQuantity = JsonConverters.toDouble(json['TreatedQuantity']);
        TreatedUnit = json['TreatedUnit'];
        TargetPest = json['TargetPest'];
        WindSpeedMph = JsonConverters.toDouble(json['WindSpeedMph']);
        WindDirection = json['WindDirection'];
        TemperatureF = JsonConverters.toDouble(json['TemperatureF']);
        WeatherSource = json['WeatherSource'];
        Notes = json['Notes'];
        AmendsApplicationID = json['AmendsApplicationID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'WorkerScheduleItemID': WorkerScheduleItemID,
        'AgreementJobID': AgreementJobID,
        'JobID': JobID,
        'ProjectID': ProjectID,
        'AppliedAt': AppliedAt,
        'AreaTreated': AreaTreated,
        'MaterialID': MaterialID,
        'AmountApplied': AmountApplied,
        'AmountUnit': AmountUnit,
        'Concentration': Concentration,
        'TreatedQuantity': TreatedQuantity,
        'TreatedUnit': TreatedUnit,
        'TargetPest': TargetPest,
        'WindSpeedMph': WindSpeedMph,
        'WindDirection': WindDirection,
        'TemperatureF': TemperatureF,
        'WeatherSource': WeatherSource,
        'Notes': Notes,
        'AmendsApplicationID': AmendsApplicationID
    };

    getTypeName() => "ApplicationCreateRequest";
    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>[]),
    'ApplicationCreateRequest': TypeInfo(TypeOf.Class, create:() => ApplicationCreateRequest()),
});

Dart ApplicationCreateRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/field/application HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"WorkerScheduleItemID":0,"AgreementJobID":0,"JobID":0,"ProjectID":0,"AppliedAt":"String","AreaTreated":"String","MaterialID":0,"AmountApplied":0,"AmountUnit":"String","Concentration":"String","TreatedQuantity":0,"TreatedUnit":"String","TargetPest":"String","WindSpeedMph":0,"WindDirection":"String","TemperatureF":0,"WeatherSource":"String","Notes":"String","AmendsApplicationID":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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"}}}