Skip to content
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f12d6b6
Add generated Ballerina connector
SashenkaG Jun 16, 2025
6d75d49
[Automated] Update the toml files
SashenkaG Jun 18, 2025
17a1196
Add openapi spec for trello
SashenkaG Jun 20, 2025
c5f7cb2
Generate connector for trello
SashenkaG Jun 20, 2025
1f250a4
Add test cases for trello connector
SashenkaG Jun 20, 2025
63d24bf
[Automated] Update the toml files
SashenkaG Jun 24, 2025
d59d162
[Automated] Update the toml files
SashenkaG Jun 24, 2025
1994f2a
[Automated] Update the toml files
SashenkaG Jun 24, 2025
1988ead
[Automated] Update the toml files
SashenkaG Jun 24, 2025
58952da
[Automated] Update the toml files
SashenkaG Jun 24, 2025
8877c66
Update copyright year and refactor test functions for improved clarity
SashenkaG Jun 25, 2025
c12f26d
[Automated] Update the toml files
SashenkaG Jun 25, 2025
b44b891
Simplify resource function implementations in mock_service.bal
SashenkaG Jun 25, 2025
1950eda
Update sanitation document
SashenkaG Jun 25, 2025
7bc3850
Refactor mock_service.bal and tests.bal for improved clarity and cons…
SashenkaG Jun 25, 2025
210d14e
[Automated] Update the toml files
SashenkaG Jun 25, 2025
df19790
Add keywords and icon to Ballerina.toml
SashenkaG Jun 25, 2025
116a523
Add icon image to ballerina directory
SashenkaG Jun 25, 2025
426d6ae
Add missing new lines in mock_service.bal and tests.bal for improved …
SashenkaG Jun 25, 2025
7dcfbd9
[Automated] Update the toml files
SashenkaG Jun 25, 2025
db0b832
Remove unnecessary parameters from resource function documentation in…
SashenkaG Jun 25, 2025
27c05a4
Fix in Ballerina.toml
SashenkaG Jun 25, 2025
d95e603
Fix formatting and update source link in sanitations.md
SashenkaG Jun 25, 2025
f471732
Update sanitations.md
SashenkaG Jun 25, 2025
fbec81e
Fix formatting and update command in sanitations.md
SashenkaG Jun 25, 2025
d586d47
Update ballerinaLangVersion to 2201.12.7 in gradle.properties
SashenkaG Jun 25, 2025
b4c2373
Update ballerinaGradlePluginVersion to 2.3.0 in gradle.properties
SashenkaG Jun 26, 2025
4d0c72c
Regenerate client and add copyright notice and license information to…
SashenkaG Jun 26, 2025
4da7fe9
Enhance README and testing documentation for Trello connector; add se…
SashenkaG Jun 26, 2025
f9d426d
Update README.md
SashenkaG Jun 26, 2025
0471ccb
Update README.md
SashenkaG Jun 26, 2025
4277fc0
Refactor README image placements
SashenkaG Jun 26, 2025
5bba5c3
Merge branch 'main' of https://github.com/SashenkaG/module-ballerinax…
SashenkaG Jun 26, 2025
5c974c0
Merge branch 'ballerina-platform:main' into main
SashenkaG Jun 27, 2025
244ad5a
Update .gitignore, README, and test configurations; add new dependenc…
SashenkaG Jun 27, 2025
bfe7368
Add example for creating and retrieving a list and cards in Trello; i…
SashenkaG Jun 27, 2025
1d65804
Add example for creating and managing cards in Trello; include necess…
SashenkaG Jun 27, 2025
b8040fd
Remove local repository reference from Ballerina.toml for Create_card…
SashenkaG Jun 27, 2025
5138619
Remove local repository reference from Ballerina.toml for Create_list…
SashenkaG Jun 27, 2025
49e8d04
Update README.md to use absolute URLs for images in setup instructions
SashenkaG Jun 27, 2025
34e6506
Refactor README.md for clarity and consistency; update links and imag…
SashenkaG Jun 27, 2025
5cfb14c
Refactor test configuration to use hardcoded values for local testing…
SashenkaG Jun 27, 2025
ff7010d
[Automated] Update the toml files
SashenkaG Jun 27, 2025
a4a8133
Remove unused devcontainer and gitignore files from Create_card and C…
SashenkaG Jun 28, 2025
8162da9
Rename package in Ballerina.toml nad remove local dependency
SashenkaG Jun 28, 2025
eebf4ef
Rename package in Ballerina.toml to follow naming conventions and rem…
SashenkaG Jun 28, 2025
ab2f14d
Update configuration keys in README.md for Trello API to match naming…
SashenkaG Jun 28, 2025
e101b54
Fix formatting in README.md for Create_list example to enhance readab…
SashenkaG Jun 28, 2025
d288e54
Refactor Create_card and Create_list examples to improve error handli…
SashenkaG Jun 28, 2025
04e6117
Fix: Make build scripts executable
SashenkaG Jun 28, 2025
6874385
Update configuration in examples to use configurable variables
SashenkaG Jun 30, 2025
9430cb9
Update README.md to clarify configuration settings
SashenkaG Jun 30, 2025
7c43c51
updated tests.bal and README.md
SashenkaG Jun 30, 2025
8dd1824
Add README and renamed files
SashenkaG Jun 30, 2025
66cfa92
Deleted duplicate file
SashenkaG Jun 30, 2025
ae3033c
Remove Trello dependency from example configurations and update docum…
SashenkaG Jun 30, 2025
d284771
Fix example links in README to use lowercase directory names
SashenkaG Jun 30, 2025
ddfe419
Refactor README for clarity and formatting improvements
SashenkaG Jun 30, 2025
497f086
Add example for creating a card in the README
SashenkaG Jun 30, 2025
f21b18f
Update configuration keys in example documentation for consistency
SashenkaG Jun 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ target/
generated/
.ballerina
**/Config.toml
examples/**/Dependencies.toml

