| Requires any of the roles: | Worker, Agent, Administrator |
| POST,OPTIONS | /v1/TimeTracker/ClockInOut |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class ClockInOutResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
bool? response;
ClockInOutResponse({this.ResponseStatus,this.response});
ClockInOutResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
response = json['response'];
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'response': response
};
getTypeName() => "ClockInOutResponse";
TypeContext? context = _ctx;
}
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 ClockInOutRequest implements IConvertible
{
TimeCard? Timecard;
ClockInOutRequest({this.Timecard});
ClockInOutRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Timecard = JsonConverters.fromJson(json['Timecard'],'TimeCard',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Timecard': JsonConverters.toJson(Timecard,'TimeCard',context!)
};
getTypeName() => "ClockInOutRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'ClockInOutResponse': TypeInfo(TypeOf.Class, create:() => ClockInOutResponse()),
'TimeCard': TypeInfo(TypeOf.Class, create:() => TimeCard()),
'ClockInOutRequest': TypeInfo(TypeOf.Class, create:() => ClockInOutRequest()),
});
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.
POST /v1/TimeTracker/ClockInOut HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Timecard":{"AgentId":0,"CheckInId":0,"DateLogged":"0001-01-01T00:00:00.0000000","TimeIn":"PT0S","TimeInDate":"0001-01-01T00:00:00.0000000+00:00","TimeOut":"PT0S","TimeOutDate":"0001-01-01T00:00:00.0000000+00:00","TimeLogged":0,"PaymentType":0,"ServiceCodeId":0,"ServiceCode":"String","ServiceRate":0,"ServiceDescription":"String","WorkDescription":"String","AdjustedTimeIn":"PT0S","AdjustedTimeInDate":"0001-01-01T00:00:00.0000000+00:00","AdjustedTimeOut":"PT0S","AdjustedTimeOutDate":"0001-01-01T00:00:00.0000000+00:00","IsValid":false,"Adjusted":false,"ProjectID":0,"ProjectName":"String","ClientID":0,"ClientName":"String","CategoryID":0,"CategoryName":"String","JobID":0,"JobName":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"response":false}