Skip to content

Commit 8f6498f

Browse files
author
Max Wang
committed
description update
1 parent 46fa1b7 commit 8f6498f

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

src/dataverse_sdk/odata.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@ def _request(self, method: str, url: str, *, expected: tuple[int, ...] = (200, 2
122122
def _create(self, entity_set: str, logical_name: str, record: Dict[str, Any]) -> str:
123123
"""Create a single record and return its GUID.
124124
125+
Parameters
126+
-------
127+
entity_set : str
128+
Resolved entity set (plural) name.
129+
logical_name : str
130+
Singular logical entity name.
131+
record : dict[str, Any]
132+
Attribute payload mapped by logical column names.
133+
134+
Returns
135+
-------
136+
str
137+
Created record GUID.
138+
139+
Notes
140+
-------
125141
Relies on OData-EntityId (canonical) or Location header. No response body parsing is performed.
126142
Raises RuntimeError if neither header contains a GUID.
127143
"""
@@ -145,6 +161,27 @@ def _create(self, entity_set: str, logical_name: str, record: Dict[str, Any]) ->
145161
)
146162

147163
def _create_multiple(self, entity_set: str, logical_name: str, records: List[Dict[str, Any]]) -> List[str]:
164+
"""Create multiple records using the collection-bound CreateMultiple action.
165+
166+
Parameters
167+
----------
168+
entity_set : str
169+
Resolved entity set (plural) name.
170+
logical_name : str
171+
Singular logical entity name.
172+
records : list[dict[str, Any]]
173+
Payloads mapped by logical attribute names.
174+
175+
Multi-create logical name resolution
176+
------------------------------------
177+
- If any payload omits ``@odata.type`` the client stamps ``Microsoft.Dynamics.CRM.<logical_name>``.
178+
- If all payloads already include ``@odata.type`` no modification occurs.
179+
180+
Returns
181+
-------
182+
list[str]
183+
List of created IDs.
184+
"""
148185
if not all(isinstance(r, dict) for r in records):
149186
raise TypeError("All items for multi-create must be dicts")
150187
need_logical = any("@odata.type" not in r for r in records)

0 commit comments

Comments
 (0)