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

Generate Client using OpenAPI spec tool, Update Setup Guide and Quickstart #2

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

Conversation

sajitha-tj
Copy link

@sajitha-tj sajitha-tj commented Dec 23, 2024

Purpose

Initial setup of the ballerina connector

Examples

Checklist

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

@CLAassistant
Copy link

CLAassistant commented Dec 23, 2024

CLA assistant check
All committers have signed the CLA.

All of the API endpoints had the common prefix `/crm/v3/lists`. Those paths are modified to remove this prefix from the endpoints, and included in the base url. This centralizes the versioning to the base url and simplifies the API paths, making them more readable.
As mentioned in the sanitations.md file, few feilds needed changes inorder to generate the connector client correctly.
Previously used resource methods caused a "resource method is ambiguous" error for the endpoint "/crm/v3/lists/folders". Inorder to resolve this error, Ballerina connector was regenerated with remote methods and this fixed the issue.

Additionally, all test cases were updated accordingly with the new generated method names, ensuring compatibility with the updated client methods.
README.md and the module.md files were updated with necessary details about the package. Also did some minor changes on other documentations as well.
A mock service which simulates some of HubSpot CRM API responses was added to allow local testing without hitting the actual HubSpot server. Tests in the tests.bal file were grouped based on the ability to running them with mock server.
Copy link
Member

@ThisaruGuruge ThisaruGuruge left a comment

Choose a reason for hiding this comment

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

Good job overall!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
ballerina/Module.md Outdated Show resolved Hide resolved
ballerina/Module.md Outdated Show resolved Hide resolved
ballerina/Package.md Show resolved Hide resolved
examples/leads_tracker/.gitignore Outdated Show resolved Hide resolved
examples/leads_tracker/main.bal Outdated Show resolved Hide resolved
examples/leads_tracker/main.bal Outdated Show resolved Hide resolved
examples/leads_tracker/main.bal Outdated Show resolved Hide resolved
examples/leads_tracker/main.bal Outdated Show resolved Hide resolved
sajitha-tj and others added 21 commits January 9, 2025 21:53
Co-authored-by: Thisaru Guruge <[email protected]>
Few changes were added as suggested on the PR review. The function used to get the list of lead IDs was simplified to return a list of dummy IDs. In a real world scenario, a database fetch or any other method can be implemented to fetch the relevent IDs.
Since there are only a few endpoints at the mock server, some tests fail when they are executed at the build stage. This update prevents execution of these tests, when the mock server is used.
Previously the mock service started even with live tests. This change will prevent execution of mock server when the live hubspot server is used for testing.
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.

4 participants