POST | /api/documentuploads/registerdocuments |
---|
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 RegisteredDocumentUpload:
document_upload_i_d: Optional[int] = None
is_success: Optional[bool] = None
message: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AddDocumentsForBackgroundRegistrationResponse:
registered_document_uploads: Optional[List[RegisteredDocumentUpload]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RegistrationValue:
key: Optional[str] = None
value: Optional[str] = None
shadow_value: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Transition:
id: Optional[str] = None
reason: Optional[str] = None
delay_date: Optional[datetime.datetime] = None
delay_reason: Optional[str] = None
user_i_ds: Optional[List[int]] = None
group_i_ds: Optional[List[int]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Process:
id: Optional[int] = None
title: Optional[str] = None
description: Optional[str] = None
note: Optional[str] = None
coordinator: Optional[str] = None
urgent: Optional[bool] = None
transitions: Optional[List[Transition]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RegisterDocument:
registration_profile_i_d: Optional[str] = None
values: Optional[List[RegistrationValue]] = None
processes: Optional[List[Process]] = None
document_upload_id: Optional[str] = None
document_id: Optional[str] = None
standard_document_i_d: Optional[str] = None
has_unsaved_changes_in_document: Optional[bool] = None
is_opened_from_non_d_m_s_location: Optional[bool] = None
# @Api(Description="Register documents queueud for registration in background")
# @ApiResponse(Description="All queued documents are linked to a systemtask for background processing", StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AddDocumentsForBackgroundRegistration:
"""
Register documents queueud for registration in background
"""
# @ApiMember(Description="List of queued documents to register in background", IsRequired=true)
documents: Optional[List[RegisterDocument]] = None
"""
List of queued documents to register in background
"""
Python AddDocumentsForBackgroundRegistration DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/documentuploads/registerdocuments HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Documents":[{"RegistrationProfileID":"00000000-0000-0000-0000-000000000000","Values":[{"Key":"00000000-0000-0000-0000-000000000000","Value":"String","ShadowValue":"String"}],"Processes":[{"ID":0,"Title":"String","Description":"String","Note":"String","Coordinator":"String","Urgent":false,"Transitions":[{"ID":"00000000-0000-0000-0000-000000000000","Reason":"String","DelayDate":"0001-01-01T00:00:00.0000000","DelayReason":"String","UserIDs":[0],"GroupIDs":[0]}]}],"DocumentUploadId":"String","DocumentId":"00000000-0000-0000-0000-000000000000","StandardDocumentID":"00000000-0000-0000-0000-000000000000","HasUnsavedChangesInDocument":false,"IsOpenedFromNonDMSLocation":false}]}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"RegisteredDocumentUploads":[{"DocumentUploadID":0,"IsSuccess":false,"Message":"String"}]}