| GET | /App/{UserId}/OrderList |
|---|
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 Eras2AppServiceModelBase:
user_id: Optional[str] = None
class ProcessState(str, Enum):
IN_PROGRESS = 'InProgress'
UPDATING = 'Updating'
CREATING = 'Creating'
COMPLETED = 'Completed'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrderState:
last_modified: Optional[datetime.datetime] = None
kinds: Optional[IList[OrderKind]] = None
process_state: Optional[ProcessState] = None
completed_date: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AppointmentStoreUser:
store_user_id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AppointmentNutzeinheit:
nutzeinheit_guid: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Appointment:
guid: Optional[str] = None
from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1))
to: datetime.datetime = datetime.datetime(1, 1, 1)
appointment_store_users: Optional[IList[AppointmentStoreUser]] = None
appointment_nutzeinheiten: Optional[IList[AppointmentNutzeinheit]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NutzeinheitOrderPosition:
nutzeinheit_guid: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrderPosition:
guid: Optional[str] = None
last_modified: Optional[datetime.datetime] = None
note: Optional[str] = None
required_quantity: int = 0
actual_quantity: int = 0
nutzeinheit_order_positions: Optional[IList[NutzeinheitOrderPosition]] = None
article_guid: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NutzeinheitOrderState:
nutzeinheit_guid: Optional[str] = None
last_modified: Optional[datetime.datetime] = None
order_kinds: Optional[IList[NutzeinheitOrderKind]] = None
process_state: Optional[ProcessState] = None
completed_date: Optional[datetime.datetime] = None
os_version: Optional[str] = None
app_version: Optional[str] = None
os_platform: Optional[str] = None
app_device_number: Optional[str] = None
amw_info_key_guid: Optional[str] = None
class DeviceOrderKind(str, Enum):
ASSEMBLY = 'Assembly'
MAINTENANCE = 'Maintenance'
EXCHANGE = 'Exchange'
READING = 'Reading'
INSPECTION = 'Inspection'
MAIN_READING = 'MainReading'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DeviceOrderState:
device_guid: Optional[str] = None
order_guid: Optional[str] = None
order_kind: Optional[DeviceOrderKind] = None
process_state: Optional[ProcessState] = None
completed_date: Optional[datetime.datetime] = None
amw_info: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PersonCommunication:
guid: Optional[str] = None
last_modified: Optional[datetime.datetime] = None
address: Optional[str] = None
note: Optional[str] = None
communication_feature_guid: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Person:
guid: Optional[str] = None
last_modified: Optional[datetime.datetime] = None
lastname1: Optional[str] = None
lastname2: Optional[str] = None
lastname3: Optional[str] = None
firstname1: Optional[str] = None
firstname2: Optional[str] = None
note: Optional[str] = None
salutation: Optional[str] = None
title: Optional[str] = None
person_communications: Optional[List[PersonCommunication]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Orderer:
guid: Optional[str] = None
person: Optional[Person] = None
business_position: Optional[str] = None
class SignatureKind(str, Enum):
NUTZER = 'Nutzer'
TECHNICIAN = 'Technician'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Signature:
guid: Optional[str] = None
recorded_date: Optional[datetime.datetime] = None
kind: Optional[SignatureKind] = None
nutzeinheit_guid: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Order:
guid: Optional[str] = None
last_modified: Optional[datetime.datetime] = None
abrechnungseinheit_guid: Optional[str] = None
number: Optional[str] = None
label: Optional[str] = None
note: Optional[str] = None
is_signature_required: bool = False
created_date: datetime.datetime = datetime.datetime(1, 1, 1)
order_state: Optional[OrderState] = None
appointments: Optional[IList[Appointment]] = None
order_positions: Optional[IList[OrderPosition]] = None
nutzeinheit_order_states: Optional[IList[NutzeinheitOrderState]] = None
device_order_states: Optional[IList[DeviceOrderState]] = None
orderer: Optional[Orderer] = None
signatures: Optional[IList[Signature]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetOrderListResponse:
orders: Optional[List[Order]] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetOrderList(Eras2AppServiceModelBase):
pass
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 /App/{UserId}/OrderList HTTP/1.1
Host: stoetzer-servamw.eras-online.de
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetOrderListResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Eras2App.Get">
<Orders xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Common">
<d2p1:Order>
<d2p1:AbrechnungseinheitGuid>00000000-0000-0000-0000-000000000000</d2p1:AbrechnungseinheitGuid>
<d2p1:Anmerkung>String</d2p1:Anmerkung>
<d2p1:AuftragNummer>String</d2p1:AuftragNummer>
<d2p1:AuftragZustand>
<d2p1:AbgeschlossenDatum>0001-01-01T00:00:00</d2p1:AbgeschlossenDatum>
<d2p1:AuftragArten xmlns:d5p1="http://schemas.datacontract.org/2004/07/System" i:nil="true" />
<d2p1:Bearbeitungsstatus>InProgress</d2p1:Bearbeitungsstatus>
<d2p1:LastModified>0001-01-01T00:00:00</d2p1:LastModified>
</d2p1:AuftragZustand>
<d2p1:Auftraggeber>
<d2p1:BetrieblichePosition>String</d2p1:BetrieblichePosition>
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:Person>
<d2p1:Anmerkung>String</d2p1:Anmerkung>
<d2p1:Anrede>String</d2p1:Anrede>
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:LastModified>0001-01-01T00:00:00</d2p1:LastModified>
<d2p1:Nachname1>String</d2p1:Nachname1>
<d2p1:Nachname2>String</d2p1:Nachname2>
<d2p1:Nachname3>String</d2p1:Nachname3>
<d2p1:PersonKommunikationen i:nil="true" />
<d2p1:Titel>String</d2p1:Titel>
<d2p1:Vorname1>String</d2p1:Vorname1>
<d2p1:Vorname2>String</d2p1:Vorname2>
</d2p1:Person>
</d2p1:Auftraggeber>
<d2p1:AuftragsPositionen i:nil="true" />
<d2p1:Bezeichnung>String</d2p1:Bezeichnung>
<d2p1:Erstellungsdatum>0001-01-01T00:00:00</d2p1:Erstellungsdatum>
<d2p1:GeraeteZustaende i:nil="true" />
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:LastModified>0001-01-01T00:00:00</d2p1:LastModified>
<d2p1:NutzeinheitZustaende i:nil="true" />
<d2p1:Termine i:nil="true" />
<d2p1:UnterschriftBenoetigt>false</d2p1:UnterschriftBenoetigt>
<d2p1:Unterschriften i:nil="true" />
</d2p1:Order>
</Orders>
<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>
</GetOrderListResponse>