Trendsic Platform Service

<back to all web services

CrewAssignmentsProjectRequest

Requires Authentication
The following routes are available for this service:
GET,POST,PUT,DELETE,OPTIONS/v1/CrewAssignments/Project/{SelectedDate}
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 Project:
    project_i_d: int = 0
    project_u_i_d: Optional[str] = None
    project_name: Optional[str] = None
    image_u_r_l: Optional[str] = None
    image_key: Optional[str] = None
    client_name: Optional[str] = None
    client_phone: Optional[str] = None
    client_email: Optional[str] = None
    project_manager_i_d: int = 0
    project_manager_name: Optional[str] = None
    start_date: Optional[datetime.datetime] = None
    end_date: Optional[datetime.datetime] = None
    actual_start_date: Optional[datetime.datetime] = None
    actual_end_date: Optional[datetime.datetime] = None
    job_count: int = 0
    crew_member_count: int = 0
    equipment_count: int = 0
    material_count: int = 0
    project_status_i_d: int = 0
    project_status_description: Optional[str] = None
    budget: Decimal = decimal.Decimal(0)
    cost_to_date: Decimal = decimal.Decimal(0)
    project_location: Optional[str] = None
    project_type: Optional[str] = None
    project_sponsor: Optional[str] = None
    created_by: Optional[str] = None
    created_at: Optional[datetime.datetime] = None
    updated_at: Optional[datetime.datetime] = None
    project_description: Optional[str] = None
    scope: Optional[str] = None
    status_id: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CrewAssignmentsProjectResponse:
    response_status: Optional[ResponseStatus] = None
    project: List[Project] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CrewAssignmentsProjectRequest:
    selected_date: datetime.datetime = datetime.datetime(1, 1, 1)
    project: List[Project] = field(default_factory=list)

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

POST /v1/CrewAssignments/Project/{SelectedDate} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	SelectedDate: 0001-01-01,
	Project: 
	[
		{
			ProjectID: 0,
			ProjectUID: 00000000000000000000000000000000,
			ProjectName: String,
			ImageURL: String,
			ImageKey: String,
			ClientName: String,
			ClientPhone: String,
			ClientEmail: String,
			ProjectManagerID: 0,
			ProjectManagerName: String,
			StartDate: 0001-01-01,
			EndDate: 0001-01-01,
			ActualStartDate: 0001-01-01,
			ActualEndDate: 0001-01-01,
			JobCount: 0,
			CrewMemberCount: 0,
			EquipmentCount: 0,
			MaterialCount: 0,
			ProjectStatusID: 0,
			ProjectStatusDescription: String,
			Budget: 0,
			CostToDate: 0,
			ProjectLocation: String,
			ProjectType: String,
			ProjectSponsor: String,
			CreatedBy: String,
			CreatedAt: 0001-01-01,
			UpdatedAt: 0001-01-01,
			ProjectDescription: String,
			Scope: String,
			StatusId: 0
		}
	]
}
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
		}
	},
	Project: 
	[
		{
			ProjectID: 0,
			ProjectUID: 00000000000000000000000000000000,
			ProjectName: String,
			ImageURL: String,
			ImageKey: String,
			ClientName: String,
			ClientPhone: String,
			ClientEmail: String,
			ProjectManagerID: 0,
			ProjectManagerName: String,
			StartDate: 0001-01-01,
			EndDate: 0001-01-01,
			ActualStartDate: 0001-01-01,
			ActualEndDate: 0001-01-01,
			JobCount: 0,
			CrewMemberCount: 0,
			EquipmentCount: 0,
			MaterialCount: 0,
			ProjectStatusID: 0,
			ProjectStatusDescription: String,
			Budget: 0,
			CostToDate: 0,
			ProjectLocation: String,
			ProjectType: String,
			ProjectSponsor: String,
			CreatedBy: String,
			CreatedAt: 0001-01-01,
			UpdatedAt: 0001-01-01,
			ProjectDescription: String,
			Scope: String,
			StatusId: 0
		}
	]
}