Trendsic Platform Service

<back to all web services

SafetyComplianceRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/safety/compliance
import 'package:servicestack/servicestack.dart';

class SafetyComplianceKpis implements IConvertible
{
    int? ParticipationPct;
    int? OpenIncidents;
    int? OverdueCAs;
    int? Recordables12mo;
    int? DaysWithoutRecordable;
    int? ProjectsWithTalkToday;
    int? ProjectsWithCrewToday;

    SafetyComplianceKpis({this.ParticipationPct,this.OpenIncidents,this.OverdueCAs,this.Recordables12mo,this.DaysWithoutRecordable,this.ProjectsWithTalkToday,this.ProjectsWithCrewToday});
    SafetyComplianceKpis.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ParticipationPct = json['ParticipationPct'];
        OpenIncidents = json['OpenIncidents'];
        OverdueCAs = json['OverdueCAs'];
        Recordables12mo = json['Recordables12mo'];
        DaysWithoutRecordable = json['DaysWithoutRecordable'];
        ProjectsWithTalkToday = json['ProjectsWithTalkToday'];
        ProjectsWithCrewToday = json['ProjectsWithCrewToday'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ParticipationPct': ParticipationPct,
        'OpenIncidents': OpenIncidents,
        'OverdueCAs': OverdueCAs,
        'Recordables12mo': Recordables12mo,
        'DaysWithoutRecordable': DaysWithoutRecordable,
        'ProjectsWithTalkToday': ProjectsWithTalkToday,
        'ProjectsWithCrewToday': ProjectsWithCrewToday
    };

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

class SafetyComplianceProject implements IConvertible
{
    int? ProjectID;
    String? ProjectUID;
    String? ProjectName;
    String? Branch;
    int? CrewCount;
    bool? HasTalkToday;
    int? TalkAckPct;
    int? OpenIncidents;
    int? OverdueCAs;
    int? Recordables12mo;

    SafetyComplianceProject({this.ProjectID,this.ProjectUID,this.ProjectName,this.Branch,this.CrewCount,this.HasTalkToday,this.TalkAckPct,this.OpenIncidents,this.OverdueCAs,this.Recordables12mo});
    SafetyComplianceProject.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ProjectID = json['ProjectID'];
        ProjectUID = json['ProjectUID'];
        ProjectName = json['ProjectName'];
        Branch = json['Branch'];
        CrewCount = json['CrewCount'];
        HasTalkToday = json['HasTalkToday'];
        TalkAckPct = json['TalkAckPct'];
        OpenIncidents = json['OpenIncidents'];
        OverdueCAs = json['OverdueCAs'];
        Recordables12mo = json['Recordables12mo'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ProjectID': ProjectID,
        'ProjectUID': ProjectUID,
        'ProjectName': ProjectName,
        'Branch': Branch,
        'CrewCount': CrewCount,
        'HasTalkToday': HasTalkToday,
        'TalkAckPct': TalkAckPct,
        'OpenIncidents': OpenIncidents,
        'OverdueCAs': OverdueCAs,
        'Recordables12mo': Recordables12mo
    };

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

class SafetyTrendWeek implements IConvertible
{
    String? WeekStart;
    int? Acks;
    int? Roster;

    SafetyTrendWeek({this.WeekStart,this.Acks,this.Roster});
    SafetyTrendWeek.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'WeekStart': WeekStart,
        'Acks': Acks,
        'Roster': Roster
    };

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

class SafetyIncidentMixRow implements IConvertible
{
    String? Severity;
    int? Cnt;

