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 Employee:
first_name: Optional[str] = None
middle_name: Optional[str] = None
last_name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InspectionReport:
agent_u_i_d: Optional[str] = None
contact_u_i_d: Optional[str] = None
inspection_report_u_i_d: Optional[str] = None
trade_name: Optional[str] = None
business_phone: Optional[str] = None
street_address: Optional[str] = None
zip_code: Optional[str] = None
owners_name: Optional[str] = None
compliance_status: int = 0
is_business_class_a_beer: bool = False
is_business_class_b_beer: bool = False
is_business_class_a_liquor: bool = False
is_business_class_b_liquor: bool = False
is_business_class_d: bool = False
is_business_class_m: bool = False
is_business_class_p: bool = False
is_business_class_r: bool = False
is_business_class_r_a_h: bool = False
class_beer_account_num: Optional[str] = None
class_beer_state_num: Optional[str] = None
class_liquor_account_num: Optional[str] = None
class_liquor_state_num: Optional[str] = None
licensed_employees: List[Employee] = field(default_factory=list)
agent_name: Optional[str] = None
manager_signature: Optional[Object] = None
manager_name: Optional[str] = None
manager_phone: Optional[str] = None
inspection_date: datetime.datetime = datetime.datetime(1, 1, 1)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PostInspectionReportResponse:
result: Optional[InspectionReport] = None
response_status: Optional[ResponseStatus] = None
Python PostInspectionReportResponse 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 /xml/oneway/PostInspectionReportResponse HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PostInspectionReportResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<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>
<Result>
<AgentName>String</AgentName>
<AgentUID>00000000-0000-0000-0000-000000000000</AgentUID>
<BusinessPhone>String</BusinessPhone>
<ClassBeerAccountNum>String</ClassBeerAccountNum>
<ClassBeerStateNum>String</ClassBeerStateNum>
<ClassLiquorAccountNum>String</ClassLiquorAccountNum>
<ClassLiquorStateNum>String</ClassLiquorStateNum>
<ComplianceStatus>0</ComplianceStatus>
<ContactUID>00000000-0000-0000-0000-000000000000</ContactUID>
<InspectionDate>0001-01-01T00:00:00</InspectionDate>
<InspectionReportUID>00000000-0000-0000-0000-000000000000</InspectionReportUID>
<IsBusinessClassABeer>false</IsBusinessClassABeer>
<IsBusinessClassALiquor>false</IsBusinessClassALiquor>
<IsBusinessClassBBeer>false</IsBusinessClassBBeer>
<IsBusinessClassBLiquor>false</IsBusinessClassBLiquor>
<IsBusinessClassD>false</IsBusinessClassD>
<IsBusinessClassM>false</IsBusinessClassM>
<IsBusinessClassP>false</IsBusinessClassP>
<IsBusinessClassR>false</IsBusinessClassR>
<IsBusinessClassRAH>false</IsBusinessClassRAH>
<LicensedEmployees>
<Employee>
<FirstName>String</FirstName>
<IsOnDuty>false</IsOnDuty>
<LastName>String</LastName>
<LicenseExpirationDate>0001-01-01T00:00:00</LicenseExpirationDate>
<LicenseNumber>String</LicenseNumber>
<LicenseTypeCode>0</LicenseTypeCode>
<MiddleName>String</MiddleName>
</Employee>
</LicensedEmployees>
<ManagerName>String</ManagerName>
<ManagerPhone>String</ManagerPhone>
<ManagerSignature />
<OwnersName>String</OwnersName>
<StreetAddress>String</StreetAddress>
<TradeName>String</TradeName>
<ZipCode>String</ZipCode>
</Result>
</PostInspectionReportResponse>