| POST | /api/itemDataNotification/search | Search item data notification based on search parameters |
|---|
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')
class ORDER(str, Enum):
ASC = 'ASC'
DESC = 'DESC'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchItemDataNotificationQuery(ISearchItemDataNotification):
receiver_gln: Optional[str] = None
sender_gln: Optional[str] = None
partner_gln: List[str] = field(default_factory=list)
requested_page: int = 0
number_of_records_per_page: int = 0
continuation_token: Optional[str] = None
category_code: Optional[str] = None
identifier: Optional[str] = None
trade_item_description: Optional[str] = None
gtin: Optional[str] = None
order_by: Optional[str] = None
order: Optional[ORDER] = None
# @Api(Description="Item Data Notification")
# @ApiResponse(Description="Paged ItemDataNotification data", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchItemDataNotification:
"""
Item Data Notification
"""
# @ApiMember(Description="Search query", ParameterType="model")
query: Optional[SearchItemDataNotificationQuery] = None
"""
Search query
"""
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagedQueryResult(Generic[T]):
start_index: int = 0
end_index: int = 0
number_of_records_returned: int = 0
total_number_of_pages: int = 0
total_number_of_records: int = 0
results: List[ResultItem[ClaimMessage]] = field(default_factory=list)
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagedQueryResponseWithToken(Generic[T], PagedQueryResult[ResultItem[InvoiceMessage]]):
continuation_token: Optional[str] = None
Python SearchItemDataNotification DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/itemDataNotification/search HTTP/1.1
Host: stf-api-uat.data-xchange.co.za
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"query":{"receiverGln":"String","senderGln":"String","partnerGln":["String"],"requestedPage":0,"numberOfRecordsPerPage":0,"continuationToken":"String","categoryCode":"String","identifier":"String","tradeItemDescription":"String","gtin":"String","orderBy":"String","order":"ASC"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"continuationToken":"String","startIndex":0,"endIndex":0,"numberOfRecordsReturned":0,"totalNumberOfPages":0,"totalNumberOfRecords":0,"results":[{}]}