Trendsic Platform Service

<back to all web services

EquipmentUsageRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/Equipment/{EquipmentID}/usage
import 'package:servicestack/servicestack.dart';

class EquipmentUsageEntry implements IConvertible
{
    int? ProjectJobEquipmentID;
    int? ProjectID;
    String? ProjectName;
    int? JobID;
    String? JobName;
    int? StatusID;
    DateTime? StartDate;
    DateTime? EndDate;
    int? BookingCount;

    EquipmentUsageEntry({this.ProjectJobEquipmentID,this.ProjectID,this.ProjectName,this.JobID,this.JobName,this.StatusID,this.StartDate,this.EndDate,this.BookingCount});
    EquipmentUsageEntry.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ProjectJobEquipmentID = json['ProjectJobEquipmentID'];
        ProjectID = json['ProjectID'];
        ProjectName = json['ProjectName'];
        JobID = json['JobID'];
        JobName = json['JobName'];
        StatusID = json['StatusID'];
        StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
        EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
        BookingCount = json['BookingCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ProjectJobEquipmentID': ProjectJobEquipmentID,
        'ProjectID': ProjectID,
        'ProjectName': ProjectName,
        'JobID': JobID,
        'JobName': JobName,
        'StatusID': StatusID,
        'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
        'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
        'BookingCount': BookingCount
    };

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

class VehicleDriverUse implements IConvertible
{
    int? SessionId;
    int? ContactID;
    String? Name;
    String? Board;
    DateTime? StartUtc;
    DateTime? EndUtc;
    String? EndReason;

    VehicleDriverUse({this.SessionId,this.ContactID,this.Name,this.Board,this.StartUtc,this.EndUtc,this.EndReason});
    VehicleDriverUse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SessionId = json['SessionId'];
        ContactID = json['ContactID'];
        Name = json['Name'];
        Board = json['Board'];
        StartUtc = JsonConverters.fromJson(json['StartUtc'],'DateTime',context!);
        EndUtc = JsonConverters.fromJson(json['EndUtc'],'DateTime',context!);
        EndReason = json['EndReason'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SessionId': SessionId,
        'ContactID': ContactID,
        'Name': Name,
        'Board': Board,
        'StartUtc': JsonConverters.toJson(StartUtc,'DateTime',context!),
        'EndUtc': JsonConverters.toJson(EndUtc,'DateTime',context!),
        'EndReason': EndReason
    };

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

class EquipmentUsageResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<EquipmentUsageEntry>? Usage = [];
    List<VehicleDriverUse>? Drivers = [];

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

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

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

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

class EquipmentUsageRequest implements IConvertible
{
    int? EquipmentID;

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

    fromMap(Map<String, dynamic> json) {
        EquipmentID = json['EquipmentID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'EquipmentID': EquipmentID
    };

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

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

Dart EquipmentUsageRequest DTOs

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

HTTP + XML

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

GET /v1/Equipment/{EquipmentID}/usage HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<EquipmentUsageResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Drivers>
    <VehicleDriverUse>
      <Board>String</Board>
      <ContactID>0</ContactID>
      <EndReason>String</EndReason>
      <EndUtc>0001-01-01T00:00:00</EndUtc>
      <Name>String</Name>
      <SessionId>0</SessionId>
      <StartUtc>0001-01-01T00:00:00</StartUtc>
    </VehicleDriverUse>
  </Drivers>
  <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>
  <Usage>
    <EquipmentUsageEntry>
      <BookingCount>0</BookingCount>
      <EndDate>0001-01-01T00:00:00</EndDate>
      <JobID>0</JobID>
      <JobName>String</JobName>
      <ProjectID>0</ProjectID>
      <ProjectJobEquipmentID>0</ProjectJobEquipmentID>
      <ProjectName>String</ProjectName>
      <StartDate>0001-01-01T00:00:00</StartDate>
      <StatusID>0</StatusID>
    </EquipmentUsageEntry>
  </Usage>
</EquipmentUsageResponse>