Trendsic Platform Service

<back to all web services

PmJobRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/pm/job/{JobID}
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 PmJobCrew:
    contact_i_d: int = 0
    name: Optional[str] = None
    rate: float = 0.0
    budgeted_hours: float = 0.0
    is_open: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmJobResource:
    id: int = 0
    name: Optional[str] = None
    amount: float = 0.0
    qty: int = 0
    unit: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmJob:
    job_i_d: int = 0
    name: Optional[str] = None
    description: Optional[str] = None
    status: Optional[str] = None
    start_date: Optional[str] = None
    end_date: Optional[str] = None
    crew_count: int = 0
    budgeted_hours: float = 0.0
    equipment_count: int = 0
    material_count: int = 0
    crew_cost: float = 0.0
    equip_cost: float = 0.0
    mat_cost: float = 0.0
    cost: float = 0.0
    no_crew: bool = False
    equip_conflict: bool = False
    material_gap: bool = False
    ready_pct: int = 0
    priority: Optional[str] = None
    tags: List[str] = field(default_factory=list)
    crew: List[PmJobCrew] = field(default_factory=list)
    equipment: List[PmJobResource] = field(default_factory=list)
    materials: List[PmJobResource] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmJobResponse:
    job: Optional[PmJob] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PmJobRequest:
    job_i_d: int = 0

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

GET /v1/pm/job/{JobID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Job: 
	{
		JobID: 0,
		Name: String,
		Description: String,
		Status: String,
		StartDate: String,
		EndDate: String,
		CrewCount: 0,
		BudgetedHours: 0,
		EquipmentCount: 0,
		MaterialCount: 0,
		CrewCost: 0,
		EquipCost: 0,
		MatCost: 0,
		Cost: 0,
		NoCrew: False,
		EquipConflict: False,
		MaterialGap: False,
		ReadyPct: 0,
		Priority: String,
		Tags: 
		[
			String
		],
		Crew: 
		[
			{
				ContactID: 0,
				Name: String,
				Rate: 0,
				BudgetedHours: 0,
				IsOpen: False
			}
		],
		Equipment: 
		[
			{
				Id: 0,
				Name: String,
				Amount: 0,
				Qty: 0,
				Unit: String
			}
		],
		Materials: 
		[
			{
				Id: 0,
				Name: String,
				Amount: 0,
				Qty: 0,
				Unit: String
			}
		]
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}