# Ignore Gradle project-specific cache directory
.gradle
Expand Down
89 changes: 72 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,85 @@

## Overview

[//]: # (TODO: Add overview mentioning the purpose of the module, supported REST API versions, and other high-level details.)
[Trello](https://trello.com/) is a popular web-based project management and collaboration platform developed by Atlassian, allowing users to organize tasks, projects, and workflows using boards, lists, and cards.

The `ballerinax/trello` package provides APIs to connect and interact with [Trello's RESTful API endpoints](https://developer.atlassian.com/cloud/trello/rest/api-group-actions/), enabling developers to seamlessly manage boards, lists, cards, and other Trello resources.

## Setup guide

[//]: # (TODO: Add detailed steps to obtain credentials and configure the module.)
To use the Trello connector, you must have access to the Trello API through a Trello account and an API key and token generated from it. If you do not have a Trello account, you can sign up for one [here](https://id.atlassian.com/signup). You can generate your Trello API key and token by following the instructions at [Trello API Keys](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/).


1. Visit https://trello.com/power-ups/admin and create a new powerup

![trello powerup](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-powerups.png)

2. Enter the required details:
* Name of your Power-Up
* Iframe Connector URL (can be a placeholder URL during development)
Click “Create” to create your Power-Up.

![trello powerup form](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-form.png)

3. Navigate to 'API Key' and click on 'Generate'

![generate trello apikey](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-generateKey.png)

Copy and securely store your API Key.

4. Next to the API Key description, there's a link to the token.
Click the link, authorize the Power-Up, and you’ll be redirected to a page displaying your OAuth token.

![get trello Key](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-key.png)

![allow token](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-permission.png)

Copy and securely store the Token.

![trello token](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-token.png)

## Quickstart

[//]: # (TODO: Add a quickstart guide to demonstrate a basic functionality of the module, including sample code snippets.)
To use the Trello connector in your Ballerina application, update the .bal file as follows:

#### Step 1: Import the module

Import the Trello module.

```bash
import ballerinax/trello;
```

#### Step 2: Instantiate a new connector

Create a `Config.toml` file and configure the obtained credentials as follows:

```bash
key = "your_api_key"
token = "your_api_token"
```

#### Step 3: Invoke the connector operation

Now, utilize the available connector operations.

Create a card

## Examples

The `Trello` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/module-ballerinax-trello/tree/main/examples/), covering the following use cases:

[//]: # (TODO: Add examples)
1. [**Create and Retrieve a List and Cards in Trello**](examples/Create_list/) - Create a new list in a specific Trello board and retrieve its details using the list ID.
2. [**Create, Update fetch add label to a Card in Trello**](examples/Create_card/) - Create a new card in a Trello list and update the card's name and view it.

## Build from the source

### Setting up the prerequisites

1. Download and install Java SE Development Kit (JDK) version 21. You can download it from either of the following sources:

* [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
* [OpenJDK](https://adoptium.net/)
- [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
- [OpenJDK](https://adoptium.net/)

> **Note:** After installation, remember to set the `JAVA_HOME` environment variable to the directory where JDK was installed.

Expand All @@ -41,10 +96,10 @@ The `Trello` connector provides practical examples illustrating usage in various

4. Export Github Personal access token with read package permissions as follows,

```bash
export packageUser=<Username>
export packagePAT=<Personal access token>
```
```bash
export packageUser=<Username>
export packagePAT=<Personal access token>
```

### Build options

Expand Down Expand Up @@ -88,9 +143,9 @@ Execute the commands below to build from the source.

7. Publish the generated artifacts to the local Ballerina Central repository:

```bash
./gradlew clean build -PpublishToLocalCentral=true
```
```bash
./gradlew clean build -PpublishToLocalCentral=true
```

8. Publish the generated artifacts to the Ballerina Central repository:

Expand All @@ -110,7 +165,7 @@ All the contributors are encouraged to read the [Ballerina Code of Conduct](http

## Useful links

* For more information go to the [`trello` package](https://central.ballerina.io/ballerinax/trello/latest).
* For example demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/).
* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
- For more information go to the [`trello` package](https://central.ballerina.io/ballerinax/trello/latest).
- For example demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/).
- Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
65 changes: 61 additions & 4 deletions ballerina/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,74 @@
# Ballerina Trello connector

## Overview

[//]: # (TODO: Add overview mentioning the purpose of the module, supported REST API versions, and other high-level details.)
[Trello](https://trello.com/) is a popular web-based project management and collaboration platform developed by Atlassian, allowing users to organize tasks, projects, and workflows using boards, lists, and cards.

The `ballerinax/trello` package provides APIs to connect and interact with [Trello's RESTful API endpoints](https://developer.atlassian.com/cloud/trello/rest/api-group-actions/), enabling developers to seamlessly manage boards, lists, cards, and other Trello resources.

## Setup guide

[//]: # (TODO: Add detailed steps to obtain credentials and configure the module.)
To use the Trello connector, you must have access to the Trello API through a Trello account and an API key and token generated from it. If you do not have a Trello account, you can sign up for one [here](https://id.atlassian.com/signup). You can generate your Trello API key and token by following the instructions at [Trello API Keys](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/).


1. Visit https://trello.com/power-ups/admin and create a new powerup

![trello powerup](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-powerups.png)

2. Enter the required details:
* Name of your Power-Up
* Iframe Connector URL (can be a placeholder URL during development)
Click “Create” to create your Power-Up.

![trello powerup form](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-form.png)

3. Navigate to 'API Key' and click on 'Generate'

![generate trello apikey](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-generateKey.png)

Copy and securely store your API Key.

4. Next to the API Key description, there's a link to the token.
Click the link, authorize the Power-Up, and you’ll be redirected to a page displaying your OAuth token.

![get trello Key](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-key.png)

![allow token](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-permission.png)

Copy and securely store the Token.

![trello token](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-trello/refs/heads/main/docs/setup/resources/trello-token.png)

## Quickstart

[//]: # (TODO: Add a quickstart guide to demonstrate a basic functionality of the module, including sample code snippets.)
To use the Trello connector in your Ballerina application, update the .bal file as follows:

#### Step 1: Import the module

Import the Trello module.

```bash
import ballerinax/trello;
```

#### Step 2: Instantiate a new connector

Create a `Config.toml` file and configure the obtained credentials as follows:

```bash
key = "your_api_key"
token = "your_api_token"
```

#### Step 3: Invoke the connector operation

Now, utilize the available connector operations.

Create a card

## Examples

The `Trello` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/module-ballerinax-trello/tree/main/examples/), covering the following use cases:

[//]: # (TODO: Add examples)
1. [**Create and Retrieve a List and Cards in Trello**](examples/Create_list/) - Create a new list in a specific Trello board and retrieve its details using the list ID.
2. [**Create, Update fetch add label to a Card in Trello**](examples/Create_card/) - Create a new card in a Trello list and update the card's name and view it.
105 changes: 105 additions & 0 deletions ballerina/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Running Tests

## Prerequisites

To run tests for the Trello connector, you will need:

- A Trello account.
- A Power-Up created via the Trello Developer Portal.
- Your API Key and API Token, which you can obtain from the Trello API Key page.
- The Board ID, List ID, and optionally Card IDs to test live APIs.

## Running Tests

The Trello connector supports two environments for testing:

| Test Group | Environment |
| ------------ | -------------------------------------- |
| `mock_tests` | Mock server for Trello API _(default)_ |
| `live_tests` | Actual Trello API |

Use the `isLiveServer` configuration to switch between environments.

Please ensure that the `boardId`, `listId`, and `cardId` values correspond to actual resources in your Trello account and boards when running tests against the live API.

## Running Tests in the Mock Server

### 🔹 Option 1: Using `Config.toml` in the `tests/` Directory

Create a file named `Config.toml` in the `tests/` folder with the following content:

```toml
[ballerinax.trello]
key = "api-key"
token = "api-token"
isLiveServer = false
```

Set `isLiveServer` to false in `Config.toml` to set mock test environment

Then, run the following command to run the tests:

```
./gradlew clean test

```

### 🔹Option 2: Using Environment Variables

Linux/macOS

```
export key="api-key"
export token="api-token"
export isLiveServer = false
```

Windows

```
setx key "api-key"
setx token "api-token"
setx isLiveServer = false
```

## Running Tests Against Trello Live API

**Using a Config.toml File**

Create a Config.toml file in the tests directory and add your authentication credentials as follows

```
token = "<your-trellor-access-token>"
key = "<your-trello-key>"
isLiveServer = true
```

Set `isLiveServer` to true in `Config.toml` to set live test environment

Note that you have to use your real trello Board and List IDs when testing in the live environment.

**Using Environment Variables**

Alternatively, you can set your authentication credentials as environment variables:

If you are using linux or mac, you can use following method:

```
export token ="<your-trello-access-token>"
export key ="<your-trello-key>"
export isLiveServeer = true
```

If you are using Windows you can use following method:

```
setx token "<your-trello-access-token>"
setx key "<your-trello-key>"
setx isLiveServer = true
```

Then, run the following command to run the tests:

```
./gradlew clean test
```
11 changes: 4 additions & 7 deletions ballerina/tests/tests.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@

import ballerina/test;

configurable string key = ?;
configurable string token = ?;
configurable boolean isLiveServer = ?;
configurable boolean isLiveServer = true;
configurable string key = "1234567890abcdef1234567890abcdef";
configurable string token = "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890";
configurable string baseUrl = "http://localhost:9090";

string testBoardID = "8SnkvBJj";
string testListID = "68539f5c1899d49ed12e804e";

string mockBaseUrl = "http://localhost:9090";
string liveBaseUrl = "https://api.trello.com/1";
string baseUrl = isLiveServer ? liveBaseUrl : mockBaseUrl;

ApiKeysConfig apiKeyConfig = {
key,
token
Expand Down
Binary file added docs/setup/resources/trello-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/setup/resources/trello-generateKey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/setup/resources/trello-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/setup/resources/trello-permission.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/setup/resources/trello-powerups.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/setup/resources/trello-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions examples/Create_card/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
org = "wso2"
name = "create_card"
version = "0.1.0"
distribution = "2201.12.7"

[build-options]
observabilityIncluded = true
37 changes: 37 additions & 0 deletions examples/Create_card/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Create, Update fetch add label to a Card in Trello

This example demonstrates how to use the Trello API with Ballerina to create a card in a specific Trello list, update its name, and add a label to it. This use case is useful for automating task management workflows where card creation, modification, and labeling are performed programmatically.

---

## Prerequisites

### 1. Trello Developer Access

Refer to the [Setup guide](../../README.md) to obtain necessary credentials (client Id, client secret, tokens).

### 2. Board and List

Before running the example, make sure you have:
- A valid **Board ID**
- A **List ID** under that board where the card will be created

You can retrieve the list ID from the URL of the list in Trello or by calling Trello's `GET /boards/{id}/lists` endpoint.

---
## Configuration

Create a file named `Config.toml` in the root directory of this example with the following content:

```toml
key = "<Your Trello API Key>"
token = "<Your Trello API Token>"
```

## Run the example

Execute the following command to run the example:

```bash
bal run
```
Loading
Loading