Add create_bullet_list operation to batch_update_doc
Exposes native Google Docs createParagraphBullets and deleteParagraphBullets APIs via the batch operation manager. Supports UNORDERED (bullets), ORDERED (numbered), and NONE (remove formatting) list types with optional nesting levels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -647,6 +647,33 @@ def create_bullet_list_request(
|
||||
return requests
|
||||
|
||||
|
||||
def create_delete_bullet_list_request(
|
||||
start_index: int,
|
||||
end_index: int,
|
||||
doc_tab_id: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Create a deleteParagraphBullets request to remove bullet/list formatting.
|
||||
|
||||
Args:
|
||||
start_index: Start of the paragraph range
|
||||
end_index: End of the paragraph range
|
||||
doc_tab_id: Optional ID of the tab to target
|
||||
|
||||
Returns:
|
||||
Dictionary representing the deleteParagraphBullets request
|
||||
"""
|
||||
range_obj = {"startIndex": start_index, "endIndex": end_index}
|
||||
if doc_tab_id:
|
||||
range_obj["tabId"] = doc_tab_id
|
||||
|
||||
return {
|
||||
"deleteParagraphBullets": {
|
||||
"range": range_obj,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def validate_operation(operation: Dict[str, Any]) -> tuple[bool, str]:
|
||||
"""
|
||||
Validate a batch operation dictionary.
|
||||
@@ -671,6 +698,7 @@ def validate_operation(operation: Dict[str, Any]) -> tuple[bool, str]:
|
||||
"insert_table": ["index", "rows", "columns"],
|
||||
"insert_page_break": ["index"],
|
||||
"find_replace": ["find_text", "replace_text"],
|
||||
"create_bullet_list": ["start_index", "end_index"],
|
||||
"insert_doc_tab": ["title", "index"],
|
||||
"delete_doc_tab": ["tab_id"],
|
||||
"update_doc_tab": ["tab_id", "title"],
|
||||
|
||||
Reference in New Issue
Block a user