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

Initiated main repo , Did 4 test cases, Docs done #2

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

harithmaduranga
Copy link

@harithmaduranga harithmaduranga commented Jan 6, 2025

Purpose

Examples

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -5,12 +5,12 @@ name = "hubspot.crm.commerce.quotes"
version = "1.0.0"
license = ["Apache-2.0"]
authors = ["Ballerina"]
keywords = []
# icon = "icon.png" # TODO: update icon.png
keywords = [] # TODO: Add keywords
Copy link
Member

Choose a reason for hiding this comment

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

lets' add some short phrases that describe the package here. And remove the TODO

Suggested change
keywords = [] # TODO: Add keywords
keywords = ["hubspot"] # TODO: Add keywords


The `ballerinax/hubspot.crm.commerce.quotes` package offers APIs to connect and interact with [HubSpot API for CRM Quotes](https://developers.hubspot.com/docs/reference/api/crm/commerce/quotes) endpoints, specifically based on [HubSpot CRM Quotes API v3 OpenAPI spec](https://github.com/HubSpot/HubSpot-public-api-spec-collection/blob/main/PublicApiSpecs/CRM/Quotes/Rollouts/424/v3/quotes.json).


## Setup guide

[//]: # (TODO: Add detailed steps to obtain credentials and configure the module.)
Copy link
Member

Choose a reason for hiding this comment

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

Remove these TODOs

@@ -0,0 +1,111 @@
// // AUTO-GENERATED FILE.
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this file.
You can use --mode client option in OpenAPI tool to skip the generation of service stub.

@@ -0,0 +1,241 @@
import ballerina/test;
Copy link
Member

Choose a reason for hiding this comment

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

testQuoteId = response.id;

// Validate the response
test:assertTrue(response.id != "");
Copy link
Member

Choose a reason for hiding this comment

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

Instead of just asserting the id or length of the response, Can you look into the possibility of asserting the entire response? Update the other test cases as well.

@test:Config{}
function testGetAllQuotes() returns error? {

CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error response = check hubspotClient->/.get();
Copy link
Member

Choose a reason for hiding this comment

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

when using check expression avoid having error in the union type. You can read more on this here: https://ballerina.io/learn/by-example/check-expression/

Copy link
Member

Choose a reason for hiding this comment

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

check other places.

Comment on lines 214 to 241
// // Test function for creating or updating a batch of quotes
// @test:Config{}
// function testCreateOrUpdateBatchOfQuotes() returns error? {

// SimplePublicObjectBatchInputUpsert ob4 = {
// id: testQuoteId,
// properties: {
// "hs_title": "Test Quote 4",
// "hs_expiration_date": "2025-05-31"
// }
// };

// BatchInputSimplePublicObjectBatchInputUpsert payload = {
// inputs: [ob4]
// };

// // Call the Quotes API to create a new quote
// BatchResponseSimplePublicUpsertObject|BatchResponseSimplePublicUpsertObjectWithErrors|error response = hubspotClient->/batch/upsert.post(payload);

// // Validate the response
// if(response is BatchResponseSimplePublicUpsertObject){
// test:assertTrue(response.results.length() == payload.inputs.length(),
// msg = "Quote in response does not match the expected quote.");
// }else{
// test:assertFail("Errors in updating.");
// }
// }

Copy link
Member

Choose a reason for hiding this comment

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

Let's remove the commented code.

@@ -2,7 +2,7 @@
distribution = "2201.10.0"
org = "ballerinax"
name = "hubspot.crm.commerce.quotes"
version = "@toml.version@"
Copy link
Member

Choose a reason for hiding this comment

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

@toml.version@ shouldn't be removed. Check out the build.gradle file under ballerina directory for it's usage.

Copy link
Author

Choose a reason for hiding this comment

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

done

@MohamedSabthar
Copy link
Member

@harithmaduranga It's seems like sanitations.md file is missing. Let's add it in the same PR.

Copy link
Member

@MohamedSabthar MohamedSabthar left a comment

Choose a reason for hiding this comment

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

Module.md and README.md files are missing. Make sure to add them.

ballerina/Ballerina.toml Outdated Show resolved Hide resolved
ballerina/Ballerina.toml Outdated Show resolved Hide resolved
ballerina/Package.md Outdated Show resolved Hide resolved
ballerina/Package.md Outdated Show resolved Hide resolved
ballerina/Package.md Outdated Show resolved Hide resolved
examples/sales_analytics/Ballerina.toml Outdated Show resolved Hide resolved
examples/sales_analytics/main.bal Outdated Show resolved Hide resolved
examples/sales_analytics/main.bal Show resolved Hide resolved
examples/sales_analytics/.gitignore Outdated Show resolved Hide resolved
examples/sales_analytics/main.bal Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
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.

3 participants