-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
Conversation
|
ballerina/Ballerina.toml
Outdated
@@ -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 |
There was a problem hiding this comment.
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
keywords = [] # TODO: Add keywords | |
keywords = ["hubspot"] # TODO: Add keywords |
ballerina/Package.md
Outdated
|
||
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.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these TODOs
ballerina/quotes_service.bal
Outdated
@@ -0,0 +1,111 @@ | |||
// // AUTO-GENERATED FILE. |
There was a problem hiding this comment.
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.
ballerina/tests/test.bal
Outdated
@@ -0,0 +1,241 @@ | |||
import ballerina/test; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update the import order according to this: https://learn-ballerina.github.io/best_practices/format_the_code.html?highlight=import#order-of-the-imports-in-a-bal-file
ballerina/tests/test.bal
Outdated
testQuoteId = response.id; | ||
|
||
// Validate the response | ||
test:assertTrue(response.id != ""); |
There was a problem hiding this comment.
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.
ballerina/tests/test.bal
Outdated
@test:Config{} | ||
function testGetAllQuotes() returns error? { | ||
|
||
CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error response = check hubspotClient->/.get(); |
There was a problem hiding this comment.
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/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check other places.
ballerina/tests/test.bal
Outdated
// // 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."); | ||
// } | ||
// } | ||
|
There was a problem hiding this comment.
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@" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@harithmaduranga It's seems like |
There was a problem hiding this 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.
Purpose
Examples
Checklist