Trendsic Platform Service

<back to all web services

TimetrackerHistoryRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/TimeTracker/History/{AgentId}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class TimeCard implements IConvertible
{
    int? AgentId;
    int? CheckInId;
    DateTime? DateLogged;
    Duration? TimeIn;
    DateTime? TimeInDate;
    Duration? TimeOut;
    DateTime? TimeOutDate;
    double? TimeLogged;
    int? PaymentType;
    int? ServiceCodeId;
    String? ServiceCode;
    double? ServiceRate;
    String? ServiceDescription;
    String? WorkDescription;
    Duration? AdjustedTimeIn;
    DateTime? AdjustedTimeInDate;
    Duration? AdjustedTimeOut;
    DateTime? AdjustedTimeOutDate;
    bool? IsValid;
    bool? Adjusted;
    int? ProjectID;
    String? ProjectName;
    int? ClientID;
    String? ClientName;
    int? CategoryID;
    String? CategoryName;
    int? JobID;
    String? JobName;

    TimeCard({this.AgentId,this.CheckInId,this.DateLogged,this.TimeIn,this.TimeInDate,this.TimeOut,this.TimeOutDate,this.TimeLogged,this.PaymentType,this.ServiceCodeId,this.ServiceCode,this.ServiceRate,this.ServiceDescription,this.WorkDescription,this.AdjustedTimeIn,this.AdjustedTimeInDate,this.AdjustedTimeOut,this.AdjustedTimeOutDate,this.IsValid,this.Adjusted,this.ProjectID,this.ProjectName,this.ClientID,this.ClientName,this.CategoryID,this.CategoryName,this.JobID,this.JobName});
    TimeCard.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AgentId = json['AgentId'];
        CheckInId = json['CheckInId'];
        DateLogged = JsonConverters.fromJson(json['DateLogged'],'DateTime',context!);
        TimeIn = JsonConverters.fromJson(json['TimeIn'],'Duration',context!);
        TimeInDate = JsonConverters.fromJson(json['TimeInDate'],'DateTime',context!);
        TimeOut = JsonConverters.fromJson(json['TimeOut'],'Duration',context!);
        TimeOutDate = JsonConverters.fromJson(json['TimeOutDate'],'DateTime',context!);
        TimeLogged = JsonConverters.toDouble(json['TimeLogged']);
        PaymentType = json['PaymentType'];
        ServiceCodeId = json['ServiceCodeId'];
        ServiceCode = json['ServiceCode'];
        ServiceRate = JsonConverters.toDouble(json['ServiceRate']);
        ServiceDescription = json['ServiceDescription'];
        WorkDescription = json['WorkDescription'];
        AdjustedTimeIn = JsonConverters.fromJson(json['AdjustedTimeIn'],'Duration',context!);
        AdjustedTimeInDate = JsonConverters.fromJson(json['AdjustedTimeInDate'],'DateTime',context!);
        AdjustedTimeOut = JsonConverters.fromJson(json['AdjustedTimeOut'],'Duration',context!);
        AdjustedTimeOutDate = JsonConverters.fromJson(json['AdjustedTimeOutDate'],'DateTime',context!);
        IsValid = json['IsValid'];
        Adjusted = json['Adjusted'];
        ProjectID = json['ProjectID'];
        ProjectName = json['ProjectName'];
        ClientID = json['ClientID'];
        ClientName = json['ClientName'];
        CategoryID = json['CategoryID'];
        CategoryName = json['CategoryName'];
        JobID = json['JobID'];
        JobName = json['JobName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AgentId': AgentId,
        'CheckInId': CheckInId,
        'DateLogged': JsonConverters.toJson(DateLogged,'DateTime',context!),
        'TimeIn': JsonConverters.toJson(TimeIn,'Duration',context!),
        'TimeInDate': JsonConverters.toJson(TimeInDate,'DateTime',context!),
        'TimeOut': JsonConverters.toJson(TimeOut,'Duration',context!),
        'TimeOutDate': JsonConverters.toJson(TimeOutDate,'DateTime',context!),
        'TimeLogged': TimeLogged,
        'PaymentType': PaymentType,
        'ServiceCodeId': ServiceCodeId,
        'ServiceCode': ServiceCode,
        'ServiceRate': ServiceRate,
        'ServiceDescription': ServiceDescription,
        'WorkDescription': WorkDescription,
        'AdjustedTimeIn': JsonConverters.toJson(AdjustedTimeIn,'Duration',context!),
        'AdjustedTimeInDate': JsonConverters.toJson(AdjustedTimeInDate,'DateTime',context!),
        'AdjustedTimeOut': JsonConverters.toJson(AdjustedTimeOut,'Duration',context!),
        'AdjustedTimeOutDate': JsonConverters.toJson(AdjustedTimeOutDate,'DateTime',context!),
        'IsValid': IsValid,
        'Adjusted': Adjusted,
        'ProjectID': ProjectID,
        'ProjectName': ProjectName,
        'ClientID': ClientID,
        'ClientName': ClientName,
        'CategoryID': CategoryID,
        'CategoryName': CategoryName,
        'JobID': JobID,
        'JobName': JobName
    };

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

class TimetrackerHistoryResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<TimeCard>? TimeTrackerHistory = [];

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

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

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

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

class TimetrackerHistoryRequest implements IConvertible
{
    int? AgentId;
    DateTime? MinDate;
    DateTime? MaxDate;

    TimetrackerHistoryRequest({this.AgentId,this.MinDate,this.MaxDate});
    TimetrackerHistoryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'AgentId': AgentId,
        'MinDate': JsonConverters.toJson(MinDate,'DateTime',context!),
        'MaxDate': JsonConverters.toJson(MaxDate,'DateTime',context!)
    };

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

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

Dart TimetrackerHistoryRequest 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.

POST /v1/TimeTracker/History/{AgentId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<TimetrackerHistoryRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AgentId>0</AgentId>
  <MaxDate>0001-01-01T00:00:00</MaxDate>
  <MinDate>0001-01-01T00:00:00</MinDate>
</TimetrackerHistoryRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<TimetrackerHistoryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <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>
  <TimeTrackerHistory>
    <TimeCard>
      <Adjusted>false</Adjusted>
      <AdjustedTimeIn>PT0S</AdjustedTimeIn>
      <AdjustedTimeInDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </AdjustedTimeInDate>
      <AdjustedTimeOut>PT0S</AdjustedTimeOut>
      <AdjustedTimeOutDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </AdjustedTimeOutDate>
      <AgentId>0</AgentId>
      <CategoryID>0</CategoryID>
      <CategoryName>String</CategoryName>
      <CheckInId>0</CheckInId>
      <ClientID>0</ClientID>
      <ClientName>String</ClientName>
      <DateLogged>0001-01-01T00:00:00</DateLogged>
      <IsValid>false</IsValid>
      <JobID>0</JobID>
      <JobName>String</JobName>
      <PaymentType>0</PaymentType>
      <ProjectID>0</ProjectID>
      <ProjectName>String</ProjectName>
      <ServiceCode>String</ServiceCode>
      <ServiceCodeId>0</ServiceCodeId>
      <ServiceDescription>String</ServiceDescription>
      <ServiceRate>0</ServiceRate>
      <TimeIn>PT0S</TimeIn>
      <TimeInDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </TimeInDate>
      <TimeLogged>0</TimeLogged>
      <TimeOut>PT0S</TimeOut>
      <TimeOutDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </TimeOutDate>
      <WorkDescription>String</WorkDescription>
    </TimeCard>
  </TimeTrackerHistory>
</TimetrackerHistoryResponse>