| Required role: | Administrator |
| GET,POST,PUT,DELETE,OPTIONS | /v1/TimeTracker/{CheckInId} | ||
|---|---|---|---|
| GET,POST,PUT,DELETE,OPTIONS | /v1/TimeTracker |
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 TimecardCheckInResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<TimeCard>? TimecardCheckIn = [];
TimecardCheckInResponse({this.ResponseStatus,this.TimecardCheckIn});
TimecardCheckInResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
TimecardCheckIn = JsonConverters.fromJson(json['TimecardCheckIn'],'List<TimeCard>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'TimecardCheckIn': JsonConverters.toJson(TimecardCheckIn,'List<TimeCard>',context!)
};
getTypeName() => "TimecardCheckInResponse";
TypeContext? context = _ctx;
}
class TimecardCheckInRequest implements IConvertible
{
int? CheckInId;
List<TimeCard>? TimecardCheckIn = [];
TimecardCheckInRequest({this.CheckInId,this.TimecardCheckIn});
TimecardCheckInRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CheckInId = json['CheckInId'];
TimecardCheckIn = JsonConverters.fromJson(json['TimecardCheckIn'],'List<TimeCard>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CheckInId': CheckInId,
'TimecardCheckIn': JsonConverters.toJson(TimecardCheckIn,'List<TimeCard>',context!)
};
getTypeName() => "TimecardCheckInRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'TimeCard': TypeInfo(TypeOf.Class, create:() => TimeCard()),
'TimecardCheckInResponse': TypeInfo(TypeOf.Class, create:() => TimecardCheckInResponse()),
'List<TimeCard>': TypeInfo(TypeOf.Class, create:() => <TimeCard>[]),
'TimecardCheckInRequest': TypeInfo(TypeOf.Class, create:() => TimecardCheckInRequest()),
});
Dart TimecardCheckInRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/TimeTracker/{CheckInId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CheckInId: 0,
TimecardCheckIn:
[
{
AgentId: 0,
CheckInId: 0,
DateLogged: 0001-01-01,
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: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
TimecardCheckIn:
[
{
AgentId: 0,
CheckInId: 0,
DateLogged: 0001-01-01,
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
}
]
}