| Requires any of the roles: | Agent, Administrator |
| PUT,OPTIONS | /v1/project/job/{JobID}/schedule |
|---|
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 TimelineCrew:
project_job_crew_member_i_d: int = 0
contact_i_d: int = 0
contact_name: Optional[str] = None
budgeted_hours: Optional[Decimal] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimelineEquipment:
project_job_equipment_i_d: int = 0
equipment_i_d: int = 0
equipment_name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimelineJob:
job_i_d: int = 0
job_name: Optional[str] = None
expected_start_date: Optional[datetime.datetime] = None
expected_completion_date: Optional[datetime.datetime] = None
actual_start_date: Optional[datetime.datetime] = None
actual_end_date: Optional[datetime.datetime] = None
percent_complete: Decimal = decimal.Decimal(0)
status_i_d: Optional[int] = None
job_category: Optional[str] = None
is_agreement_visit: bool = False
occurrence_date: Optional[datetime.datetime] = None
crew: List[TimelineCrew] = field(default_factory=list)
equipment: List[TimelineEquipment] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JobScheduleUpdateResponse:
response_status: Optional[ResponseStatus] = None
job: Optional[TimelineJob] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JobScheduleUpdateRequest:
job_i_d: int = 0
expected_start_date: Optional[datetime.datetime] = None
expected_completion_date: Optional[datetime.datetime] = None
percent_complete: Optional[Decimal] = None
Python JobScheduleUpdateRequest 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /v1/project/job/{JobID}/schedule HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"JobID":0,"ExpectedStartDate":"0001-01-01T00:00:00.0000000","ExpectedCompletionDate":"0001-01-01T00:00:00.0000000","PercentComplete":0}
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"}},"Job":{"JobID":0,"JobName":"String","ExpectedStartDate":"0001-01-01T00:00:00.0000000","ExpectedCompletionDate":"0001-01-01T00:00:00.0000000","ActualStartDate":"0001-01-01T00:00:00.0000000","ActualEndDate":"0001-01-01T00:00:00.0000000","PercentComplete":0,"StatusID":0,"JobCategory":"String","IsAgreementVisit":false,"OccurrenceDate":"0001-01-01T00:00:00.0000000","Crew":[{"ProjectJobCrewMemberID":0,"ContactID":0,"ContactName":"String","BudgetedHours":0}],"Equipment":[{"ProjectJobEquipmentID":0,"EquipmentID":0,"EquipmentName":"String"}]}}