Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import json
import logging
from dataclasses import asdict
Expand Down Expand Up @@ -21144,15 +21142,20 @@ async def me_onenote_section_groups_create_sections(
config.query_parameters = query_params

if headers:
config.headers = headers
config.headers = headers.copy() # avoid mutation of input headers

# Add consistency level for search operations, in-place update above ensures we don't mutate caller data

# Add consistency level for search operations in OneNote
if search:
if not config.headers:
config.headers = {}
config.headers['ConsistencyLevel'] = 'eventual'

response = await self.client.me.onenote.section_groups.by_section_group_id(sectionGroup_id).sections.post(body=request_body, request_configuration=config)
# Await the POST operation (the only async/IO point)
response = await self.client.me.onenote.section_groups.by_section_group_id(sectionGroup_id).sections.post(
body=request_body, request_configuration=config
)
return self._handle_onenote_response(response)
except Exception as e:
return OneNoteResponse(
Expand Down