    SafetyIncidentMixRow({this.Severity,this.Cnt});
    SafetyIncidentMixRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class SafetyMissingTalk implements IConvertible
{
    int? ProjectID;
    String? ProjectUID;
    String? ProjectName;
    int? CrewCount;

    SafetyMissingTalk({this.ProjectID,this.ProjectUID,this.ProjectName,this.CrewCount});
    SafetyMissingTalk.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ProjectID = json['ProjectID'];
        ProjectUID = json['ProjectUID'];
        ProjectName = json['ProjectName'];
        CrewCount = json['CrewCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ProjectID': ProjectID,
        'ProjectUID': ProjectUID,
        'ProjectName': ProjectName,
        'CrewCount': CrewCount
    };

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

class SafetyComplianceResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    SafetyComplianceKpis? Kpis;
    List<SafetyComplianceProject>? Projects = [];
    List<SafetyTrendWeek>? Trend = [];
    List<SafetyIncidentMixRow>? IncidentMix = [];
    List<SafetyMissingTalk>? MissingTalks = [];

    SafetyComplianceResponse({this.ResponseStatus,this.Kpis,this.Projects,this.Trend,this.IncidentMix,this.MissingTalks});
    SafetyComplianceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Kpis = JsonConverters.fromJson(json['Kpis'],'SafetyComplianceKpis',context!);
        Projects = JsonConverters.fromJson(json['Projects'],'List<SafetyComplianceProject>',context!);
        Trend = JsonConverters.fromJson(json['Trend'],'List<SafetyTrendWeek>',context!);
        IncidentMix = JsonConverters.fromJson(json['IncidentMix'],'List<SafetyIncidentMixRow>',context!);
        MissingTalks = JsonConverters.fromJson(json['MissingTalks'],'List<SafetyMissingTalk>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Kpis': JsonConverters.toJson(Kpis,'SafetyComplianceKpis',context!),
        'Projects': JsonConverters.toJson(Projects,'List<SafetyComplianceProject>',context!),
        'Trend': JsonConverters.toJson(Trend,'List<SafetyTrendWeek>',context!),
        'IncidentMix': JsonConverters.toJson(IncidentMix,'List<SafetyIncidentMixRow>',context!),
        'MissingTalks': JsonConverters.toJson(MissingTalks,'List<SafetyMissingTalk>',context!)
    };

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

class SafetyComplianceRequest implements IConvertible
{
    int? Days;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'SafetyComplianceKpis': TypeInfo(TypeOf.Class, create:() => SafetyComplianceKpis()),
    'SafetyComplianceProject': TypeInfo(TypeOf.Class, create:() => SafetyComplianceProject()),
    'SafetyTrendWeek': TypeInfo(TypeOf.Class, create:() => SafetyTrendWeek()),
    'SafetyIncidentMixRow': TypeInfo(TypeOf.Class, create:() => SafetyIncidentMixRow()),
    'SafetyMissingTalk': TypeInfo(TypeOf.Class, create:() => SafetyMissingTalk()),
    'SafetyComplianceResponse': TypeInfo(TypeOf.Class, create:() => SafetyComplianceResponse()),
    'List<SafetyComplianceProject>': TypeInfo(TypeOf.Class, create:() => <SafetyComplianceProject>[]),
    'List<SafetyTrendWeek>': TypeInfo(TypeOf.Class, create:() => <SafetyTrendWeek>[]),
    'List<SafetyIncidentMixRow>': TypeInfo(TypeOf.Class, create:() => <SafetyIncidentMixRow>[]),
    'List<SafetyMissingTalk>': TypeInfo(TypeOf.Class, create:() => <SafetyMissingTalk>[]),
    'SafetyComplianceRequest': TypeInfo(TypeOf.Class, create:() => SafetyComplianceRequest()),
});

Dart SafetyComplianceRequest DTOs

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

HTTP + JSON

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

GET /v1/safety/compliance HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
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"}},"Kpis":{"ParticipationPct":0,"OpenIncidents":0,"OverdueCAs":0,"Recordables12mo":0,"DaysWithoutRecordable":0,"ProjectsWithTalkToday":0,"ProjectsWithCrewToday":0},"Projects":[{"ProjectID":0,"ProjectUID":"String","ProjectName":"String","Branch":"String","CrewCount":0,"HasTalkToday":false,"TalkAckPct":0,"OpenIncidents":0,"OverdueCAs":0,"Recordables12mo":0}],"Trend":[{"WeekStart":"String","Acks":0,"Roster":0}],"IncidentMix":[{"Severity":"String","Cnt":0}],"MissingTalks":[{"ProjectID":0,"ProjectUID":"String","ProjectName":"String","CrewCount":0}]}