Trendsic Platform Service

<back to all web services

SafetyIncidentUpdateRequest

Requires Authentication
The following routes are available for this service:
PUT,OPTIONS/v1/safety/incidents/{SafetyIncidentID}
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SafetyIncident:
    safety_incident_i_d: int = 0
    safety_incident_u_i_d: Optional[str] = None
    branch_id: Optional[str] = None
    project_i_d: Optional[int] = None
    incident_no: Optional[str] = None
    incident_type: Optional[str] = None
    severity: Optional[str] = None
    status: Optional[str] = None
    title: Optional[str] = None
    location: Optional[str] = None
    crew_label: Optional[str] = None
    description: Optional[str] = None
    reported_by: Optional[str] = None
    is_recordable: bool = False
    occurred_at: Optional[datetime.datetime] = None
    closed_at: Optional[datetime.datetime] = None
    source_ref: Optional[str] = None
    created_by: Optional[str] = None
    created_at: Optional[datetime.datetime] = None
    updated_at: Optional[datetime.datetime] = None
    days_ago: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SafetyIncidentResponse:
    response_status: Optional[ResponseStatus] = None
    incident: Optional[SafetyIncident] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SafetyIncidentUpdateRequest:
    safety_incident_i_d: int = 0
    incident_type: Optional[str] = None
    severity: Optional[str] = None
    title: Optional[str] = None
    location: Optional[str] = None
    crew_label: Optional[str] = None
    description: Optional[str] = None
    reported_by: Optional[str] = None
    is_recordable: bool = False
    occurred_at: Optional[datetime.datetime] = None

Python SafetyIncidentUpdateRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

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

PUT /v1/safety/incidents/{SafetyIncidentID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	SafetyIncidentID: 0,
	IncidentType: String,
	Severity: String,
	Title: String,
	Location: String,
	CrewLabel: String,
	Description: String,
	ReportedBy: String,
	IsRecordable: False,
	OccurredAt: 0001-01-01
}
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
		}
	},
	Incident: 
	{
		SafetyIncidentID: 0,
		SafetyIncidentUID: 00000000000000000000000000000000,
		BranchId: 00000000000000000000000000000000,
		ProjectID: 0,
		IncidentNo: String,
		IncidentType: String,
		Severity: String,
		Status: String,
		Title: String,
		Location: String,
		CrewLabel: String,
		Description: String,
		ReportedBy: String,
		IsRecordable: False,
		OccurredAt: 0001-01-01,
		ClosedAt: 0001-01-01,
		SourceRef: String,
		CreatedBy: String,
		CreatedAt: 0001-01-01,
		UpdatedAt: 0001-01-01,
		DaysAgo: 0
	}
}