Add PatchDocument::condition and builder method for it#2969
Add PatchDocument::condition and builder method for it#2969analogrelay merged 2 commits intoAzure:mainfrom
PatchDocument::condition and builder method for it#2969Conversation
|
Thank you for your contribution @jprochazk! We will review the pull request and get back to you soon. |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
b58b4d7 to
f16d165
Compare
analogrelay
left a comment
There was a problem hiding this comment.
Hey, if you'd like to undraft this, I think it's a good addition! I made one minor comment about the implementation, and it'll need at least one unit test to be added, then it'll be ready to go if you want to contribute it!
f16d165 to
a78eabc
Compare
Added a few tests for serialization and deserialization. Windows CI is failing, but it seems unrelated, as the same tests pass on Linux/MacOS. |
|
(I am still waiting for approval from my employer to sign the CLA. I assume there will be no problem with that, but it's pending) |
|
@microsoft-github-policy-service agree company="Rerun" |
|
The build failures are a known issue in |
|
/azp run rust - pullrequest |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Rebase again. There was a bad PR that went into |
a78eabc to
fac09f5
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds conditional patch operation support to the PatchDocument struct by introducing a condition field and corresponding builder method. This enables users to apply patch operations conditionally based on SQL-like filter predicates, aligning with Azure Cosmos DB's conditional patch operation REST API.
- Added optional
conditionfield toPatchDocumentstruct with proper serialization handling - Implemented
with_conditionbuilder method for fluent API usage - Added comprehensive tests including serialization and real-world example validation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sdk/cosmos/azure_data_cosmos/src/models/patch_operations.rs | Added condition field to PatchDocument, implemented with_condition builder method, and added tests for conditional patch functionality |
| sdk/cosmos/azure_data_cosmos/examples/cosmos/patch.rs | Updated struct initialization to include the new condition field |
|
I forgot to ask you to update the CHANGELOG, but I'll do that in an upcoming PR (we're nearing a release and I need to modify that file anyway) |
This PR preps the CHANGELOG.md for the 0.28 release. There are three separate changes here, which I put in separate commits, because the overall diff is a little busier than you might expect :). 1. Added a missing changelog entry for #2969. I forgot to ensure that was added before merging, so I put it in here. 2. Replaced our usage of `*` in the changelog with `-` so we're consistent with other SDKs, and consistent within the file (since a recent Core change added a changelog entry using `-`) 3. Marked the changelog entry for `0.28.0` as releasing tomorrow.
Adds the ability to provide the
conditionfor conditional patch operations. Related REST API docs here: