Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch function for cosmosdb added #115

Conversation

Atharva1723
Copy link

@Atharva1723 Atharva1723 commented Oct 9, 2024

Description

This update implements a function to patch a document in Azure Cosmos DB using the Ballerina programming language. The function allows for modifying existing fields and adding new fields to the specified document.

Fixes ballerina-platform/ballerina-library#4972 (comment)

One line release note:

  • Implemented patch operation for updating specific fields in a document in Azure Cosmos DB using Ballerina.

Type of change

Please delete options that are not relevant.

  • [✓ ] New feature (non-breaking change which adds functionality)

Checklist:

Security checks

@CLAassistant
Copy link

CLAassistant commented Oct 9, 2024

CLA assistant check
All committers have signed the CLA.

ballerina/client_endpoint.bal Outdated Show resolved Hide resolved
@Atharva1723
Copy link
Author

@NipunaRanasinghe Is this correct?

Atharva1723 and others added 2 commits October 29, 2024 10:23
Co-authored-by: Ayesh Almeida <77491511+ayeshLK@users.noreply.github.com>
@Atharva1723
Copy link
Author

Done

@display {label: "Partition Key"} string partitionKey,
@display {label: "Patch Operations"} PatchOperation[] operations,
@display {label: "Optional Header Parameters"} PatchRequestOptions? requestOptions = ())
returns cosmosdb:DocumentResponse|error = @java:Method {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
returns cosmosdb:DocumentResponse|error = @java:Method {
returns DocumentResponse|error = @java:Method {

@@ -0,0 +1,41 @@
import ballerina/log;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing license header

Suggested change
import ballerina/log;
// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.org).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
import ballerina/log;

@NipunaRanasinghe
Copy link
Contributor

@Atharva1723 we need to add at-least 1 positive and negative test cases for the updateDocument functionality.

@NipunaRanasinghe
Copy link
Contributor

As discussed with @anupama-pathirage, we will merge the feature in its current state into a feature development branch, as @Atharva1723 appears to have been inactive over the past few weeks. Once the remaining suggestions are addressed from our side, we will send a separate PR.

@Atharva1723 please note that we have decided to grant you the full credit allocated for this issue (taking into account the percentage of completion and delays on our end). Feel free to submit the contribution form and claim your credits to access our swag store 🙂

@NipunaRanasinghe NipunaRanasinghe changed the base branch from main to feat-patch-operation November 17, 2024 11:31
@NipunaRanasinghe NipunaRanasinghe merged commit ffb428a into ballerina-platform:feat-patch-operation Nov 17, 2024
1 of 2 checks passed
@Atharva1723
Copy link
Author

As discussed with @anupama-pathirage, we will merge the feature in its current state into a feature development branch, as @Atharva1723 appears to have been inactive over the past few weeks. Once the remaining suggestions are addressed from our side, we will send a separate PR.

@Atharva1723 please note that we have decided to grant you the full credit allocated for this issue (taking into account the percentage of completion and delays on our end). Feel free to submit the contribution form and claim your credits to access our swag store 🙂

Sorry was busy in office past two weeks ...Should i raise another pr for the test cases ?

@NipunaRanasinghe
Copy link
Contributor

NipunaRanasinghe commented Nov 21, 2024

Sorry was busy in office past two weeks ...Should i raise another pr for the test cases ?

@Atharva1723 Thats okay and welcome back! :) Yes that would be great if you can send a PR for the test cases. Please send it to the https://github.com/ballerina-platform/module-ballerinax-azure-cosmosdb/tree/feat-patch-operation branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Include PATCH document operation to the connector
4 participants