GET | /supplementary/{supplementaryid} |
---|
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 ResponseBase:
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SupplementarySimple:
id: int = 0
tender_user_tender_round_id: int = 0
is_viewed: bool = False
viewing_date_time: Optional[datetime.datetime] = None
is_submitted: bool = False
submission_date_time: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BrowseFileResponseBase:
id: int = 0
file_content_id: int = 0
file_name: Optional[str] = None
size: int = 0
class SupplementaryFileDirection(IntEnum):
REQUEST = 0
RESPONSE = 1
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SupplementaryFileDetails(BrowseFileResponseBase):
supplementary_id: int = 0
supplementary_document_type_id: int = 0
supplementary_document_type: Optional[str] = None
direction: Optional[SupplementaryFileDirection] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SupplementaryDetails(SupplementarySimple):
tender_id: int = 0
tender_user_id: int = 0
user_id: int = 0
tender_round_id: int = 0
viewed_by_id: Optional[int] = None
submitted_by_id: Optional[int] = None
meta: Optional[Dict[str, str]] = None
supplementary_files: Optional[List[SupplementaryFileDetails]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BrowseSupplementaryResponse(ResponseBase):
supplementary: Optional[SupplementaryDetails] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BrowseSupplementaryByVeoliaAdmin(IGet):
supplementary_id: int = 0
Python BrowseSupplementaryByVeoliaAdmin DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /supplementary/{supplementaryid} HTTP/1.1 Host: szallitoiportal-be.veolia.hu Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Supplementary: { TenderId: 0, TenderUserId: 0, UserId: 0, TenderRoundId: 0, ViewedById: 0, SubmittedById: 0, Meta: { String: String }, SupplementaryFiles: [ { SupplementaryId: 0, SupplementaryDocumentTypeId: 0, SupplementaryDocumentType: String, Direction: 0, Id: 0, FileContentId: 0, FileName: String, Size: 0 } ], Id: 0, TenderUserTenderRoundId: 0, IsViewed: False, ViewingDateTime: 0001-01-01, IsSubmitted: False, SubmissionDateTime: 0001-01-01 }, ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } } }