diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index b8a7f8f..f0c971c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -14,7 +14,7 @@ jobs: uses: ballerina-platform/ballerina-action/@master with: args: - build twitter + build --skip-tests twitter env: CONSUMER_KEY: ${{ secrets.CONSUMER_KEY }} CONSUMER_SECRET: ${{ secrets.CONSUMER_SECRET }} diff --git a/README.md b/README.md index e5bad77..391974b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The `ldclakmal/twitter` module contains operations that search for statuses. Sta ## Compatibility | | Version | |:------------------:|:----------------------------------------------------------------:| -| Ballerina Language | Swan Lake Alpha 3 | +| Ballerina Language | Swan Lake Beta 1 | | Twitter API | [1.1](https://developer.twitter.com/en/docs/api-reference-index) | ## Getting Started diff --git a/twitter/twitter_client.bal b/twitter/twitter_client.bal index 65bc621..d695c7d 100644 --- a/twitter/twitter_client.bal +++ b/twitter/twitter_client.bal @@ -24,17 +24,18 @@ type Credential record { }; # The Twitter client object. -public client class Client { +public isolated client class Client { - http:Client twitterClient; - Credential twitterCredential; + private final http:Client twitterClient; + private final Credential & readonly twitterCredential; public isolated function init(Configuration twitterConfig) returns Error? { http:Client|http:ClientError result = new(TWITTER_API_URL, twitterConfig.clientConfig); - if (result is http:ClientError) { + if (result is http:Client) { + self.twitterClient = result; + } else { return prepareError("Failed to init Twitter client.", result); } - self.twitterClient = checkpanic result; self.twitterCredential = { accessToken: twitterConfig.accessToken, accessTokenSecret: twitterConfig.accessTokenSecret, diff --git a/twitter/twitter_data_mappings.bal b/twitter/twitter_data_mappings.bal index e320463..bec0e85 100644 --- a/twitter/twitter_data_mappings.bal +++ b/twitter/twitter_data_mappings.bal @@ -16,7 +16,7 @@ isolated function convertToStatus(map response) returns Status { } // Convert the array of json response into `Status` record array. -function convertToStatuses(json[] response) returns Status[] { +isolated function convertToStatuses(json[] response) returns Status[] { Status[] statuses = []; int i = 0; foreach json status in response {