| GET | /api/C2BGetUnfinishedContracts |
|---|
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 BaseRequest:
# @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="Header")
api_key: Optional[str] = None
"""
This is your AIM API Key provided by Tri-Tech
"""
# @ApiMember(DataType="string", Description="The OAuthToken token return by AeServices30", IsRequired=true, Name="OAuthToken", ParameterType="Header")
o_auth_token: Optional[str] = None
"""
The OAuthToken token return by AeServices30
"""
# @ApiMember(DataType="string", Description="The Device ID of the Mobile Device. Not used for non-mobile devices.", Name="DeviceId", ParameterType="Header")
device_id: Optional[str] = None
"""
The Device ID of the Mobile Device. Not used for non-mobile devices.
"""
# @ApiMember(DataType="string", Description="An identifier for your integration", IsRequired=true, Name="AppId", ParameterType="Header")
app_id: Optional[str] = None
"""
An identifier for your integration
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseSecureRequest(BaseRequest):
# @ApiMember(DataType="string", Description="The Login Token return by the Security API. Required for secured calls.", Name="Token", ParameterType="Header")
token: Optional[str] = None
"""
The Login Token return by the Security API. Required for secured calls.
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponseResult:
# @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
status_code: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
login: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
error_code: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
error_display_text: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
error_message: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
domain_name: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
ip_address: Optional[str] = None
"""
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponse:
# @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
status: Optional[BaseResponseResult] = None
"""
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LocationInfo:
id: int = 0
desc: Optional[str] = None
short_desc: Optional[str] = None
region: Optional[str] = None
latitude: Decimal = decimal.Decimal(0)
longitude: Decimal = decimal.Decimal(0)
in_store_pickup: Optional[str] = None
active: bool = False
cash_sale_acct: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class C2BAccessory:
id: int = 0
description: Optional[str] = None
price: Decimal = decimal.Decimal(0)
type: Optional[str] = None
sku: Optional[str] = None
category: Optional[int] = None
delivered: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UnfinishedContract:
customer_name: Optional[str] = None
customer_acct: int = 0
student_name: Optional[str] = None
ref: Optional[str] = None
date_time: datetime.datetime = datetime.datetime(1, 1, 1)
location: Optional[LocationInfo] = None
district: Optional[str] = None
school: Optional[str] = None
teacher: Optional[str] = None
instrument: Optional[str] = None
status: Optional[str] = None
notes: Optional[str] = None
locked_by: Optional[str] = None
instrument_grade: Optional[str] = None
serial: Optional[str] = None
salesperson: Optional[str] = None
web_notes: Optional[str] = None
email: Optional[str] = None
phone: Optional[str] = None
delivery_date: Optional[datetime.datetime] = None
first_due: Optional[datetime.datetime] = None
accessories: Optional[List[C2BAccessory]] = None
down_pay: Decimal = decimal.Decimal(0)
monthly_pay: Decimal = decimal.Decimal(0)
down_maint: Decimal = decimal.Decimal(0)
monthly_maint: Decimal = decimal.Decimal(0)
down_lease: Decimal = decimal.Decimal(0)
monthly_lease: Decimal = decimal.Decimal(0)
down_total: Decimal = decimal.Decimal(0)
address: Optional[str] = None
address2: Optional[str] = None
city: Optional[str] = None
state: Optional[str] = None
zip: Optional[str] = None
country: Optional[str] = None
invoice_created: bool = False
contract_created: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class C2BGetUnfinishedContractsResponse(BaseResponse):
unfinished_contracts: Optional[List[UnfinishedContract]] = None
topic: Optional[str] = None
base_url: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class C2BGetUnfinishedContractsRequest(BaseSecureRequest):
"""
C2BGetUnfinishedContractsRequires active-e Contracts Service.
"""
type: Optional[str] = None
start_offset: Optional[int] = None
record_count: Optional[int] = None
search_str: Optional[str] = None
include_contracts_entered_by_other_users: bool = False
district_id: Optional[int] = None
school_id: Optional[int] = None
teacher_id: Optional[int] = None
delivery_desc: Optional[str] = None
status: Optional[str] = None
Python C2BGetUnfinishedContractsRequest 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 /api/C2BGetUnfinishedContracts HTTP/1.1 Host: active-ewebservice.biz Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<C2BGetUnfinishedContractsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<Status>
<DomainName>String</DomainName>
<ErrorCode>String</ErrorCode>
<ErrorDisplayText>String</ErrorDisplayText>
<ErrorMessage>String</ErrorMessage>
<IpAddress>String</IpAddress>
<Login>String</Login>
<StatusCode>String</StatusCode>
</Status>
<BaseUrl>String</BaseUrl>
<Topic>String</Topic>
<UnfinishedContracts>
<C2BGetUnfinishedContractsResponse.UnfinishedContract>
<Accessories>
<C2BGetUnfinishedContractsResponse.UnfinishedContract.C2BAccessory>
<Category>0</Category>
<Delivered>false</Delivered>
<Description>String</Description>
<Id>0</Id>
<Price>0</Price>
<Sku>String</Sku>
<Type>String</Type>
</C2BGetUnfinishedContractsResponse.UnfinishedContract.C2BAccessory>
</Accessories>
<Address>String</Address>
<Address2>String</Address2>
<City>String</City>
<ContractCreated>false</ContractCreated>
<Country>String</Country>
<CustomerAcct>0</CustomerAcct>
<CustomerName>String</CustomerName>
<DateTime>0001-01-01T00:00:00</DateTime>
<DeliveryDate>0001-01-01T00:00:00</DeliveryDate>
<District>String</District>
<DownLease>0</DownLease>
<DownMaint>0</DownMaint>
<DownPay>0</DownPay>
<DownTotal>0</DownTotal>
<Email>String</Email>
<FirstDue>0001-01-01T00:00:00</FirstDue>
<Instrument>String</Instrument>
<InstrumentGrade>String</InstrumentGrade>
<InvoiceCreated>false</InvoiceCreated>
<Location xmlns:d4p1="http://schemas.datacontract.org/2004/07/AIM">
<d4p1:Active>false</d4p1:Active>
<d4p1:CashSaleAcct>0</d4p1:CashSaleAcct>
<d4p1:Desc>String</d4p1:Desc>
<d4p1:Id>0</d4p1:Id>
<d4p1:InStorePickup>String</d4p1:InStorePickup>
<d4p1:Latitude>0</d4p1:Latitude>
<d4p1:Longitude>0</d4p1:Longitude>
<d4p1:Region>String</d4p1:Region>
<d4p1:ShortDesc>String</d4p1:ShortDesc>
</Location>
<LockedBy>String</LockedBy>
<MonthlyLease>0</MonthlyLease>
<MonthlyMaint>0</MonthlyMaint>
<MonthlyPay>0</MonthlyPay>
<Notes>String</Notes>
<Phone>String</Phone>
<Ref>String</Ref>
<Salesperson>String</Salesperson>
<School>String</School>
<Serial>String</Serial>
<State>String</State>
<Status>String</Status>
<StudentName>String</StudentName>
<Teacher>String</Teacher>
<WebNotes>String</WebNotes>
<Zip>String</Zip>
</C2BGetUnfinishedContractsResponse.UnfinishedContract>
</UnfinishedContracts>
</C2BGetUnfinishedContractsResponse>