Trendsic Platform Service

<back to all web services

CrewAssignmentsRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/CrewAssignments/updateStatus
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class CrewAssignmentsResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;

    CrewAssignmentsResponse({this.ResponseStatus});
    CrewAssignmentsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "CrewAssignmentsResponse";
    TypeContext? context = _ctx;
}

class Assessment implements IConvertible
{
    String? AssessmentType;
    int? CrewMemberID;
    int? EquipmentID;
    int? ProjectID;
    int? JobID;
    String? Status;
    DateTime? AssessmentDate;

    Assessment({this.AssessmentType,this.CrewMemberID,this.EquipmentID,this.ProjectID,this.JobID,this.Status,this.AssessmentDate});
    Assessment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AssessmentType = json['AssessmentType'];
        CrewMemberID = json['CrewMemberID'];
        EquipmentID = json['EquipmentID'];
        ProjectID = json['ProjectID'];
        JobID = json['JobID'];
        Status = json['Status'];
        AssessmentDate = JsonConverters.fromJson(json['AssessmentDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AssessmentType': AssessmentType,
        'CrewMemberID': CrewMemberID,
        'EquipmentID': EquipmentID,
        'ProjectID': ProjectID,
        'JobID': JobID,
        'Status': Status,
        'AssessmentDate': JsonConverters.toJson(AssessmentDate,'DateTime',context!)
    };

    getTypeName() => "Assessment";
    TypeContext? context = _ctx;
}

class CrewAssignmentsRequest implements IConvertible
{
    List<Assessment>? Assessment = [];

    CrewAssignmentsRequest({this.Assessment});
    CrewAssignmentsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Assessment = JsonConverters.fromJson(json['Assessment'],'List<Assessment>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Assessment': JsonConverters.toJson(Assessment,'List<Assessment>',context!)
    };

    getTypeName() => "CrewAssignmentsRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CrewAssignmentsResponse': TypeInfo(TypeOf.Class, create:() => CrewAssignmentsResponse()),
    'Assessment': TypeInfo(TypeOf.Class, create:() => Assessment()),
    'CrewAssignmentsRequest': TypeInfo(TypeOf.Class, create:() => CrewAssignmentsRequest()),
    'List<Assessment>': TypeInfo(TypeOf.Class, create:() => <Assessment>[]),
});

Dart CrewAssignmentsRequest DTOs

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

HTTP + CSV

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

POST /v1/CrewAssignments/updateStatus HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Assessment":[{"AssessmentType":"String","CrewMemberID":0,"EquipmentID":0,"ProjectID":0,"JobID":0,"Status":"String","AssessmentDate":"0001-01-01T00:00:00.0000000"}]}
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"}}}