BokaMera.API.Host

<back to all web services

EAccountingArticleQuery

The following routes are available for this service:
GET/eaccounting/articles
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
Object = TypeVar('Object')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryBase:
    skip: Optional[int] = None
    take: Optional[int] = None
    order_by: Optional[str] = None
    order_by_desc: Optional[str] = None
    include: Optional[str] = None
    fields: Optional[str] = None
    meta: Optional[Dict[str, str]] = None


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryData(Generic[T], QueryBase, IReturn[QueryResponse[T]]):
    @staticmethod
    def response_type(): return QueryResponse[T]


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseArticleDto:
    article_id: Optional[str] = None
    article_price: Decimal = decimal.Decimal(0)
    article_name: Optional[str] = None
    created_date: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EAccountingArticleQueryResponse(BaseArticleDto):
    unit_id: Optional[str] = None
    coding_id: Optional[str] = None
    vat_rate: Optional[str] = None
    vat_rate_percent: Optional[str] = None
    currency_sign: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EAccountingArticleQuery(QueryData[EAccountingArticleQueryResponse], ICompany):
    company_id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AccessKeyTypeResponse:
    id: int = 0
    key_type: Optional[str] = None
    description: Optional[str] = None


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryResponse(Generic[T]):
    offset: int = 0
    total: int = 0
    results: List[AccessKeyTypeResponse] = field(default_factory=list)
    meta: Optional[Dict[str, str]] = None
    response_status: Optional[ResponseStatus] = None

Python EAccountingArticleQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /eaccounting/articles HTTP/1.1 
Host: api.bookmore.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<QueryResponseOfEAccountingDtos.EAccountingArticleQueryResponseWg5EthtI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Offset>0</Offset>
  <Total>0</Total>
  <Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
    <d2p1:EAccountingDtos.EAccountingArticleQueryResponse>
      <d2p1:ArticleId>00000000-0000-0000-0000-000000000000</d2p1:ArticleId>
      <d2p1:ArticleName>String</d2p1:ArticleName>
      <d2p1:ArticlePrice>0</d2p1:ArticlePrice>
      <d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
      <d2p1:CodingId>String</d2p1:CodingId>
      <d2p1:CurrencySign>String</d2p1:CurrencySign>
      <d2p1:UnitId>String</d2p1:UnitId>
      <d2p1:VatRate>String</d2p1:VatRate>
      <d2p1:VatRatePercent>String</d2p1:VatRatePercent>
    </d2p1:EAccountingDtos.EAccountingArticleQueryResponse>
  </Results>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <ResponseStatus>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
    <StackTrace>String</StackTrace>
    <Errors>
      <ResponseError>
        <ErrorCode>String</ErrorCode>
        <FieldName>String</FieldName>
        <Message>String</Message>
        <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>
        </Meta>
      </ResponseError>
    </Errors>
    <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>
    </Meta>
  </ResponseStatus>
</QueryResponseOfEAccountingDtos.EAccountingArticleQueryResponseWg5EthtI>