| POST,OPTIONS | /v1/dispatch/requests/{RequestId}/quote |
|---|
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 DispatchRequestEventView:
event_id: int = 0
kind: Optional[str] = None
detail: Optional[str] = None
at_utc: datetime.datetime = datetime.datetime(1, 1, 1)
by_who: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchRequestView:
request_id: int = 0
code: Optional[str] = None
customer_name: Optional[str] = None
customer_phone: Optional[str] = None
customer_email: Optional[str] = None
cargo: Optional[str] = None
units: int = 0
from_loc: Optional[str] = None
to_loc: Optional[str] = None
miles: Optional[int] = None
window_text: Optional[str] = None
is_urgent: bool = False
notes: Optional[str] = None
source: Optional[str] = None
status: Optional[str] = None
required_rig: Optional[str] = None
units_per_truck: Optional[int] = None
rate_per_load: Optional[Decimal] = None
urgency_pct: Decimal = decimal.Decimal(0)
cost_per_load: Optional[Decimal] = None
loads_needed: Optional[int] = None
quote_total: Optional[Decimal] = None
quote_version: int = 0
quoted_utc: Optional[datetime.datetime] = None
quoted_by: Optional[str] = None
accept_token_expires_utc: Optional[datetime.datetime] = None
accepted_utc: Optional[datetime.datetime] = None
accepted_via: Optional[str] = None
declined_utc: Optional[datetime.datetime] = None
declined_by: Optional[str] = None
decline_reason: Optional[str] = None
jobs_created: int = 0
jobs_done: int = 0
jobs_need_driver: int = 0
created_utc: datetime.datetime = datetime.datetime(1, 1, 1)
created_by: Optional[str] = None
events: List[DispatchRequestEventView] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchRigCountView:
rig_type: Optional[str] = None
rigs: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchCarrierPickView:
vendor_i_d: int = 0
vendor_name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchRequestsResponse:
requests: List[DispatchRequestView] = field(default_factory=list)
request: Optional[DispatchRequestView] = None
rig_counts: List[DispatchRigCountView] = field(default_factory=list)
carriers: List[DispatchCarrierPickView] = field(default_factory=list)
quote_link: Optional[str] = None
delivery: Optional[str] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchRequestQuoteRequest:
request_id: int = 0
required_rig: Optional[str] = None
units_per_truck: Optional[int] = None
rate_per_load: Optional[Decimal] = None
urgency_pct: Optional[Decimal] = None
cost_per_load: Optional[Decimal] = None
Python DispatchRequestQuoteRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/dispatch/requests/{RequestId}/quote HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DispatchRequestQuoteRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<CostPerLoad>0</CostPerLoad>
<RatePerLoad>0</RatePerLoad>
<RequestId>0</RequestId>
<RequiredRig>String</RequiredRig>
<UnitsPerTruck>0</UnitsPerTruck>
<UrgencyPct>0</UrgencyPct>
</DispatchRequestQuoteRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DispatchRequestsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Carriers>
<DispatchCarrierPickView>
<VendorID>0</VendorID>
<VendorName>String</VendorName>
</DispatchCarrierPickView>
</Carriers>
<Delivery>String</Delivery>
<QuoteLink>String</QuoteLink>
<Request>
<AcceptTokenExpiresUtc>0001-01-01T00:00:00</AcceptTokenExpiresUtc>
<AcceptedUtc>0001-01-01T00:00:00</AcceptedUtc>
<AcceptedVia>String</AcceptedVia>
<Cargo>String</Cargo>
<Code>String</Code>
<CostPerLoad>0</CostPerLoad>
<CreatedBy>String</CreatedBy>
<CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
<CustomerEmail>String</CustomerEmail>
<CustomerName>String</CustomerName>
<CustomerPhone>String</CustomerPhone>
<DeclineReason>String</DeclineReason>
<DeclinedBy>String</DeclinedBy>
<DeclinedUtc>0001-01-01T00:00:00</DeclinedUtc>
<Events>
<DispatchRequestEventView>
<AtUtc>0001-01-01T00:00:00</AtUtc>
<ByWho>String</ByWho>
<Detail>String</Detail>
<EventId>0</EventId>
<Kind>String</Kind>
</DispatchRequestEventView>
</Events>
<FromLoc>String</FromLoc>
<IsUrgent>false</IsUrgent>
<JobsCreated>0</JobsCreated>
<JobsDone>0</JobsDone>
<JobsNeedDriver>0</JobsNeedDriver>
<LoadsNeeded>0</LoadsNeeded>
<Miles>0</Miles>
<Notes>String</Notes>
<QuoteTotal>0</QuoteTotal>
<QuoteVersion>0</QuoteVersion>
<QuotedBy>String</QuotedBy>
<QuotedUtc>0001-01-01T00:00:00</QuotedUtc>
<RatePerLoad>0</RatePerLoad>
<RequestId>0</RequestId>
<RequiredRig>String</RequiredRig>
<Source>String</Source>
<Status>String</Status>
<ToLoc>String</ToLoc>
<Units>0</Units>
<UnitsPerTruck>0</UnitsPerTruck>
<UrgencyPct>0</UrgencyPct>
<WindowText>String</WindowText>
</Request>
<Requests>
<DispatchRequestView>
<AcceptTokenExpiresUtc>0001-01-01T00:00:00</AcceptTokenExpiresUtc>
<AcceptedUtc>0001-01-01T00:00:00</AcceptedUtc>
<AcceptedVia>String</AcceptedVia>
<Cargo>String</Cargo>
<Code>String</Code>
<CostPerLoad>0</CostPerLoad>
<CreatedBy>String</CreatedBy>
<CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
<CustomerEmail>String</CustomerEmail>
<CustomerName>String</CustomerName>
<CustomerPhone>String</CustomerPhone>
<DeclineReason>String</DeclineReason>
<DeclinedBy>String</DeclinedBy>
<DeclinedUtc>0001-01-01T00:00:00</DeclinedUtc>
<Events>
<DispatchRequestEventView>
<AtUtc>0001-01-01T00:00:00</AtUtc>
<ByWho>String</ByWho>
<Detail>String</Detail>
<EventId>0</EventId>
<Kind>String</Kind>
</DispatchRequestEventView>
</Events>
<FromLoc>String</FromLoc>
<IsUrgent>false</IsUrgent>
<JobsCreated>0</JobsCreated>
<JobsDone>0</JobsDone>
<JobsNeedDriver>0</JobsNeedDriver>
<LoadsNeeded>0</LoadsNeeded>
<Miles>0</Miles>
<Notes>String</Notes>
<QuoteTotal>0</QuoteTotal>
<QuoteVersion>0</QuoteVersion>
<QuotedBy>String</QuotedBy>
<QuotedUtc>0001-01-01T00:00:00</QuotedUtc>
<RatePerLoad>0</RatePerLoad>
<RequestId>0</RequestId>
<RequiredRig>String</RequiredRig>
<Source>String</Source>
<Status>String</Status>
<ToLoc>String</ToLoc>
<Units>0</Units>
<UnitsPerTruck>0</UnitsPerTruck>
<UrgencyPct>0</UrgencyPct>
<WindowText>String</WindowText>
</DispatchRequestView>
</Requests>
<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>
<RigCounts>
<DispatchRigCountView>
<RigType>String</RigType>
<Rigs>0</Rigs>
</DispatchRigCountView>
</RigCounts>
</DispatchRequestsResponse>