Skip to content

Commit

Permalink
Merge pull request #7 from ldclakmal/dev
Browse files Browse the repository at this point in the history
Update connector for Swan Lake Beta 1
  • Loading branch information
ldclakmal authored Jun 4, 2021
2 parents 7903135 + 09e5e28 commit 1aa5862
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions twitter/twitter_client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion twitter/twitter_data_mappings.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ isolated function convertToStatus(map<json> 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 {
Expand Down

0 comments on commit 1aa5862

Please sign in to comment.