microsoftgraph / microsoftgraph/msgraph-sdk-python

How to add @microsoft.graph.conflictBehavior to a PUT request?

Open
#557 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
630
Forks
96
Avg merge
15h 20m
Merged PRs (30d)
3

Description

I have this piece of code:

await client.drives \
   .by_drive_id(drive_id) \
   .items \
   .by_drive_item_id(f'root:/foo/baz/bar.txt:') \
   .content \
   .put(body)

I want it to fail if the file already exists.

According to this StackOverflow answer, I have to add @microsoft.graph.conflictBehavior with a value of fail somewhere. My question is: where? There's no additional_data key where I can pass this to, like it is shown in some other examples.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the fluent request entry point shown in the issue, especially the drive item content PUT call, and trace how request options are represented and sent. Done means the request can express the requested fail-on-conflict behavior and the resulting Graph API request uses the expected conflict setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.