Skip to content

Commit 8a9be26

Browse files
feat(adms): add missing DocumentRelation fields visible in live API response
DocumentRelation.from_dict was silently dropping 7 fields that the ADM service returns (confirmed against live Postman/Bruno response): is_active_entity (IsActiveEntity) has_active_entity (HasActiveEntity) has_draft_entity (HasDraftEntity) document_relation_is_output_relevant (DocumentRelationIsOutputRelevant) draft_messages (DraftMessages) doc_relation_changed_by_user_name (DocRelationChangedByUserName) doc_relation_changed_at_date_time (DocRelationChangedAtDateTime) CLI output now matches the wire response exactly instead of showing a truncated view.
1 parent 2fd61ba commit 8a9be26

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/sap_cloud_sdk/adms/_models.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,20 @@ class DocumentRelation:
354354
(e.g. ``"PurchaseOrder"``). Max 36 chars.
355355
host_business_object_node_id: Identifies the specific business object instance
356356
(e.g. ``"PO-4500012345"``). Max 50 chars.
357+
host_business_obj_node_display_id: Human-readable display ID for the BO node.
358+
document_id: UUID of the linked Document entity.
359+
document_is_active_entity: Whether the linked Document is the active version.
360+
is_active_entity: Whether this DocumentRelation record is the active version.
361+
has_active_entity: Whether an active version of this relation exists.
362+
has_draft_entity: Whether a draft version of this relation exists.
363+
document_relation_is_locked: Whether the relation (and its document) is locked.
364+
document_relation_is_deleted: Whether the relation is soft-deleted.
365+
document_relation_is_output_relevant: Whether the relation is flagged for output.
366+
draft_messages: SAP draft validation messages (populated during draft lifecycle).
367+
doc_relation_created_by_user_name: User who created the relation.
368+
doc_relation_created_at_date_time: ISO-8601 creation timestamp.
369+
doc_relation_changed_by_user_name: User who last modified the relation.
370+
doc_relation_changed_at_date_time: ISO-8601 last-modified timestamp.
357371
document: Expanded :class:`Document` — populated when the caller requests
358372
``?$expand=Document``.
359373
"""
@@ -365,11 +379,18 @@ class DocumentRelation:
365379
host_business_obj_node_display_id: str | None = None
366380
document_id: str | None = None
367381
document_is_active_entity: bool | None = None
382+
is_active_entity: bool | None = None
383+
has_active_entity: bool = False
384+
has_draft_entity: bool = False
368385
document_relation_is_locked: bool = False
369386
document_relation_is_deleted: bool = False
387+
document_relation_is_output_relevant: bool = False
388+
draft_messages: list = field(default_factory=list)
370389
document: Document | None = None
371390
doc_relation_created_by_user_name: str | None = None
372391
doc_relation_created_at_date_time: str | None = None
392+
doc_relation_changed_by_user_name: str | None = None
393+
doc_relation_changed_at_date_time: str | None = None
373394

374395
@classmethod
375396
def from_dict(cls, data: dict) -> DocumentRelation:
@@ -386,11 +407,20 @@ def from_dict(cls, data: dict) -> DocumentRelation:
386407
host_business_obj_node_display_id=data.get("HostBusinessObjNodeDisplayID"),
387408
document_id=data.get("DocumentID"),
388409
document_is_active_entity=data.get("DocumentIsActiveEntity"),
410+
is_active_entity=data.get("IsActiveEntity"),
411+
has_active_entity=data.get("HasActiveEntity", False),
412+
has_draft_entity=data.get("HasDraftEntity", False),
389413
document_relation_is_locked=data.get("DocumentRelationIsLocked", False),
390414
document_relation_is_deleted=data.get("DocumentRelationIsDeleted", False),
415+
document_relation_is_output_relevant=data.get(
416+
"DocumentRelationIsOutputRelevant", False
417+
),
418+
draft_messages=data.get("DraftMessages") or [],
391419
document=doc,
392420
doc_relation_created_by_user_name=data.get("DocRelationCreatedByUserName"),
393421
doc_relation_created_at_date_time=data.get("DocRelationCreatedAtDateTime"),
422+
doc_relation_changed_by_user_name=data.get("DocRelationChangedByUserName"),
423+
doc_relation_changed_at_date_time=data.get("DocRelationChangedAtDateTime"),
394424
)
395425

396426

0 commit comments

Comments
 (0)