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';
import 'dart:typed_data';

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

GET /v1/safety/compliance HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SafetyComplianceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <IncidentMix>
    <SafetyIncidentMixRow>
      <Cnt>0</Cnt>
      <Severity>String</Severity>
    </SafetyIncidentMixRow>
  </IncidentMix>
  <Kpis>
    <DaysWithoutRecordable>0</DaysWithoutRecordable>
    <OpenIncidents>0</OpenIncidents>
    <OverdueCAs>0</OverdueCAs>
    <ParticipationPct>0</ParticipationPct>
    <ProjectsWithCrewToday>0</ProjectsWithCrewToday>
    <ProjectsWithTalkToday>0</ProjectsWithTalkToday>
    <Recordables12mo>0</Recordables12mo>
  </Kpis>
  <MissingTalks>
    <SafetyMissingTalk>
      <CrewCount>0</CrewCount>
      <ProjectID>0</ProjectID>
      <ProjectName>String</ProjectName>
      <ProjectUID>String</ProjectUID>
    </SafetyMissingTalk>
  </MissingTalks>
  <Projects>
    <SafetyComplianceProject>
      <Branch>String</Branch>
      <CrewCount>0</CrewCount>
      <HasTalkToday>false</HasTalkToday>
      <OpenIncidents>0</OpenIncidents>
      <OverdueCAs>0</OverdueCAs>
      <ProjectID>0</ProjectID>
      <ProjectName>String</ProjectName>
      <ProjectUID>String</ProjectUID>
      <Recordables12mo>0</Recordables12mo>
      <TalkAckPct>0</TalkAckPct>
    </SafetyComplianceProject>
  </Projects>
  <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>
  <Trend>
    <SafetyTrendWeek>
      <Acks>0</Acks>
      <Roster>0</Roster>
      <WeekStart>String</WeekStart>
    </SafetyTrendWeek>
  </Trend>
</SafetyComplianceResponse>