Skip to content

Commit 8f5e80c

Browse files
Merge pull request #84 from sachinira/slalpha2
Migrate the Ballerina Connector for Gmail from version SLP8 to SLAlpha2
2 parents 01777a7 + 02ab4f3 commit 8f5e80c

File tree

16 files changed

+448
-413
lines changed

16 files changed

+448
-413
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
build
1717
env:
1818
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
19-
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
2019
CLIENT_ID: ${{ secrets.CLIENT_ID }}
2120
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
2221
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
env:
2323
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
2424
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
25-
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
2625
CLIENT_ID: ${{ secrets.CLIENT_ID }}
2726
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
2827
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
# Log file
55
*.log
66

7-
#conf file
8-
ballerina.conf
7+
#Config file
8+
Config.toml
9+
# Modules
10+
/modules
911

1012
# BlueJ files
1113
*.ctxt

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
script:
16-
- wget http://dist-dev.ballerina.io/downloads/swan-lake-preview8/ballerina-linux-installer-x64-swan-lake-preview8.deb
17-
- sudo dpkg -i ballerina-linux-installer-x64-swan-lake-preview8.deb
16+
- wget http://dist-dev.ballerina.io/downloads/swan-lake-alpha2/ballerina-linux-installer-x64-swan-lake-alpha2.deb
17+
- sudo dpkg -i ballerina-linux-installer-x64-swan-lake-alpha2.deb
1818
- sudo apt-get install -f
19-
- ballerina --version
20-
- ballerina build -c --skip-tests
19+
- bal --version
20+
- bal build -c --skip-tests

Ballerina.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
org = "ballerinax"
33
name = "googleapis_gmail"
4-
version = "0.99.3"
4+
version = "0.99.4"
55
authors = ["Ballerina"]
66
repository = "https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail"
77
keywords = ["gmail","email"]

Module.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,10 @@ You can now enter the credentials in the Gmail client config.
2727
```ballerina
2828
gmail:GmailConfiguration gmailConfig = {
2929
oauthClientConfig: {
30-
accessToken: <ACCESS_TOKEN>,
31-
refreshConfig: {
32-
refreshUrl: gmail:REFRESH_URL,
33-
refreshToken: <REFRESH_TOKEN>,
34-
clientId: <CLIENT_ID>,
35-
clientSecret: <CLIENT_SECRET>
36-
}
30+
refreshUrl: gmail:REFRESH_URL,
31+
refreshToken: <REFRESH_TOKEN>,
32+
clientId: <CLIENT_ID>,
33+
clientSecret: <CLIENT_SECRET>
3734
}
3835
};
3936
@@ -44,7 +41,7 @@ gmail:Client gmailClient = new (gmailConfig);
4441

4542
| Ballerina Language Versions | Gmail API Version |
4643
|:----------------------------:|:-----------------:|
47-
| Swan Lake Preview8-SNAPSHOT | v1 |
44+
| Swan Lake Alpha 2 | v1 |
4845

4946
## Sample
5047

@@ -54,15 +51,13 @@ import ballerinax/googleapis_gmail as gmail;
5451
5552
gmail:GmailConfiguration gmailConfig = {
5653
oauthClientConfig: {
57-
accessToken: <ACCESS_TOKEN>,
58-
refreshConfig: {
59-
refreshUrl: gmail:REFRESH_URL,
60-
refreshToken: <REFRESH_TOKEN>,
61-
clientId: <CLIENT_ID>,
62-
clientSecret: <CLIENT_SECRET>
63-
}
54+
refreshUrl: gmail:REFRESH_URL,
55+
refreshToken: <REFRESH_TOKEN>,
56+
clientId: <CLIENT_ID>,
57+
clientSecret: <CLIENT_SECRET>
6458
}
6559
};
60+
6661
gmail:Client gmailClient = new (gmailConfig);
6762
public function main(string... args) {
6863
gmail:MessageRequest messageRequest = {};

Package.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,10 @@ You can now enter the credentials in the Gmail client config.
2727
```ballerina
2828
gmail:GmailConfiguration gmailConfig = {
2929
oauthClientConfig: {
30-
accessToken: <ACCESS_TOKEN>,
31-
refreshConfig: {
32-
refreshUrl: gmail:REFRESH_URL,
33-
refreshToken: <REFRESH_TOKEN>,
34-
clientId: <CLIENT_ID>,
35-
clientSecret: <CLIENT_SECRET>
36-
}
30+
refreshUrl: gmail:REFRESH_URL,
31+
refreshToken: <REFRESH_TOKEN>,
32+
clientId: <CLIENT_ID>,
33+
clientSecret: <CLIENT_SECRET>
3734
}
3835
};
3936
@@ -44,7 +41,7 @@ gmail:Client gmailClient = new (gmailConfig);
4441

4542
| Ballerina Language Versions | Gmail API Version |
4643
|:----------------------------:|:-----------------:|
47-
| Swan Lake Preview8 | v1 |
44+
| Swan Lake Alpha 2 | v1 |
4845

4946
## Sample
5047

@@ -54,15 +51,13 @@ import ballerinax/googleapis_gmail as gmail;
5451
5552
gmail:GmailConfiguration gmailConfig = {
5653
oauthClientConfig: {
57-
accessToken: <ACCESS_TOKEN>,
58-
refreshConfig: {
59-
refreshUrl: gmail:REFRESH_URL,
60-
refreshToken: <REFRESH_TOKEN>,
61-
clientId: <CLIENT_ID>,
62-
clientSecret: <CLIENT_SECRET>
63-
}
54+
refreshUrl: gmail:REFRESH_URL,
55+
refreshToken: <REFRESH_TOKEN>,
56+
clientId: <CLIENT_ID>,
57+
clientSecret: <CLIENT_SECRET>
6458
}
6559
};
60+
6661
gmail:Client gmailClient = new (gmailConfig);
6762
public function main(string... args) {
6863
gmail:MessageRequest messageRequest = {};

Readme.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The following sections provide you with information on how to use the Ballerina
1717

1818
| Ballerina Language Versions | Gmail API Version |
1919
|:----------------------------:|:-----------------:|
20-
| Swan Lake Preview8 | v1 |
20+
| Swan Lake Alpha 2 | v1 |
2121

2222
## Feature Overview
2323

@@ -82,13 +82,10 @@ You can now enter the credentials in the Gmail client config.
8282
```ballerina
8383
gmail:GmailConfiguration gmailConfig = {
8484
oauthClientConfig: {
85-
accessToken: <ACCESS_TOKEN>,
86-
refreshConfig: {
87-
refreshUrl: gmail:REFRESH_URL,
88-
refreshToken: <REFRESH_TOKEN>,
89-
clientId: <CLIENT_ID>,
90-
clientSecret: <CLIENT_SECRET>
91-
}
85+
refreshUrl: gmail:REFRESH_URL,
86+
refreshToken: <REFRESH_TOKEN>,
87+
clientId: <CLIENT_ID>,
88+
clientSecret: <CLIENT_SECRET>
9289
}
9390
};
9491
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//API urls
1818
const string BASE_URL = "https://www.googleapis.com/gmail";
1919
# Holds the value for URL of refresh token end point.
20-
public const string REFRESH_URL = "https://www.googleapis.com/oauth2/v4/token";
20+
public const string REFRESH_URL = "https://oauth2.googleapis.com/token";
2121
# Holds the value for oauth scheme.
2222
const string OAUTH = "oauth";
2323

0 commit comments

Comments
 (0)