| GET,OPTIONS | /v1/book/{Slug} |
|---|
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 CourierTrackBusiness:
name: Optional[str] = None
phone: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookLevel:
code: Optional[str] = None
name: Optional[str] = None
ready: Optional[str] = None
within_min: int = 0
in_by: Optional[str] = None
surcharge: Decimal = decimal.Decimal(0)
days: List[int] = field(default_factory=list)
deadline_min: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HandoffOptions:
hand: bool = False
porch: bool = False
desk: bool = False
sig_required: bool = False
id_required: bool = False
code_required: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookProfile:
code: Optional[str] = None
name: Optional[str] = None
shape: Optional[str] = None
template: Optional[str] = None
unit_one: Optional[str] = None
unit_many: Optional[str] = None
unit_one_es: Optional[str] = None
unit_many_es: Optional[str] = None
facility_noun: Optional[str] = None
facility_noun_es: Optional[str] = None
facility_name: Optional[str] = None
levels: List[CourierBookLevel] = field(default_factory=list)
asap: bool = False
recurring: bool = False
pay_timing: Optional[str] = None
final_after_count: bool = False
cancel_fee: Decimal = decimal.Decimal(0)
missed_fee: Decimal = decimal.Decimal(0)
missed_wait_min: int = 0
service_area: List[str] = field(default_factory=list)
zips: List[str] = field(default_factory=list)
handoffs: Optional[HandoffOptions] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookProfileLink:
code: Optional[str] = None
name: Optional[str] = None
shape: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookPageView:
available: bool = False
booking_on: bool = False
business: Optional[CourierTrackBusiness] = None
profile: Optional[CourierBookProfile] = None
profiles: List[CourierBookProfileLink] = field(default_factory=list)
card_enabled: bool = False
publishable_key: Optional[str] = None
app_url: Optional[str] = None
today: Optional[str] = None
weekday: int = 0
now_min: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookPageResponse:
page: Optional[CourierBookPageView] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookPageRequest:
slug: Optional[str] = None
profile: Optional[str] = None
Python CourierBookPageRequest 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.
GET /v1/book/{Slug} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CourierBookPageResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Page>
<AppUrl>String</AppUrl>
<Available>false</Available>
<BookingOn>false</BookingOn>
<Business>
<Name>String</Name>
<Phone>String</Phone>
</Business>
<CardEnabled>false</CardEnabled>
<NowMin>0</NowMin>
<Profile>
<Asap>false</Asap>
<CancelFee>0</CancelFee>
<Code>String</Code>
<FacilityName>String</FacilityName>
<FacilityNoun>String</FacilityNoun>
<FacilityNounEs>String</FacilityNounEs>
<FinalAfterCount>false</FinalAfterCount>
<Handoffs>
<CodeRequired>false</CodeRequired>
<Desk>false</Desk>
<Hand>false</Hand>
<IdRequired>false</IdRequired>
<Porch>false</Porch>
<SigRequired>false</SigRequired>
</Handoffs>
<Levels>
<CourierBookLevel>
<Code>String</Code>
<Days xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:int>0</d6p1:int>
</Days>
<DeadlineMin>0</DeadlineMin>
<InBy>String</InBy>
<Name>String</Name>
<Ready>String</Ready>
<Surcharge>0</Surcharge>
<WithinMin>0</WithinMin>
</CourierBookLevel>
</Levels>
<MissedFee>0</MissedFee>
<MissedWaitMin>0</MissedWaitMin>
<Name>String</Name>
<PayTiming>String</PayTiming>
<Recurring>false</Recurring>
<ServiceArea xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</ServiceArea>
<Shape>String</Shape>
<Template>String</Template>
<UnitMany>String</UnitMany>
<UnitManyEs>String</UnitManyEs>
<UnitOne>String</UnitOne>
<UnitOneEs>String</UnitOneEs>
<Zips xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</Zips>
</Profile>
<Profiles>
<CourierBookProfileLink>
<Code>String</Code>
<Name>String</Name>
<Shape>String</Shape>
</CourierBookProfileLink>
</Profiles>
<PublishableKey>String</PublishableKey>
<Today>String</Today>
<Weekday>0</Weekday>
</Page>
<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>
</CourierBookPageResponse>