| GET,OPTIONS | /v1/safety/metrics |
|---|
import 'package:servicestack/servicestack.dart';
class SafetyMetrics implements IConvertible
{
int? DaysWithoutRecordable;
double? Trir;
int? OpenIncidents;
int? CorrectiveCount;
int? ToolboxTalksWeek;
int? ObservationsMonth;
int? Recordables12mo;
double? LaborHours12mo;
SafetyMetrics({this.DaysWithoutRecordable,this.Trir,this.OpenIncidents,this.CorrectiveCount,this.ToolboxTalksWeek,this.ObservationsMonth,this.Recordables12mo,this.LaborHours12mo});
SafetyMetrics.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
DaysWithoutRecordable = json['DaysWithoutRecordable'];
Trir = JsonConverters.toDouble(json['Trir']);
OpenIncidents = json['OpenIncidents'];
CorrectiveCount = json['CorrectiveCount'];
ToolboxTalksWeek = json['ToolboxTalksWeek'];
ObservationsMonth = json['ObservationsMonth'];
Recordables12mo = json['Recordables12mo'];
LaborHours12mo = JsonConverters.toDouble(json['LaborHours12mo']);
return this;
}
Map<String, dynamic> toJson() => {
'DaysWithoutRecordable': DaysWithoutRecordable,
'Trir': Trir,
'OpenIncidents': OpenIncidents,
'CorrectiveCount': CorrectiveCount,
'ToolboxTalksWeek': ToolboxTalksWeek,
'ObservationsMonth': ObservationsMonth,
'Recordables12mo': Recordables12mo,
'LaborHours12mo': LaborHours12mo
};
getTypeName() => "SafetyMetrics";
TypeContext? context = _ctx;
}
class SafetyMetricsResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
SafetyMetrics? Metrics;
SafetyMetricsResponse({this.ResponseStatus,this.Metrics});
SafetyMetricsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Metrics = JsonConverters.fromJson(json['Metrics'],'SafetyMetrics',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Metrics': JsonConverters.toJson(Metrics,'SafetyMetrics',context!)
};
getTypeName() => "SafetyMetricsResponse";
TypeContext? context = _ctx;
}
class SafetyMetricsRequest implements IConvertible
{
SafetyMetricsRequest();
SafetyMetricsRequest.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "SafetyMetricsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'SafetyMetrics': TypeInfo(TypeOf.Class, create:() => SafetyMetrics()),
'SafetyMetricsResponse': TypeInfo(TypeOf.Class, create:() => SafetyMetricsResponse()),
'SafetyMetricsRequest': TypeInfo(TypeOf.Class, create:() => SafetyMetricsRequest()),
});
Dart SafetyMetricsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/safety/metrics HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<SafetyMetricsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Metrics>
<CorrectiveCount>0</CorrectiveCount>
<DaysWithoutRecordable>0</DaysWithoutRecordable>
<LaborHours12mo>0</LaborHours12mo>
<ObservationsMonth>0</ObservationsMonth>
<OpenIncidents>0</OpenIncidents>
<Recordables12mo>0</Recordables12mo>
<ToolboxTalksWeek>0</ToolboxTalksWeek>
<Trir>0</Trir>
</Metrics>
<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>
</SafetyMetricsResponse>